ARC SDK
|
Wrapper for pointer with automatic destruction. More...
#include <arc/Utils.h>
Public Member Functions | |
AutoPointer (void) | |
NULL pointer constructor. More... | |
AutoPointer (T *o) | |
Constructor which wraps pointer. More... | |
~AutoPointer (void) | |
Destructor destroys wrapped object using delete() More... | |
void | operator= (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 * | 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.