EvEmu
0.8.4
11 September 2021
|
A lock for a Lockable object. More...
#include "Lock.h"
Public Member Functions | |
Lock (T &object, bool lock=true) | |
Primary contructor, locks the object. More... | |
~Lock () | |
Destructor, unlocks the object. More... | |
bool | isLocked () const |
Obtains the lock state of the object. More... | |
void | Relock () |
Locks the object. More... | |
void | Unlock () |
Unlocks the object. More... | |
Protected Attributes | |
T & | mObject |
The object this lock is bound to. More... | |
bool | mLocked |
True the mObject is locked, false if not. More... | |
A lock for a Lockable object.
The object is locked during contruction and unlocked during destruction.
The passed typename should be a child of the class Lockable.
Primary contructor, locks the object.
[in] | object | Object to bound this lock to. |
[in] | lock | Lock the object during construction. |
Definition at line 79 of file Lock.h.
References Lock< T >::Relock().
Destructor, unlocks the object.
Definition at line 89 of file Lock.h.
References Lock< T >::Unlock().
|
inline |
Obtains the lock state of the object.
true | The object is locked. |
false | The object is not locked. |
Definition at line 100 of file Lock.h.
References Lock< T >::mLocked.
Referenced by Lock< T >::Relock(), and Lock< T >::Unlock().
|
inline |
Locks the object.
Definition at line 105 of file Lock.h.
References Lock< T >::isLocked(), Lock< T >::mLocked, and Lock< T >::mObject.
Referenced by Lock< T >::Lock().
|
inline |
Unlocks the object.
Definition at line 115 of file Lock.h.
References Lock< T >::isLocked(), Lock< T >::mLocked, and Lock< T >::mObject.
Referenced by log_messageVA(), and Lock< T >::~Lock().
|
protected |
True the mObject is locked, false if not.
Definition at line 127 of file Lock.h.
Referenced by Lock< T >::isLocked(), Lock< T >::Relock(), and Lock< T >::Unlock().
|
protected |
The object this lock is bound to.
Definition at line 125 of file Lock.h.
Referenced by Lock< T >::Relock(), and Lock< T >::Unlock().