public

Inheritance Graph

graph BT
	RegistryHandleHolder
	click RegistryHandleHolder "classUtil_1_1RegistryHandleHolder"

Description

Safe storage for a RegistryHandle .

By storing a handle that is obtained by registering an element at a Registry in an instance of this holder class, the registration of the element is automatically canceled when the holder is destroyed. This class can be used to apply the Resource Acquisition Is Initialization (RAII) idiom for an registered element.

Parameters

handle_t
Type of the handle stored inside the holder

Author: Benjamin Eikel

Date: 2013-11-26

Public Functions

   
   
  RegistryHandleHolder(register_fn_t registerFunction, unregister_fn_t unregisterFunction)
   
  ~RegistryHandleHolder()
   
  RegistryHandleHolder( RegistryHandleHolder && void)
   
  RegistryHandleHolder(const RegistryHandleHolder & void)
   
RegistryHandleHolder & operator=( RegistryHandleHolder && void)
   
RegistryHandleHolder & operator=(const RegistryHandleHolder & void)

Documentation

function
Util::RegistryHandleHolder::RegistryHandleHolder

public inline
     
     
RegistryHandleHolder( register_fn_t registerFunction,
  unregister_fn_t unregisterFunction
)    

Register an element at a registry by calling the given function. The handle will be stored inside this holder.

Parameters

registerFunction
A function without parameters that registers an element and returns a handle for the registered element
unregisterFunction
A function that receives a handle for an registered element and cancels the registration of that element

Defined in Util/RegistryHelper.h:52


function
Util::RegistryHandleHolder::~RegistryHandleHolder

public inline
   
   
~RegistryHandleHolder( )

Cancel the registration of an element by calling the stored function with the stored handle as parameter.

Defined in Util/RegistryHelper.h:61


function
Util::RegistryHandleHolder::RegistryHandleHolder

public
     
     
RegistryHandleHolder( RegistryHandleHolder && void )

Defined in Util/RegistryHelper.h:64


function
Util::RegistryHandleHolder::RegistryHandleHolder

public
     
     
RegistryHandleHolder( const RegistryHandleHolder & void )

Defined in Util/RegistryHelper.h:65


function
Util::RegistryHandleHolder::operator=

public
     
     
RegistryHandleHolder & operator=( RegistryHandleHolder && void )

Defined in Util/RegistryHelper.h:66


function
Util::RegistryHandleHolder::operator=

public
     
     
RegistryHandleHolder & operator=( const RegistryHandleHolder & void )

Defined in Util/RegistryHelper.h:67