ldas-tools-al 2.6.7
Loading...
Searching...
No Matches
ObjectRegistry< T >::AutoLock Class Reference

Ensure release of resource lock. More...

#include <objectregistry.hh>

Inheritance diagram for ObjectRegistry< T >::AutoLock:

Public Member Functions

 AutoLock (T *Resource, ObjectRegistry< T > &Registry)
 Constructor.
 
 ~AutoLock ()
 Desctructor.
 
 AutoLock (T *Resource, ObjectRegistry< T > &Registry)
 Constructor.
 
 ~AutoLock ()
 Desctructor.
 

Detailed Description

template<class T>
class ObjectRegistry< T >::AutoLock

Ensure release of resource lock.

This class ensures the release of a lock by performing the release within the destructor. By releasing in the destructor, the lock is release when the object goes out of scope, either by normal exit or via an exception.

Constructor & Destructor Documentation

◆ AutoLock() [1/2]

template<class T >
ObjectRegistry< T >::AutoLock::AutoLock ( T * Resource,
ObjectRegistry< T > & Registry )
inline

Constructor.

The constructor is responsible for locking the resouce.

Parameters
ResourceThe address of the resource that should be locked
RegistryThis is the list of registered objects being managed. Resource should be managed within Registry.
Exceptions
std::range_errorThis exception is throw if Resource is not being managed by Registry.

◆ ~AutoLock() [1/2]

template<class T >
ObjectRegistry< T >::AutoLock::~AutoLock ( )
inline

Desctructor.

Unlock the resouce.

◆ AutoLock() [2/2]

template<class T >
ObjectRegistry< T >::AutoLock::AutoLock ( T * Resource,
ObjectRegistry< T > & Registry )
inline

Constructor.

The constructor is responsible for locking the resouce.

Parameters
ResourceThe address of the resource that should be locked
RegistryThis is the list of registered objects being managed. Resource should be managed within Registry.
Exceptions
std::range_errorThis exception is throw if Resource is not being managed by Registry.

◆ ~AutoLock() [2/2]

template<class T >
ObjectRegistry< T >::AutoLock::~AutoLock ( )
inline

Desctructor.

Unlock the resouce.


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