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 44 of file ScopedLocker.h.

◆ ~ScopedLocker()

template<typename T = FX::FXMutex, bool IGNORE_COND = false>
ScopedLocker< T, IGNORE_COND >::~ScopedLocker ( )
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.

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

Field Documentation

◆ myCondition

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

Definition at line 60 of file ScopedLocker.h.

Referenced by ScopedLocker< T, IGNORE_COND >::~ScopedLocker().

◆ myMutex

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

Definition at line 59 of file ScopedLocker.h.

Referenced by ScopedLocker< T, IGNORE_COND >::~ScopedLocker().


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