OSB_LIB::Shared< T > Class Template Reference

Collaboration diagram for OSB_LIB::Shared< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T>
class OSB_LIB::Shared< T >

Protect a shared resource with a Mutex.

Definition at line 850 of file mutex.h.

Public Member Functions

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

template<typename T>
OSB_LIB::Shared< T >::Shared (  )  [inline]

Default constructor.

Definition at line 853 of file mutex.h.

template<typename T>
OSB_LIB::Shared< T >::Shared ( const T &  t  )  [inline]

Constructor with shared resource.

Definition at line 855 of file mutex.h.

template<typename T>
OSB_LIB::Shared< T >::Shared ( const Shared< T > &   )  [private]

Prevent copying: not implemented.


Member Function Documentation

template<typename T>
T& OSB_LIB::Shared< T >::lock (  )  [inline]

Lock the resource.

Definition at line 860 of file mutex.h.

References OSB_LIB::Mutex::lock(), OSB_LIB::Shared< T >::mutex_, and OSB_LIB::Shared< T >::shared_.

Referenced by OSB_LIB::Shared< T * >::lock().

template<typename T>
Shared<T>& OSB_LIB::Shared< T >::operator= ( const Shared< T > &   )  [private]

Prevent assignment: not implemented.

template<typename T>
T& OSB_LIB::Shared< T >::trylock (  )  throw (OsbException) [inline]

Try to lock the resource.

Exceptions:
OsbException if the lock can not be aquired.
Returns:
Reference to the locked resource.

Definition at line 872 of file mutex.h.

References OSB_LIB::Shared< T >::mutex_, OSB_LIB::Shared< T >::shared_, and OSB_LIB::Mutex::trylock().

template<typename T>
void OSB_LIB::Shared< T >::unlock (  )  [inline]

Unlock the resource.

Definition at line 881 of file mutex.h.

References OSB_LIB::Shared< T >::mutex_, and OSB_LIB::Mutex::unlock().

Referenced by OSB_LIB::Shared< T * >::unlock().


Member Data Documentation

template<typename T>
Mutex OSB_LIB::Shared< T >::mutex_ [private]

Mutex that protects the resource.

Definition at line 893 of file mutex.h.

Referenced by OSB_LIB::Shared< T >::lock(), OSB_LIB::Shared< T >::trylock(), and OSB_LIB::Shared< T >::unlock().

template<typename T>
T OSB_LIB::Shared< T >::shared_ [private]

The protected, shared resource.

Definition at line 895 of file mutex.h.

Referenced by OSB_LIB::Shared< T >::lock(), and OSB_LIB::Shared< T >::trylock().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:11:38 2006 for OSB Library by  doxygen 1.4.7