Scopira 20080306

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

#include <object.h>

List of all members.

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

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
template<class T>
scopira::tool::count2_ptr< T >::count2_ptr ( const count_ptr< T > &  o) [inline]

Copy constructor

Author:
Aleksander Demko
template<class T>
scopira::tool::count2_ptr< T >::~count2_ptr ( ) [inline]

Destructor

Author:
Aleksander Demko

Member Function Documentation

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

Gets the current object as a regular pointer.

Author:
Aleksander Demko
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
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
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
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
template<class T>
T& scopira::tool::count2_ptr< T >::operator* ( void  ) const [inline]

Convinient * deferencer.

Author:
Aleksander Demko
template<class T>
T* scopira::tool::count2_ptr< T >::operator-> ( void  ) const [inline]

Convinient -> accesor to the object

Author:
Aleksander Demko
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
template<class T>
count2_ptr& scopira::tool::count2_ptr< T >::operator= ( const count2_ptr< T > &  o) [inline]

Assignment.

Author:
Aleksander Demko
template<class T>
count2_ptr& scopira::tool::count2_ptr< T >::operator= ( T *  o) [inline]

Assignment.

Author:
Aleksander Demko
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
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
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
template<class T>
T& scopira::tool::count2_ptr< T >::ref ( void  ) const [inline]

Gets the current object, as a reference

Author:
Aleksander Demko
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: