The template allows to guard a pointer. The guard behaviour is implemented by the member guard_.
Definition at line 448 of file mutex.h.
OSB_LIB::ReadGuard< T * >::ReadGuard | ( | const T * | ptr = 0 , |
|
bool | locked = true , |
|||
RwMutex * | pMutex = 0 | |||
) | [inline] |
Constructor for the issuer of the guard.
ptr | Locked pointer. | |
locked | Flag if the caller of the function owns the appropriate lock when the constructor is called (true is yes, false if no). | |
pMutex | Mutex protecting the pointer. |
OSB_LIB::ReadGuard< T * >::ReadGuard | ( | int | stat | ) | [inline, explicit] |
Constructor to set the status.
stat | Status of the guard. |
This constructor is typically used by the issuer of the guard when the locking of the mutex failed:
ReadGuard<T*> mkGuard(RwMutex& mutex) { // lock and check result if (0 != mutex.readLock()) { return ReadGuard<T*>(lockFailed); } // other work to load the guard and return ... }
OSB_LIB::ReadGuard< T * >::ReadGuard | ( | ReadGuardRef | r | ) | [inline] |
const T* OSB_LIB::ReadGuard< T * >::get | ( | ) | const [inline] |
bool OSB_LIB::ReadGuard< T * >::locked | ( | ) | const [inline] |
OSB_LIB::ReadGuard< T * >::operator ReadGuardRef | ( | ) | [inline] |
bool OSB_LIB::ReadGuard< T * >::release | ( | ) | [inline] |
void OSB_LIB::ReadGuard< T * >::unlock | ( | ) | [inline] |
friend class ReadGuard [friend] |
const T* OSB_LIB::ReadGuard< T * >::ptr_ [private] |
int OSB_LIB::ReadGuard< T * >::status_ |