Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ScopedLocker< T, IGNORE_COND > Class Template Reference

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

ScopedLockeroperator= (const ScopedLocker &)=delete

Private Attributes

const bool myCondition
T & myMutex

Detailed Description

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
class ScopedLocker< T, IGNORE_COND >

A scoped lock which only triggers on condition.

Definition at line 40 of file ScopedLocker.h.

Constructor & Destructor Documentation

◆ ScopedLocker()

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
ScopedLocker< T, IGNORE_COND >::ScopedLocker ( T & m,
const bool condition = true )
inline

Construct & lock associated mutex if the condition is true.

Definition at line 48 of file ScopedLocker.h.

References myCondition, and myMutex.

Referenced by operator=().

Here is the caller graph for this function:

◆ ~ScopedLocker()

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
ScopedLocker< T, IGNORE_COND >::~ScopedLocker ( )
inline

Destroy and unlock associated mutex.

Definition at line 56 of file ScopedLocker.h.

References myCondition, and myMutex.

Member Function Documentation

◆ operator=()

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
ScopedLocker & ScopedLocker< T, IGNORE_COND >::operator= ( const ScopedLocker< T, IGNORE_COND > & )
privatedelete

References ScopedLocker().

Field Documentation

◆ myCondition

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
const bool ScopedLocker< T, IGNORE_COND >::myCondition
private

Definition at line 67 of file ScopedLocker.h.

Referenced by ScopedLocker(), and ~ScopedLocker().

◆ myMutex

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
T& ScopedLocker< T, IGNORE_COND >::myMutex
private

Definition at line 66 of file ScopedLocker.h.

Referenced by ScopedLocker(), and ~ScopedLocker().


The documentation for this class was generated from the following file: