ldas-tools-al
2.6.5
|
Ensure release of resource lock. More...
#include <objectregistry.hh>
Public Member Functions | |
AutoLock (T *Resource, ObjectRegistry< T > &Registry) | |
Constructor. More... | |
~AutoLock () | |
Desctructor. More... | |
AutoLock (T *Resource, ObjectRegistry< T > &Registry) | |
Constructor. More... | |
~AutoLock () | |
Desctructor. More... | |
AutoLock (T *Resource, ObjectRegistry< T > &Registry) | |
Constructor. More... | |
~AutoLock () | |
Desctructor. More... | |
Private Attributes | |
T * | m_resource |
Resource object. More... | |
ObjectRegistry< T > & | m_registry |
Registry object. More... | |
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.
|
inline |
Constructor.
The constructor is responsible for locking the resouce.
Resource | The address of the resource that should be locked |
Registry | This is the list of registered objects being managed. Resource should be managed within Registry. |
std::range_error | This exception is throw if Resource is not being managed by Registry. |
|
inline |
Desctructor.
Unlock the resouce.
|
inline |
Constructor.
The constructor is responsible for locking the resouce.
Resource | The address of the resource that should be locked |
Registry | This is the list of registered objects being managed. Resource should be managed within Registry. |
std::range_error | This exception is throw if Resource is not being managed by Registry. |
|
inline |
Desctructor.
Unlock the resouce.
|
inline |
Constructor.
The constructor is responsible for locking the resouce.
Resource | The address of the resource that should be locked |
Registry | This is the list of registered objects being managed. Resource should be managed within Registry. |
std::range_error | This exception is throw if Resource is not being managed by Registry. |
|
inline |
Desctructor.
Unlock the resouce.
|
private |
Registry object.
This is the registry that should contain the resouce.
|
private |
Resource object.
This is the resource that is being locked.