Reference class Implementation of the reference counting pattern. More...
#include <Handle.h>
Public Member Functions | |
int | getRefCount () const |
Get number of references on the object, including this one. More... | |
bool | isNull () const |
Test if it does not handle anything. More... | |
bool | isValid () const |
Test if it handles something. More... | |
operator T* () const | |
bool | operator!= (const Reference< T > &p) const |
T & | operator* () const |
Dereference operator. More... | |
T * | operator-> () const |
Dereference operator. More... | |
bool | operator< (const Reference< T > &p) const |
Lower operator, needed for sorting in maps and sets. More... | |
Reference< T > & | operator= (const Reference< T > &p) |
Assign operator from a handle. More... | |
Reference< T > & | operator= (T *p) |
Assign operator from a pointer. More... | |
bool | operator== (const Reference< T > &p) const |
Equal operator. More... | |
Reference () | |
Pointer and default constructor. More... | |
Reference (const Reference< T > &p) | |
Copy constructor. More... | |
Reference (T *p) | |
~Reference () | |
destructor Release the reference counter which causes, in case of the last one, the referenced object to be destructed! More... | |
Reference class Implementation of the reference counting pattern.
Only able to instantiate with a class inheriting Base::Handled.
Base::Reference< T >::Reference | ( | ) |
Pointer and default constructor.
Base::Reference< T >::Reference | ( | T * | p | ) |
Base::Reference< T >::Reference | ( | const Reference< T > & | p | ) |
Copy constructor.
Base::Reference< T >::~Reference | ( | ) |
destructor Release the reference counter which causes, in case of the last one, the referenced object to be destructed!
int Base::Reference< T >::getRefCount | ( | ) | const |
Get number of references on the object, including this one.
bool Base::Reference< T >::isNull | ( | ) | const |
Test if it does not handle anything.
bool Base::Reference< T >::isValid | ( | ) | const |
Test if it handles something.
Base::Reference< T >::operator T* | ( | ) | const |
bool Base::Reference< T >::operator!= | ( | const Reference< T > & | p | ) | const |
T & Base::Reference< T >::operator* | ( | ) | const |
Dereference operator.
T * Base::Reference< T >::operator-> | ( | ) | const |
Dereference operator.
bool Base::Reference< T >::operator< | ( | const Reference< T > & | p | ) | const |
Lower operator, needed for sorting in maps and sets.
Reference< T > & Base::Reference< T >::operator= | ( | const Reference< T > & | p | ) |
Assign operator from a handle.
Reference< T > & Base::Reference< T >::operator= | ( | T * | p | ) |
Assign operator from a pointer.
bool Base::Reference< T >::operator== | ( | const Reference< T > & | p | ) | const |
Equal operator.