Main MRPT website > C++ reference for MRPT 1.5.7
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

voidm_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()

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

Ctor.

Definition at line 25 of file CCriticalSection.cpp.

◆ ~CCriticalSection()

CCriticalSection::~CCriticalSection ( )
virtual

Dtor.

Definition at line 32 of file CCriticalSection.cpp.

References m_data.

Member Function Documentation

◆ enter()

void 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 CCriticalSection::leave ( ) const
virtual

◆ try_enter()

bool CCriticalSection::try_enter ( ) const
virtual

Returns true if adquired; false otherwise.

Implements mrpt::synch::CAbstractMutex.

Definition at line 59 of file CCriticalSection.cpp.

References m_data.

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.

Referenced by enter(), leave(), try_enter(), and ~CCriticalSection().

◆ 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.

Referenced by enter(), and leave().

◆ m_name

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

Definition at line 45 of file CCriticalSection.h.

Referenced by enter(), and leave().




Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 8277875f6 Mon Jun 11 02:47:32 2018 +0200 at lun oct 28 01:50:49 CET 2019