#include <Pointers.H>
Public Member Functions | |
LnPtr () | |
The default constructor. The wrapped pointer is null. | |
LnPtr (T *rhs) | |
Construct a LnPtr<T> setting the wrapped pointer to rhs. | |
LnPtr< T > & | operator= (const LnPtr< T > &rhs) |
The copy assignment operator. | |
LnPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
~LnPtr () | |
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference. | |
bool | unique () const |
Returns true if only one reference to the wrapped pointer. | |
int | linkCount () const |
Returns the number of references to the wrapped pointer. | |
T & | operator* () const |
Returns a reference to the value pointed to by the wrapped pointer; i.e. | |
bool | isNull () const |
Returns true if the wrapped pointer is null. | |
bool | operator== (const LnPtr< T > &rhs) const |
Are the two pointers (not the values to which they point) equal? | |
bool | operator!= (const LnPtr< T > &rhs) const |
Are the two pointers not equal? | |
LnPtr () | |
The default constructor. The wrapped pointer is null. | |
LnPtr (T *rhs) | |
Construct a LnPtr<T> setting the wrapped pointer to rhs. | |
LnPtr< T > & | operator= (const LnPtr< T > &rhs) |
The copy assignment operator. | |
LnPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
~LnPtr () | |
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference. | |
bool | unique () const |
Returns true if only one reference to the wrapped pointer. | |
int | linkCount () const |
Returns the number of references to the wrapped pointer. | |
T & | operator* () const |
Returns a reference to the value pointed to by the wrapped pointer; i.e. | |
bool | isNull () const |
Returns true if the wrapped pointer is null. | |
bool | operator== (const LnPtr< T > &rhs) const |
Are the two pointers (not the values to which they point) equal? | |
bool | operator!= (const LnPtr< T > &rhs) const |
Are the two pointers not equal? | |
LnPtr () | |
The default constructor. The wrapped pointer is null. | |
LnPtr (T *rhs) | |
Construct a LnPtr<T> setting the wrapped pointer to rhs. | |
LnPtr< T > & | operator= (const LnPtr< T > &rhs) |
The copy assignment operator. | |
LnPtr< T > & | operator= (T *rhs) |
Sets the wrapped pointer to rhs. | |
~LnPtr () | |
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference. | |
bool | unique () const |
Returns true if only one reference to the wrapped pointer. | |
int | linkCount () const |
Returns the number of references to the wrapped pointer. | |
T & | operator* () const |
Returns a reference to the value pointed to by the wrapped pointer; i.e. | |
bool | isNull () const |
Returns true if the wrapped pointer is null. | |
bool | operator== (const LnPtr< T > &rhs) const |
Are the two pointers (not the values to which they point) equal? | |
bool | operator!= (const LnPtr< T > &rhs) const |
Are the two pointers not equal? | |
Protected Attributes | |
T * | ptr |
T * | ptr |
T * | ptr |
The template class LnPtr<T> provides a reference counted wrapper around a pointer to type T (a T*). This "smart" pointer is intended for use with any type type T, including the intrinsic types. For this reason, we do 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.
The default constructor. The wrapped pointer is null.
Construct a LnPtr<T> setting the wrapped pointer to rhs.
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference.
References LnPtr< T >::ptr, and UseCount::unique().
Construct a LnPtr<T> setting the wrapped pointer to rhs.
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference.
Construct a LnPtr<T> setting the wrapped pointer to rhs.
The destructor -- decrements the reference count and deletes the wrapped pointer if there is only one reference.
The copy assignment operator.
The contained pointer is set to the one wrapped by rhs. The reference count is decremented on this object and the reference count is incremented for the newly wrapped pointer.
References LnPtr< T >::ptr, LnPtr< T >::ucnt, and LnPtr< T >::unique().
Sets the wrapped pointer to rhs.
Decrements the count on the previously wrapped pointer and deletes it if there was only one reference.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
References LnPtr< T >::ptr, and LnPtr< T >::unique().
bool LnPtr< T >::unique | ( | ) | const [inline] |
Returns true if only one reference to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
References UseCount::unique().
Referenced by LnPtr< T >::operator=().
int LnPtr< T >::linkCount | ( | ) | const [inline] |
Returns the number of references to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
References UseCount::linkCount().
T & LnPtr< T >::operator* | ( | ) | const [inline] |
Returns a reference to the value pointed to by the wrapped pointer; i.e.
dereferencing this LnPtr<T>, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
References BL_ASSERT, and LnPtr< T >::ptr.
bool LnPtr< T >::isNull | ( | ) | const [inline] |
Returns true if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
References LnPtr< T >::ptr.
The copy assignment operator.
The contained pointer is set to the one wrapped by rhs. The reference count is decremented on this object and the reference count is incremented for the newly wrapped pointer.
Sets the wrapped pointer to rhs.
Decrements the count on the previously wrapped pointer and deletes it if there was only one reference.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
bool LnPtr< T >::unique | ( | ) | const |
Returns true if only one reference to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
int LnPtr< T >::linkCount | ( | ) | const |
Returns the number of references to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
T& LnPtr< T >::operator* | ( | ) | const |
Returns a reference to the value pointed to by the wrapped pointer; i.e.
dereferencing this LnPtr<T>, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
bool LnPtr< T >::isNull | ( | ) | const |
Returns true if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
Are the two pointers (not the values to which they point) equal?
Are the two pointers not equal?
The copy assignment operator.
The contained pointer is set to the one wrapped by rhs. The reference count is decremented on this object and the reference count is incremented for the newly wrapped pointer.
Sets the wrapped pointer to rhs.
Decrements the count on the previously wrapped pointer and deletes it if there was only one reference.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
bool LnPtr< T >::unique | ( | ) | const |
Returns true if only one reference to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
int LnPtr< T >::linkCount | ( | ) | const |
Returns the number of references to the wrapped pointer.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
T& LnPtr< T >::operator* | ( | ) | const |
Returns a reference to the value pointed to by the wrapped pointer; i.e.
dereferencing this LnPtr<T>, returns the dereferenced wrapped pointer. It is an error if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
bool LnPtr< T >::isNull | ( | ) | const |
Returns true if the wrapped pointer is null.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
Are the two pointers (not the values to which they point) equal?
Are the two pointers not equal?
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
Referenced by LnPtr< T >::isNull(), LnPtr< T >::operator!=(), LnPtr< T >::operator*(), LnPtr< T >::operator=(), LnPtr< T >::operator==(), and LnPtr< T >::~LnPtr().
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.
Reimplemented in LnClassPtr< T >, LnClassPtr< T >, LnClassPtr< BoxArray::Ref >, and LnClassPtr< BoxArray::Ref >.