ARC SDK
|
Wrapper for pointer with automatic destruction. More...
#include <arc/Utils.h>
Public Member Functions | |
AutoPointer (AutoPointer< T > const &o) | |
AutoPointer (void(*d)(T *)=&DefaultDeleter) | |
NULL pointer constructor. More... | |
AutoPointer (T *o, void(*d)(T *)=&DefaultDeleter) | |
Constructor which wraps pointer and optionally defines deletion function. More... | |
AutoPointer (AutoPointer< T > &o) | |
Moving constructor. More... | |
~AutoPointer (void) | |
Destructor destroys wrapped object using assigned deleter. More... | |
AutoPointer< T > & | operator= (T *o) |
AutoPointer< T > & | operator= (AutoPointer< T > &o) |
T & | operator* (void) const |
For referring wrapped object. More... | |
T * | operator-> (void) const |
For referring wrapped object. More... | |
operator bool (void) const | |
Returns false if pointer is NULL and true otherwise. More... | |
bool | operator! (void) const |
Returns true if pointer is NULL and false otherwise. More... | |
T * | Ptr (void) const |
Cast to original pointer. More... | |
T & | operator[] (int pos) |
T const & | operator[] (int pos) const |
T * | Release (void) |
Release referred object so that it can be passed to other container. More... | |
Wrapper for pointer with automatic destruction.
If ordinary pointer is wrapped in instance of this class it will be automatically destroyed when instance is destroyed. This is useful for maintaining pointers in scope of one function. Only pointers returned by new() are supported.