#include <ParmParse.H>
Inheritance diagram for PP_CpPtr< T >:
Public Methods | |
PP_CpPtr () | |
: The default constructor. The wrapped pointer is null. | |
PP_CpPtr (T *rhs) | |
: Construct a PP_CpPtr<T> setting the wrapped pointer to rhs. | |
~PP_CpPtr () | |
: The destructor. Deletes the wrapped pointer. | |
PP_CpPtr (const PP_CpPtr< T > &rhs) | |
PP_CpPtr< T > & | operator= (T *rhs) |
PP_CpPtr< T > & | operator= (const PP_CpPtr< T > &rhs) |
T & | operator * () const |
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 PP_CpPtr< T > &rhs) const |
: Are the two pointers (not the values to which they point) equal? | |
bool | operator!= (const PP_CpPtr< T > &rhs) const |
: Are the two pointers not equal? | |
Protected Attributes | |
T * | ptr |
The template class PP_CpPtr<T> provides a simple wrapper around a pointer to type T (T*) that builds a copy of the pointed-to object when copied from one PP_CpPtr<T> to another. This is in contrast to a reference-counted pointer class that would maintain one pointed-to object with a reference count indicating the number of references. Hence we call this a "copied" smart pointer class. It is intended for use with any type type T, including the intrinsic types. This class does not supply an operator->(), as such an operator on intrinsic types has only recently become a part of the C++ language, and many compilers do not yet implement it.
This is a convenience class for ParmParse and will not be in any way supported by anyone at ANAG.
|
: The default constructor. The wrapped pointer is null.
|
|
: Construct a PP_CpPtr<T> setting the wrapped pointer to rhs.
|
|
: The destructor. Deletes the wrapped pointer.
|
|
: 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. |
|
: Returns true if the wrapped pointer null.
|
|
: Returns a reference to the value pointed to by the wrapped pointer; i.e. dereferencing this PP_CpPtr<T>, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null. |
|
: Are the two pointers not equal?
|
|
: 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. |
|
: Sets the wrapped pointer to rhs. Deletes the previously wrapped pointer. Reimplemented in PP_CpClassPtr< T >. |
|
: Are the two pointers (not the values to which they point) equal?
|
|
: Sets the wrapped pointer to null and returns the previous value.
|
|
|