Wrapper for pointer with automatic destruction and mutiple references. More...
#include <Utils.h>
Data Structures | |
class | Base |
Public Member Functions | |
T & | operator* (void) const |
T * | operator-> (void) const |
operator bool (void) const | |
bool | operator! (void) const |
bool | operator== (const CountedPointer &p) const |
bool | operator!= (const CountedPointer &p) const |
bool | operator< (const CountedPointer &p) const |
T * | Ptr (void) const |
T * | Release (void) |
Wrapper for pointer with automatic destruction and mutiple references.
If ordinary pointer is wrapped in instance of this class it will be automatically destroyed when all instances refering to it are destroyed. This is useful for maintaing pointers refered from multiple structures wihth automatic destruction of original object when last reference is destroyed. It is similar to Java approach with a difference that desctruction time is strictly defined. Only pointers returned by new() are supported. This class is not thread-safe