Base::Reference< T > Class Template Reference
Reference class Implementation of the reference counting pattern. More...
#include <Handle.h>
Public Member Functions | |
int | getRefCount (void) const |
Get number of references on the object, including this one. More... | |
bool | isNull (void) const |
Test if it does not handle anything. More... | |
bool | isValid (void) 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... | |
Detailed Description
template<class T>
class Base::Reference< T >
Reference class Implementation of the reference counting pattern.
Only able to instantiate with a class inheriting Base::Handled.
Constructor & Destructor Documentation
◆ Reference() [1/3]
template<class T >
Base::Reference< T >::Reference | ( | ) |
Pointer and default constructor.
◆ Reference() [2/3]
template<class T >
Base::Reference< T >::Reference | ( | T * | p | ) |
◆ Reference() [3/3]
template<class T >
Base::Reference< T >::Reference | ( | const Reference< T > & | p | ) |
Copy constructor.
◆ ~Reference()
template<class T >
Base::Reference< T >::~Reference | ( | ) |
destructor Release the reference counter which causes, in case of the last one, the referenced object to be destructed!
Member Function Documentation
◆ getRefCount()
template<class T >
int Base::Reference< T >::getRefCount | ( | void | ) | const |
Get number of references on the object, including this one.
◆ isNull()
template<class T >
bool Base::Reference< T >::isNull | ( | void | ) | const |
Test if it does not handle anything.
◆ isValid()
template<class T >
bool Base::Reference< T >::isValid | ( | void | ) | const |
Test if it handles something.
◆ operator T*()
template<class T >
Base::Reference< T >::operator T* | ( | ) | const |
◆ operator!=()
template<class T >
bool Base::Reference< T >::operator!= | ( | const Reference< T > & | p | ) | const |
◆ operator*()
template<class T >
T& Base::Reference< T >::operator* | ( | ) | const |
Dereference operator.
◆ operator->()
template<class T >
T* Base::Reference< T >::operator-> | ( | ) | const |
Dereference operator.
◆ operator<()
template<class T >
bool Base::Reference< T >::operator< | ( | const Reference< T > & | p | ) | const |
Lower operator, needed for sorting in maps and sets.
◆ operator=() [1/2]
template<class T >
Reference<T>& Base::Reference< T >::operator= | ( | const Reference< T > & | p | ) |
Assign operator from a handle.
◆ operator=() [2/2]
template<class T >
Reference<T>& Base::Reference< T >::operator= | ( | T * | p | ) |
Assign operator from a pointer.
◆ operator==()
template<class T >
bool Base::Reference< T >::operator== | ( | const Reference< T > & | p | ) | const |
Equal operator.
The documentation for this class was generated from the following file:
- src/Base/Handle.h