Reference "keeper" class with automatic unref() call. More...
#include <r8bbase.h>
Public Member Functions | |
| template<typename T2> | |
| CRefKeeper (T2 const aObject) | |
| Constructor assigns a pointer to object to this keeper. | |
| operator T* () const | |
Returns pointer to keeped object, or nullptr, if no object is kept. | |
| T * | operator-> () const |
Returns pointer to keeped object, or nullptr, if no object is being kept. | |
| template<typename T2> | |
| void | operator= (T2 const aObject) |
| Assigns a pointer to object to this keeper. A previously keeped pointer will be reset and object unreferenced. | |
| void | reset () |
| Resets the keeped pointer and unreferences the keeped object. | |
Reference "keeper" class with automatic unref() call.
An auxiliary class that can be used for keeping a reference to object that should be unreferenced when the "keeper" is deleted.
| T | Type of the referenced object, must have the unref() function. |
Constructor assigns a pointer to object to this keeper.
| aObject | Pointer to object to keep, can be nullptr. |
| T2 | Object's pointer type. |
Assigns a pointer to object to this keeper. A previously keeped pointer will be reset and object unreferenced.
| aObject | Pointer to object to keep; it can be nullptr. |
| T2 | Object's pointer type. |