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 40 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 CCriticalSection::getName ( ) const

Returns the name used in the constructor.

Definition at line 39 of file CCriticalSection.cpp.

References m_name.

◆ 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 64 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 43 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 57 of file CCriticalSection.h.

Referenced by enter(), and leave().

◆ m_name

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

Definition at line 44 of file CCriticalSection.h.

Referenced by enter(), getName(), and leave().




Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019