a singulater reference counted object that gets destroyed when the refount goes to zero More...
#include <mia/core/singular_refobj.hh>
Data Structures | |
struct | Destructor |
struct | EmptyDestructor |
Public Member Functions | |
unsigned | get_refcount () const |
operator T () const | |
TSingleReferencedObject & | operator= (const TSingleReferencedObject< T > &other) |
TSingleReferencedObject & | operator= (TSingleReferencedObject< T > &&other) |
TSingleReferencedObject () | |
TSingleReferencedObject (T data, const Destructor &d=empty_destructor) | |
TSingleReferencedObject (const TSingleReferencedObject< T > &other) | |
TSingleReferencedObject (TSingleReferencedObject< T > &&other) | |
~TSingleReferencedObject () | |
Static Public Attributes | |
static const EmptyDestructor | empty_destructor |
a singulater reference counted object that gets destroyed when the refount goes to zero
This template handles singular objects that must no be copied (e.g. a resource) but that do also not fit the sigleton pattern. An example use are the HDF5 file, group, and dataset handles.
T | type of the data to be hold |
D | type of a functor that frees the resource. It must provide a static method static void apply(T& data) that frees the resource. |
Definition at line 47 of file singular_refobj.hh.
TSingleReferencedObject< T >::TSingleReferencedObject | ( | ) |
Definition at line 105 of file singular_refobj.hh.
TSingleReferencedObject< T >::TSingleReferencedObject | ( | T | data, |
const Destructor & | d = empty_destructor |
||
) |
Definition at line 111 of file singular_refobj.hh.
TSingleReferencedObject< T >::TSingleReferencedObject | ( | const TSingleReferencedObject< T > & | other | ) |
Definition at line 117 of file singular_refobj.hh.
TSingleReferencedObject< T >::TSingleReferencedObject | ( | TSingleReferencedObject< T > && | other | ) |
Definition at line 136 of file singular_refobj.hh.
TSingleReferencedObject< T >::~TSingleReferencedObject | ( | ) |
Definition at line 156 of file singular_refobj.hh.
unsigned TSingleReferencedObject< T >::get_refcount | ( | ) | const |
Definition at line 170 of file singular_refobj.hh.
References NS_MIA_END.
TSingleReferencedObject< T >::operator T | ( | ) | const |
Definition at line 164 of file singular_refobj.hh.
TSingleReferencedObject< T > & TSingleReferencedObject< T >::operator= | ( | const TSingleReferencedObject< T > & | other | ) |
Definition at line 125 of file singular_refobj.hh.
TSingleReferencedObject< T > & TSingleReferencedObject< T >::operator= | ( | TSingleReferencedObject< T > && | other | ) |
Definition at line 143 of file singular_refobj.hh.
|
static |
Definition at line 59 of file singular_refobj.hh.