Scopira  20080306
scopira::tool::count2_ptr< T > Class Template Reference

#include <object.h>

Public Types

typedef T ptr_type
 

Public Member Functions

 count2_ptr (bool doref, T *o)
 
 count2_ptr (const count_ptr< T > &o)
 
 ~count2_ptr ()
 
void set (T *o)
 
count2_ptroperator= (T *o)
 
count2_ptroperator= (const count2_ptr< T > &o)
 
bool operator== (const count2_ptr< T > &rhs) const
 
bool operator== (const T *rhs) const
 
bool operator!= (const count2_ptr< T > &rhs) const
 
bool operator!= (const T *rhs) const
 
bool operator< (const count2_ptr< T > &rhs) const
 
oflow_iprint (oflow_i &o) const
 
T * get (void) const
 
 operator T* (void) const
 
T & ref (void) const
 
T * operator-> (void) const
 
T & operator* (void) const
 
bool is_null (void) const
 

Protected Attributes

T * dm_ptr
 
bool dm_doref
 

Detailed Description

template<class T>
class scopira::tool::count2_ptr< T >

This auto pointer is a more flexibile (but much less used and usefull) version of scopira::tool::count_ptr.

This version is used in only special cases, you typically should prefer the popular scopira::tool::count_ptr.

This pointer stores an internal bool (which is set only via the constructor) that controls weither or not this auto pointer does any reference counting at all. If set to true, then it acts like a normal count_ptr. If set to false, it will not call any reference counting methods, but just act like a plain, vanilla pointer.

See also
scopira::tool::count_ptr
Author
Aleksander Demko

Constructor & Destructor Documentation

◆ count2_ptr() [1/2]

template<class T>
scopira::tool::count2_ptr< T >::count2_ptr ( bool  doref,
T *  o 
)
inline

constructor

Author
Aleksander Demko Initializing constructor.
Parameters
dorefWiether or not reference counting will be done at all
oinitial value
Author
Aleksander Demko

◆ count2_ptr() [2/2]

template<class T>
scopira::tool::count2_ptr< T >::count2_ptr ( const count_ptr< T > &  o)
inline

Copy constructor

Author
Aleksander Demko

◆ ~count2_ptr()

template<class T>
scopira::tool::count2_ptr< T >::~count2_ptr ( )
inline

Destructor

Author
Aleksander Demko

Member Function Documentation

◆ get()

template<class T>
T* scopira::tool::count2_ptr< T >::get ( void  ) const
inline

Gets the current object as a regular pointer.

Author
Aleksander Demko

◆ is_null()

template<class T>
bool scopira::tool::count2_ptr< T >::is_null ( void  ) const
inline

Is the pointer null?

Returns
true if the internal pointer is null.
Author
Aleksander Demko

◆ operator T*()

template<class T>
scopira::tool::count2_ptr< T >::operator T* ( void  ) const
inline

Returns the current object as a regular pointer. This is an implicit conversion.

Author
Aleksander Demko

◆ operator!=() [1/2]

template<class T>
bool scopira::tool::count2_ptr< T >::operator!= ( const count2_ptr< T > &  rhs) const
inline

Comparison (not equals) - compares internal pointer values.

Author
Aleksander Demko

◆ operator!=() [2/2]

template<class T>
bool scopira::tool::count2_ptr< T >::operator!= ( const T *  rhs) const
inline

Comparison (not equals) operator - compares the internal pointer value to the given pointer.

Author
Aleksander Demko

◆ operator*()

template<class T>
T& scopira::tool::count2_ptr< T >::operator* ( void  ) const
inline

Convinient * deferencer.

Author
Aleksander Demko

◆ operator->()

template<class T>
T* scopira::tool::count2_ptr< T >::operator-> ( void  ) const
inline

Convinient -> accesor to the object

Author
Aleksander Demko

◆ operator<()

template<class T>
bool scopira::tool::count2_ptr< T >::operator< ( const count2_ptr< T > &  rhs) const
inline

Comparison (less than) - compares internal pointer values.

Author
Aleksander Demko

◆ operator=() [1/2]

template<class T>
count2_ptr& scopira::tool::count2_ptr< T >::operator= ( T *  o)
inline

Assignment.

Author
Aleksander Demko

◆ operator=() [2/2]

template<class T>
count2_ptr& scopira::tool::count2_ptr< T >::operator= ( const count2_ptr< T > &  o)
inline

Assignment.

Author
Aleksander Demko

◆ operator==() [1/2]

template<class T>
bool scopira::tool::count2_ptr< T >::operator== ( const count2_ptr< T > &  rhs) const
inline

Comparison (equals) - compares internal pointer values.

Author
Aleksander Demko

◆ operator==() [2/2]

template<class T>
bool scopira::tool::count2_ptr< T >::operator== ( const T *  rhs) const
inline

Comparison (equals) operator - compares the internal pointer value to the given pointer.

Author
Aleksander Demko

◆ print()

template<class T>
oflow_i& scopira::tool::count2_ptr< T >::print ( oflow_i o) const
inline

Pretty ascii printer, redirects to internal class.

Author
Aleksander Demko

◆ ref()

template<class T>
T& scopira::tool::count2_ptr< T >::ref ( void  ) const
inline

Gets the current object, as a reference

Author
Aleksander Demko

◆ set()

template<class T>
void scopira::tool::count2_ptr< T >::set ( T *  o)
inline

Sets the current pointer.

Author
Aleksander Demko

The documentation for this class was generated from the following file: