A reference counting ptr that auto-deletes what it points to when the last copy leaves scope or is otherwise destructed. More...
#include <APtr.h>
Public Member Functions | |
APtr (T *t_ptr=NULL) | |
Default constructor assigning the value of the pointer. More... | |
APtr (const APtr< T > &other) | |
Copy constructor. More... | |
template<class Tderived > | |
APtr (const Ptr< Tderived > &other) | |
A conversion constructor which creates a new APtr from a Ptr of the same or a derived type. More... | |
APtr & | operator= (const APtr< T > &other) |
An assignment operator, which increases the shared reference count with the source APtr. More... | |
~APtr () | |
Destructor which decreases the shared reference count. More... | |
void | Delete () |
Delete the object pointed to and set the shared pointer for all linked APtr's to NULL. More... | |
APtr< const T > | ExtractConst () |
Extract APtr<const T> and revokes ownership from this object. | |
A reference counting ptr that auto-deletes what it points to when the last copy leaves scope or is otherwise destructed.
Use this for scope-controlled garbage collection. Like Ptr, dereferencing a null APtr throws ErrorMsgNull. For C++11 the reference counting is thread safe.
Default constructor assigning the value of the pointer.
t_ptr | The new pointer value. |
Copy constructor.
other | The APtr to copy. |
Destructor which decreases the shared reference count.
The object is deleted if the shared reference count reaches 0.
|
inline |