Cafu Engine
IntrusivePtrT< T > Class Template Reference

This class implements smart (reference-counted) pointers. More...

#include "Pointer.hpp"

Public Member Functions

 IntrusivePtrT (T *Ptr=0)
 The constructor. More...
 
 IntrusivePtrT (const IntrusivePtrT &IP)
 The copy constructor. More...
 
template<class Y >
 IntrusivePtrT (const IntrusivePtrT< Y > &IP)
 The copy constructor (for Y classes that are derived from T). More...
 
 ~IntrusivePtrT ()
 The destructor. More...
 
IntrusivePtrToperator= (const IntrusivePtrT &IP)
 The assignment operator. More...
 
T * get () const
 Returns the stored pointer. More...
 
T * operator-> () const
 The structure dereference operator. More...
 
T & operator* ()
 The dereference operator. More...
 
const T & operator* () const
 The dereference operator (const). More...
 
bool operator== (const IntrusivePtrT &IP) const
 The equality operator. More...
 
template<class U >
bool operator== (U *b) const
 
bool operator!= (const IntrusivePtrT &IP) const
 The inequality operator. More...
 
template<class U >
bool operator!= (U *b) const
 
bool IsNull () const
 A safe alternative for the bool conversion operator. More...
 

Detailed Description

template<class T>
class IntrusivePtrT< T >

This class implements smart (reference-counted) pointers.

The implementation is intrusive: It requires from the class T that it is used with that it keeps a member m_RefCount that it can access either publicly or as a friend.

This class might be replaced by boost::intrusive_ptr<> at a later time.

Constructor & Destructor Documentation

template<class T>
IntrusivePtrT< T >::IntrusivePtrT ( T *  Ptr = 0)
inline

The constructor.

template<class T>
IntrusivePtrT< T >::IntrusivePtrT ( const IntrusivePtrT< T > &  IP)
inline

The copy constructor.

template<class T>
template<class Y >
IntrusivePtrT< T >::IntrusivePtrT ( const IntrusivePtrT< Y > &  IP)
inline

The copy constructor (for Y classes that are derived from T).

template<class T>
IntrusivePtrT< T >::~IntrusivePtrT ( )
inline

The destructor.

Member Function Documentation

template<class T>
T* IntrusivePtrT< T >::get ( ) const
inline

Returns the stored pointer.

template<class T>
bool IntrusivePtrT< T >::operator!= ( const IntrusivePtrT< T > &  IP) const
inline

The inequality operator.

template<class T>
T& IntrusivePtrT< T >::operator* ( )
inline

The dereference operator.

template<class T>
const T& IntrusivePtrT< T >::operator* ( ) const
inline

The dereference operator (const).

template<class T>
T* IntrusivePtrT< T >::operator-> ( ) const
inline

The structure dereference operator.

template<class T>
IntrusivePtrT& IntrusivePtrT< T >::operator= ( const IntrusivePtrT< T > &  IP)
inline

The assignment operator.

template<class T>
bool IntrusivePtrT< T >::operator== ( const IntrusivePtrT< T > &  IP) const
inline

The equality operator.


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