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 pointer to a shared resource with a Mutex.

Definition at line 903 of file mutex.h.

Public Member Functions

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

template<typename T>
OSB_LIB::Shared< T * >::Shared ( T *  t = 0  )  [inline, explicit]

Constructor with shared resource.

Parameters:
t Pointer to shared resource, its ownership remains at the caller.

Definition at line 911 of file mutex.h.

template<typename T>
OSB_LIB::Shared< T * >::Shared ( std::auto_ptr< T >  t  )  [inline, explicit]

Constructur with shared resource.

Parameters:
t Auto pointer with the shared resource, the object takes its ownership.

Definition at line 923 of file mutex.h.

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

Destructor.

Deletes the pointer to the shared resource if owned by the object.

Definition at line 935 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 940 of file mutex.h.

References OSB_LIB::Shared< T >::lock().

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

Prevent assignment: not implemented.

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

Try to lock the resource.

Returns:
A pointer to the resource, 0 in case of failure.

Definition at line 951 of file mutex.h.

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

Unlock the resource.

Definition at line 961 of file mutex.h.

References 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 973 of file mutex.h.

template<typename T>
bool OSB_LIB::Shared< T * >::ownsShared_ [private]

Flag is resource is owned by the object.

Definition at line 975 of file mutex.h.

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

The protected, shared resource.

Definition at line 977 of file mutex.h.


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