Main Page | Compound List | File List | Compound Members

rptr::Rptr< T > Class Template Reference

General, reference counting smart pointer class. More...

#include <rptr.h>

List of all members.

Public Member Functions

Construction
 Rptr ()
 Rptr (const Rptr &src)
 Rptr (T *data0, bool owner0=true)
Rptr & Set (T *src, bool owner0=true)
 ~Rptr ()
const
T & operator * () const
T * operator-> () const
template<class TT>  operator const Rptr () const
T * Ptr () const
bool IsOwner () const
T * Drop () const
bool operator== (const Rptr &rhs) const
bool operator== (const T *rhs) const
bool operator!= (const Rptr &rhs) const
bool operator!= (const T *rhs) const
nonconst
Rptr & operator= (const Rptr &src)
Rptr & operator= (T *src)
template<class TT> Rptr & DynamicCast (const Rptr< TT > &src)
template<class TT> Rptr & StaticCast (const Rptr< TT > &src)


Detailed Description

template<class T>
class rptr::Rptr< T >

General, reference counting smart pointer class.

This smart pointer provides the following features:


Constructor & Destructor Documentation

template<class T>
rptr::Rptr< T >::Rptr (   )  [inline]
 

Default constructor

template<class T>
rptr::Rptr< T >::Rptr (  const Rptr< T > &  src  )  [inline]
 

Copy constructor

template<class T>
rptr::Rptr< T >::Rptr (  T *  data0,
bool  owner0 = true
)  [inline]
 

Constructor from built-in pointer type

  • data0 Pointer to data
  • owner0 Set this argument to false if object is not to be deleted by the reference counting mechanism e.g. when initializing a pointer object with the address of an object that has not been allocated with operator new.

template<class T>
rptr::Rptr< T >::~Rptr (   )  [inline]
 

Destructor


Member Function Documentation

template<class T>
T* rptr::Rptr< T >::Drop (   )  const [inline]
 

Disable reference counting mechanism for the object this pointer points to.

template<class T>
template<class TT>
Rptr& rptr::Rptr< T >::DynamicCast (  const Rptr< TT > &  src  )  [inline]
 

Dynamic cast (assigns with 0 on failure)

template<class T>
bool rptr::Rptr< T >::IsOwner (   )  const [inline]
 

Returns:
true if the object pointed to will be deleted by the reference counting mechanism.

template<class T>
T& rptr::Rptr< T >::operator * (   )  const [inline]
 

Dereferencing

template<class T>
template<class TT>
rptr::Rptr< T >::operator const Rptr (   )  const [inline]
 

Pointer reference cast operator

template<class T>
bool rptr::Rptr< T >::operator!= (  const T *  rhs  )  const [inline]
 

Inequality, built-in pointer right-hand side

template<class T>
bool rptr::Rptr< T >::operator!= (  const Rptr< T > &  rhs  )  const [inline]
 

Inequality

template<class T>
T* rptr::Rptr< T >::operator-> (   )  const [inline]
 

Member dereferencing

template<class T>
Rptr& rptr::Rptr< T >::operator= (  T *  src  )  [inline]
 

Allow assignment from built-in pointer type

template<class T>
Rptr& rptr::Rptr< T >::operator= (  const Rptr< T > &  src  )  [inline]
 

Assignment operator

template<class T>
bool rptr::Rptr< T >::operator== (  const T *  rhs  )  const [inline]
 

Equality, built-in pointer right-hand side

template<class T>
bool rptr::Rptr< T >::operator== (  const Rptr< T > &  rhs  )  const [inline]
 

Equality

template<class T>
T* rptr::Rptr< T >::Ptr (   )  const [inline]
 

Allow access to built-in pointer

template<class T>
Rptr& rptr::Rptr< T >::Set (  T *  src,
bool  owner0 = true
)  [inline]
 

Reinitialize the pointer

See also:
Rptr(T *, bool)

template<class T>
template<class TT>
Rptr& rptr::Rptr< T >::StaticCast (  const Rptr< TT > &  src  )  [inline]
 

Static cast


The documentation for this class was generated from the following file:
Generated on Wed May 12 15:35:34 2004 for rptr by doxygen 1.3.3