Main MRPT website > C++ reference for MRPT 1.5.3
List of all members | Public Member Functions | Public Attributes | Private Attributes
mrpt::synch::CCriticalSection Class Reference

Detailed Description

This class provides simple critical sections functionality.

See also
CCriticalSectionLocker

Definition at line 41 of file CCriticalSection.h.

#include <mrpt/synch/CCriticalSection.h>

Inheritance diagram for mrpt::synch::CCriticalSection:
Inheritance graph

Public Member Functions

 CCriticalSection (const char *name=NULL)
 Ctor. More...
 
virtual ~CCriticalSection ()
 Dtor. More...
 
void enter () const MRPT_OVERRIDE
 Enter. More...
 
void leave () const MRPT_OVERRIDE
 Leave. More...
 
bool try_enter () const MRPT_OVERRIDE
 Returns true if adquired; false otherwise. More...
 
std::string getName () const
 Returns the name used in the constructor. More...
 

Public Attributes

utils::CStreamm_debugOut
 If set to a non-NULL value, debug messages regarding the calling threads IDs will be output. More...
 

Private Attributes

void * m_data
 std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers More...
 
std::string m_name
 

Constructor & Destructor Documentation

◆ CCriticalSection()

mrpt::synch::CCriticalSection::CCriticalSection ( const char *  name = NULL)

Ctor.

◆ ~CCriticalSection()

virtual mrpt::synch::CCriticalSection::~CCriticalSection ( )
virtual

Dtor.

Member Function Documentation

◆ enter()

void mrpt::synch::CCriticalSection::enter ( ) const
virtual

◆ getName()

std::string mrpt::synch::CCriticalSection::getName ( ) const
inline

Returns the name used in the constructor.

Definition at line 55 of file CCriticalSection.h.

◆ leave()

void mrpt::synch::CCriticalSection::leave ( ) const
virtual

◆ try_enter()

bool mrpt::synch::CCriticalSection::try_enter ( ) const
virtual

Returns true if adquired; false otherwise.

Implements mrpt::synch::CAbstractMutex.

Member Data Documentation

◆ m_data

void* mrpt::synch::CCriticalSection::m_data
private

std::mutex*. Opaque ptr until MRPT 2.0.0 in which we could expose C++11 to user headers

Definition at line 44 of file CCriticalSection.h.

◆ m_debugOut

utils::CStream* mrpt::synch::CCriticalSection::m_debugOut

If set to a non-NULL value, debug messages regarding the calling threads IDs will be output.

Definition at line 58 of file CCriticalSection.h.

◆ m_name

std::string mrpt::synch::CCriticalSection::m_name
private

Definition at line 45 of file CCriticalSection.h.




Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Mon Oct 30 10:27:08 UTC 2017