Eclipse SUMO - Simulation of Urban MObility
|
A scoped lock which only triggers on condition. More...
#include <ScopedLocker.h>
Public Member Functions | |
ScopedLocker (T &m, const bool condition=true) | |
Construct & lock associated mutex if the condition is true. | |
~ScopedLocker () | |
Destroy and unlock associated mutex. | |
Private Member Functions | |
ScopedLocker & | operator= (const ScopedLocker &)=delete |
Private Attributes | |
const bool | myCondition |
T & | myMutex |
A scoped lock which only triggers on condition.
Definition at line 40 of file ScopedLocker.h.
|
inline |
Construct & lock associated mutex if the condition is true.
Definition at line 44 of file ScopedLocker.h.
|
inline |
Destroy and unlock associated mutex.
Definition at line 52 of file ScopedLocker.h.
References ScopedLocker< T, IGNORE_COND >::myCondition, and ScopedLocker< T, IGNORE_COND >::myMutex.
|
privatedelete |
|
private |
Definition at line 60 of file ScopedLocker.h.
Referenced by ScopedLocker< T, IGNORE_COND >::~ScopedLocker().
|
private |
Definition at line 59 of file ScopedLocker.h.
Referenced by ScopedLocker< T, IGNORE_COND >::~ScopedLocker().