|
r8brain-free-src
High-quality pro audio sample rate converter library
|
Pointer-to-object "keeper" class with automatic deletion. More...
#include <r8bbase.h>
Public Member Functions | |
| template<typename T2 > | |
| CPtrKeeper (T2 const aObject) | |
| operator T () const | |
| T | operator-> () const |
| template<typename T2 > | |
| void | operator= (T2 const aObject) |
| void | reset () |
| T | unkeep () |
Pointer-to-object "keeper" class with automatic deletion.
An auxiliary class that can be used for keeping a pointer to object that should be deleted together with the "keeper" by calling object's "delete" operator.
| T | Pointer type to operate with, must include the asterisk (e.g. "CDSPFIRFilter*"). |
Constructor assigns a pointer to object to *this keeper.
| aObject | Pointer to object to keep, can be NULL. |
| T2 | Object's pointer type. |
| r8b::CPtrKeeper< T >::operator T | ( | ) | const |
| T r8b::CPtrKeeper< T >::operator-> | ( | ) | const |
| void r8b::CPtrKeeper< T >::operator= | ( | T2 const | aObject | ) |
Function assigns a pointer to object to *this keeper. A previously keeped pointer will be reset and object deleted.
| aObject | Pointer to object to keep, can be NULL. |
| T2 | Object's pointer type. |
| void r8b::CPtrKeeper< T >::reset | ( | ) |
Function resets the keeped pointer and deletes the keeped object.
| T r8b::CPtrKeeper< T >::unkeep | ( | ) |