TSingleReferencedObject< T > Class Template Reference

a singulater reference counted object that gets destroyed when the refount goes to zero More...

`#include <mia/core/singular_refobj.hh>`

Collaboration diagram for TSingleReferencedObject< T >:
[legend]

## 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 (const TSingleReferencedObject< T > &other)
| TSingleReferencedObject (T data, const Destructor &d=empty_destructor)
| TSingleReferencedObject (TSingleReferencedObject< T > &&other)
| ~TSingleReferencedObject ()

## Static Public Attributes

static const EmptyDestructor | empty_destructor

## Detailed Description

template<typename T>
class TSingleReferencedObject< T >

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.

Template Parameters

  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.

## Constructor & Destructor Documentation

## TSingleReferencedObject() [1/4]

template<typename T>

TSingleReferencedObject< T >::TSingleReferencedObject | ( |  | ) |

Definition at line 107 of file singular_refobj.hh.

Referenced by operator T(), operator=(), operator=(), TSingleReferencedObject(), and TSingleReferencedObject().

## TSingleReferencedObject() [2/4]

template<typename T>

TSingleReferencedObject< T >::TSingleReferencedObject | ( | T | data,
|  | const Destructor & | d = empty_destructor )

Definition at line 113 of file singular_refobj.hh.

## TSingleReferencedObject() [3/4]

template<typename T>

TSingleReferencedObject< T >::TSingleReferencedObject | ( | const TSingleReferencedObject< T > & | other | ) |

Definition at line 119 of file singular_refobj.hh.

References TSingleReferencedObject().

## TSingleReferencedObject() [4/4]

template<typename T>

TSingleReferencedObject< T >::TSingleReferencedObject | ( | TSingleReferencedObject< T > && | other | ) |

Definition at line 142 of file singular_refobj.hh.

References TSingleReferencedObject().

## ~TSingleReferencedObject()

template<typename T>

TSingleReferencedObject< T >::~TSingleReferencedObject | ( |  | ) |

Definition at line 164 of file singular_refobj.hh.

## Member Function Documentation

## get_refcount()

template<typename T>

unsigned TSingleReferencedObject< T >::get_refcount | ( |  | ) | const

Definition at line 178 of file singular_refobj.hh.

## operator T()

template<typename T>

TSingleReferencedObject< T >::operator T | ( |  | ) | const

Definition at line 172 of file singular_refobj.hh.

References TSingleReferencedObject().

## operator=() [1/2]

template<typename T>

TSingleReferencedObject< T > & TSingleReferencedObject< T >::operator= | ( | const TSingleReferencedObject< T > & | other | ) |

Definition at line 128 of file singular_refobj.hh.

References TSingleReferencedObject().

## operator=() [2/2]

template<typename T>

TSingleReferencedObject< T > & TSingleReferencedObject< T >::operator= | ( | TSingleReferencedObject< T > && | other | ) |

Definition at line 149 of file singular_refobj.hh.

References TSingleReferencedObject().

## Field Documentation

## empty_destructor

template<typename T>

const EmptyDestructor TSingleReferencedObject< T >::empty_destructor

static

Definition at line 60 of file singular_refobj.hh.

The documentation for this class was generated from the following file:

- singular_refobj.hh