![]() |
PUMA Library Reference Manual
|
#include <Puma/SmartPtr.h>
Inheritance diagram for Puma::SmartPtr< T >:Template based smart pointer implementation. Classes must be derived from SmartPtr::RefCnt to be compatible with this implementation. Example:
Classes | |
| class | RefCnt |
Public Member Functions | |
| SmartPtr () | |
| Construct an empty smart pointer. More... | |
| SmartPtr (const RefCnt *pointer) | |
| Construct a new smart pointer. More... | |
| SmartPtr (const SmartPtr ©) | |
| Copy a smart pointer. More... | |
| ~SmartPtr () | |
| Destroy the smart pointer. More... | |
| void | clear () |
| Clear this smart pointer. More... | |
| bool | valid () const |
| Check whether the smart pointer is valid. More... | |
| bool | operator== (const SmartPtr &other) const |
| Compare this smart pointer with another smart pointer. More... | |
| SmartPtr & | operator= (const SmartPtr ©) |
| Assign a new object to this smart pointer. More... | |
| SmartPtr & | operator= (const RefCnt *copy) |
| Assign a new object to this smart pointer. More... | |
| operator bool () const | |
| Conversion operator to check whether the smart pointer is valid. More... | |
| operator T* () const | |
| Conversion operator for the managed object pointer type. More... | |
| operator const T * () const | |
| Conversion operator for the managed object pointer type. More... | |
| T * | operator-> () |
| Dereference operator for the managed object pointer type. More... | |
| const T * | operator-> () const |
| Dereference operator for the managed object pointer type. More... | |
| T * | operator* () |
| Indirection operator for the managed object pointer type. More... | |
| const T * | operator* () const |
| Indirection operator for the managed object pointer type. More... | |
|
inline |
Construct an empty smart pointer.
|
inline |
Construct a new smart pointer.
| pointer | A pointer to the object to manage. |
|
inline |
Copy a smart pointer.
Increases the reference count of the managed object.
| copy | The smart pointer to copy. |
|
inline |
Destroy the smart pointer.
If this was the last smart pointer referencing the managed object, the object is destroyed too.
|
inline |
Clear this smart pointer.
If this was the last smart pointer referencing the managed object, the object is destroyed.
|
inline |
Conversion operator to check whether the smart pointer is valid.
|
inline |
Conversion operator for the managed object pointer type.
|
inline |
Conversion operator for the managed object pointer type.
|
inline |
Indirection operator for the managed object pointer type.
|
inline |
Indirection operator for the managed object pointer type.
|
inline |
Dereference operator for the managed object pointer type.
|
inline |
Dereference operator for the managed object pointer type.
|
inline |
Assign a new object to this smart pointer.
If this smart pointer already points to an object, then this object might be destroyed if not referenced by another smart pointer.
| copy | The smart pointer to copy. |
|
inline |
Assign a new object to this smart pointer.
If this smart pointer already points to an object, then this object might be destroyed if not referenced by another smart pointer.
| copy | The smart pointer to copy. |
|
inline |
Compare this smart pointer with another smart pointer.
| other | The smart pointer to compare with. |
|
inline |
Check whether the smart pointer is valid.
A smart pointer is valid if the managed pointer isn't NULL.