SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
AbstractMutex::ScopedLocker Class Reference

A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively. More...

#include <AbstractMutex.h>

Public Member Functions

 ScopedLocker (AbstractMutex &lock)
 Constructor. More...
 
 ~ScopedLocker ()
 Destructor Unlocks the mutex. More...
 

Private Member Functions

ScopedLockeroperator= (const ScopedLocker &)
 Invalidated assignment operator. More...
 
 ScopedLocker (const ScopedLocker &)
 Invalidated copy constructor. More...
 

Private Attributes

AbstractMutexmyLock
 The mutex to lock. More...
 

Detailed Description

A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.

Definition at line 71 of file AbstractMutex.h.

Constructor & Destructor Documentation

AbstractMutex::ScopedLocker::ScopedLocker ( AbstractMutex lock)
inline

Constructor.

Parameters
[in]lockThe mutex to lock

Locks the mutex.

Definition at line 78 of file AbstractMutex.h.

References AbstractMutex::lock(), and myLock.

AbstractMutex::ScopedLocker::~ScopedLocker ( )
inline

Destructor Unlocks the mutex.

Definition at line 86 of file AbstractMutex.h.

References myLock, and AbstractMutex::unlock().

AbstractMutex::ScopedLocker::ScopedLocker ( const ScopedLocker )
private

Invalidated copy constructor.

Member Function Documentation

ScopedLocker& AbstractMutex::ScopedLocker::operator= ( const ScopedLocker )
private

Invalidated assignment operator.

Field Documentation

AbstractMutex& AbstractMutex::ScopedLocker::myLock
private

The mutex to lock.

Definition at line 92 of file AbstractMutex.h.

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


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