OSB_LIB::RwShared< T * > Class Template Reference

Collaboration diagram for OSB_LIB::RwShared< T * >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T>
class OSB_LIB::RwShared< T * >

Protect a shared object with a RwMutex.

Definition at line 1057 of file mutex.h.

Public Member Functions

Private Member Functions

Private Attributes


Constructor & Destructor Documentation

template<typename T>
OSB_LIB::RwShared< T * >::RwShared ( RwMutex::Priority  p = RwMutex::prioRead  )  [inline]

Constructor with read/write priority.

Remarks:
This constructor allocates a new T.

Definition at line 1064 of file mutex.h.

template<typename T>
OSB_LIB::RwShared< T * >::RwShared ( T *  t,
RwMutex::Priority  p = RwMutex::prioRead 
) [inline]

Constructor with shared resource and read/write priority.

Remarks:
This constructor does not take the ownership on the argument pointer T*.

Definition at line 1079 of file mutex.h.

template<typename T>
OSB_LIB::RwShared< T * >::RwShared ( std::auto_ptr< T >  t,
RwMutex::Priority  p = RwMutex::prioRead 
) [inline]

Constructor with shared resource and read/write priority.

Remarks:
This constructor takes the ownership on the argument auto pointer.

Definition at line 1095 of file mutex.h.

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

Destructor: delete shared resource if owned by object.

Definition at line 1107 of file mutex.h.

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

Prevent copying: not implemented.


Member Function Documentation

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

Prevent assignment: not implemented.

template<typename T>
const T* OSB_LIB::RwShared< T * >::readLock (  )  [inline]

Get a read lock for the shared resource.

Definition at line 1113 of file mutex.h.

References OSB_LIB::RwShared< T >::readLock().

template<typename T>
void OSB_LIB::RwShared< T * >::readUnlock (  )  [inline]

Remove a read lock.

Definition at line 1143 of file mutex.h.

References OSB_LIB::RwShared< T >::readUnlock().

template<typename T>
const T* OSB_LIB::RwShared< T * >::tryReadLock (  )  [inline]

Try a read lock for the shared resource.

Definition at line 1120 of file mutex.h.

template<typename T>
T* OSB_LIB::RwShared< T * >::tryWriteLock (  )  [inline]

Try a write lock for the shared resource.

Definition at line 1135 of file mutex.h.

template<typename T>
T* OSB_LIB::RwShared< T * >::writeLock (  )  [inline]

Get a write lock for the shared resource.

Definition at line 1128 of file mutex.h.

References OSB_LIB::RwShared< T >::writeLock().

template<typename T>
void OSB_LIB::RwShared< T * >::writeUnlock (  )  [inline]

Remove a write lock.

Definition at line 1149 of file mutex.h.


Member Data Documentation

template<typename T>
RwMutex OSB_LIB::RwShared< T * >::mutex_ [private]

Read/write lock protecting the resource.

Definition at line 1168 of file mutex.h.

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

Flag if the pointer to the shared resource is owned by the class or not.

Definition at line 1166 of file mutex.h.

template<typename T>
T* OSB_LIB::RwShared< T * >::pShared_ [private]

Pointer to the shared resource.

Definition at line 1161 of file mutex.h.


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