#include <Pointers.H>
Public Member Functions | |
CpClassPtr () | |
The default constructor. The wrapped pointer is null. | |
CpClassPtr (T *rhs) | |
Construct a CpPtr<T> setting the wrapped pointer to rhs. | |
~CpClassPtr () | |
CpClassPtr (const CpClassPtr< T > &rhs) | |
The copy constructor. | |
CpClassPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
CpClassPtr< T > & | operator= (const CpClassPtr< T > &rhs) |
The copy assignment operator. | |
T & | operator* () const |
Applies operator-> to the wrapped pointer. | |
bool | isNull () const |
Returns true if the wrapped pointer null. | |
T * | release () |
Sets the wrapped pointer to null and returns the previous value. | |
bool | operator== (const CpClassPtr< T > &rhs) const |
bool | operator!= (const CpClassPtr< T > &rhs) const |
T * | operator-> () const |
CpClassPtr () | |
The default constructor. The wrapped pointer is null. | |
CpClassPtr (T *rhs) | |
Construct a CpPtr<T> setting the wrapped pointer to rhs. | |
~CpClassPtr () | |
CpClassPtr (const CpClassPtr< T > &rhs) | |
The copy constructor. | |
CpClassPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
CpClassPtr< T > & | operator= (const CpClassPtr< T > &rhs) |
The copy assignment operator. | |
T & | operator* () const |
Applies operator-> to the wrapped pointer. | |
bool | isNull () const |
Returns true if the wrapped pointer null. | |
T * | release () |
Sets the wrapped pointer to null and returns the previous value. | |
bool | operator== (const CpClassPtr< T > &rhs) const |
bool | operator!= (const CpClassPtr< T > &rhs) const |
T * | operator-> () const |
CpClassPtr () | |
The default constructor. The wrapped pointer is null. | |
CpClassPtr (T *rhs) | |
Construct a CpPtr<T> setting the wrapped pointer to rhs. | |
CpClassPtr (const CpClassPtr< T > &rhs) | |
The copy constructor. | |
CpClassPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
CpClassPtr< T > & | operator= (const CpClassPtr< T > &rhs) |
The copy assignment operator. | |
T * | operator-> () const |
Applies operator-> to the wrapped pointer. | |
bool | operator== (const CpPtr< T > &rhs) const |
Are the two pointers (not the values to which they point) equal? | |
bool | operator!= (const CpPtr< T > &rhs) const |
Are the two pointers not equal? | |
Protected Attributes | |
T * | ptr |
T * | ptr |
The template class CpClassPtr<T> is derived from CpPtr<T>. It provides a simple wrapper around a pointer to type T (a T*) that "does the right thing" when copied from one CpPtr<T> to another. The type T MUST be a user-defined type, not an intrinsic type. Given this restriction, we can supply an operator->().
CpClassPtr< T >::CpClassPtr | ( | ) | [inline] |
The default constructor. The wrapped pointer is null.
CpClassPtr< T >::CpClassPtr | ( | T * | rhs | ) | [inline, explicit] |
Construct a CpPtr<T> setting the wrapped pointer to rhs.
CpClassPtr< T >::~CpClassPtr | ( | ) | [inline] |
References CpClassPtr< T >::ptr.
CpClassPtr< T >::CpClassPtr | ( | const CpClassPtr< T > & | rhs | ) | [inline] |
The copy constructor.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
References CpClassPtr< T >::isNull(), and CpClassPtr< T >::ptr.
CpClassPtr< T >::CpClassPtr | ( | ) |
The default constructor. The wrapped pointer is null.
CpClassPtr< T >::CpClassPtr | ( | T * | rhs | ) | [explicit] |
Construct a CpPtr<T> setting the wrapped pointer to rhs.
CpClassPtr< T >::~CpClassPtr | ( | ) |
CpClassPtr< T >::CpClassPtr | ( | const CpClassPtr< T > & | rhs | ) |
The copy constructor.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
CpClassPtr< T >::CpClassPtr | ( | ) |
The default constructor. The wrapped pointer is null.
CpClassPtr< T >::CpClassPtr | ( | T * | rhs | ) | [explicit] |
Construct a CpPtr<T> setting the wrapped pointer to rhs.
CpClassPtr< T >::CpClassPtr | ( | const CpClassPtr< T > & | rhs | ) |
The copy constructor.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
CpClassPtr< T > & CpClassPtr< T >::operator= | ( | T * | rhs | ) | [inline] |
Sets the wrapped pointer to rhs.
Deletes the previously wrapped pointer.
Reimplemented from CpPtr< T >.
References CpClassPtr< T >::ptr.
CpClassPtr< T > & CpClassPtr< T >::operator= | ( | const CpClassPtr< T > & | rhs | ) | [inline] |
The copy assignment operator.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
References CpClassPtr< T >::isNull(), and CpClassPtr< T >::ptr.
T & CpClassPtr< T >::operator* | ( | ) | const [inline] |
Applies operator-> to the wrapped pointer.
Reimplemented from CpPtr< T >.
References BL_ASSERT, and CpClassPtr< T >::ptr.
bool CpClassPtr< T >::isNull | ( | ) | const [inline] |
Returns true if the wrapped pointer null.
Reimplemented from CpPtr< T >.
References CpClassPtr< T >::ptr.
Referenced by CpClassPtr< T >::CpClassPtr(), and CpClassPtr< T >::operator=().
T * CpClassPtr< T >::release | ( | ) | [inline] |
Sets the wrapped pointer to null and returns the previous value.
Reimplemented from CpPtr< T >.
References CpClassPtr< T >::ptr.
bool CpClassPtr< T >::operator== | ( | const CpClassPtr< T > & | rhs | ) | const [inline] |
References CpClassPtr< T >::ptr.
bool CpClassPtr< T >::operator!= | ( | const CpClassPtr< T > & | rhs | ) | const [inline] |
References CpClassPtr< T >::ptr.
T * CpClassPtr< T >::operator-> | ( | ) | const [inline] |
References CpClassPtr< T >::ptr.
CpClassPtr<T>& CpClassPtr< T >::operator= | ( | T * | rhs | ) |
Sets the wrapped pointer to rhs.
Deletes the previously wrapped pointer.
Reimplemented from CpPtr< T >.
CpClassPtr<T>& CpClassPtr< T >::operator= | ( | const CpClassPtr< T > & | rhs | ) |
The copy assignment operator.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
T& CpClassPtr< T >::operator* | ( | ) | const |
bool CpClassPtr< T >::isNull | ( | ) | const |
T* CpClassPtr< T >::release | ( | ) |
bool CpClassPtr< T >::operator== | ( | const CpClassPtr< T > & | rhs | ) | const |
bool CpClassPtr< T >::operator!= | ( | const CpClassPtr< T > & | rhs | ) | const |
T* CpClassPtr< T >::operator-> | ( | ) | const |
CpClassPtr<T>& CpClassPtr< T >::operator= | ( | T * | rhs | ) |
Sets the wrapped pointer to rhs.
Deletes the previously wrapped pointer.
Reimplemented from CpPtr< T >.
CpClassPtr<T>& CpClassPtr< T >::operator= | ( | const CpClassPtr< T > & | rhs | ) |
The copy assignment operator.
If the pointer wrapped by rhs is null, the wrapped pointer is null here as well. Otherwise, the contained pointer here is set to a new'd copy of that wrapped by rhs, with the two pointed-to values being identical. This assumes that type T has a well-defined and accessible copy constructor. T must also be a concrete type, not a abstract type.
T* CpClassPtr< T >::operator-> | ( | ) | const |
Applies operator-> to the wrapped pointer.
T* CpClassPtr< T >::ptr [protected] |
Reimplemented from CpPtr< T >.
Referenced by CpClassPtr< T >::CpClassPtr(), CpClassPtr< T >::isNull(), CpClassPtr< T >::operator!=(), CpClassPtr< T >::operator*(), CpClassPtr< T >::operator->(), CpClassPtr< T >::operator=(), CpClassPtr< T >::operator==(), CpClassPtr< T >::release(), and CpClassPtr< T >::~CpClassPtr().
T* CpClassPtr< T >::ptr [protected] |
Reimplemented from CpPtr< T >.