![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/LockPtr.h>
Public Member Functions | |
LockPtr (T *p=0) | |
LockPtr (const LockPtr &l) | |
~LockPtr (void) | |
LockPtr & | operator= (const LockPtr &lock) |
LockPtr & | operator= (T *p) |
T * | operator-> (void) const |
T & | operator* (void) const |
T * | operator& (void) const |
bool | isNull (void) const |
operator bool (void) const | |
bool | operator== (const LockPtr< T > &ap) const |
bool | operator!= (const LockPtr< T > &ap) const |
bool | operator> (const LockPtr< T > &ap) const |
bool | operator>= (const LockPtr< T > &ap) const |
bool | operator< (const LockPtr< T > &ap) const |
bool | operator<= (const LockPtr< T > &ap) const |
Static Public Attributes | |
static LockPtr< T > | null |
Implements a pointer wrapper class that takes care of the usage of a pointer and that automatically delete a pointed object when it is no more used.
Based on reference counting approach, assignment of shared pointer induces the decrementation of the previous pointer and the incrementation of the new pointer. Unlike the SharedPtr, the pointed object must implements the Lock class. This permits to save one extraneous pointer used, in SharedPtr, to link the pointed objects with its counter.
Beware: this also means that pointed objects forming a cycle will not be deleted!
T | Type of pointed object. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |