This class acts exactly as an int (or long) variable, but with atomic increment and decrement operators.
This is a useful component of thread-safe smart pointers.
Definition at line 37 of file atomic_incr.h.
#include <mrpt/synch/atomic_incr.h>
Public Types | |
typedef long | atomic_num_t |
Public Member Functions | |
CAtomicCounter (long v) | |
void | operator++ () |
Atomic increment of value. More... | |
atomic_num_t | operator-- () |
Atomic decrement of value and return new value. More... | |
operator atomic_num_t () const | |
Get current value. More... | |
Private Member Functions | |
CAtomicCounter (CAtomicCounter const &) | |
Forbidden method. More... | |
CAtomicCounter & | operator= (CAtomicCounter const &) |
Forbidden method. More... | |
Private Attributes | |
atomic_num_t | m_value |
typedef long mrpt::synch::CAtomicCounter::atomic_num_t |
Definition at line 43 of file atomic_incr.h.
|
inlineexplicit |
Definition at line 48 of file atomic_incr.h.
|
private |
Forbidden method.
CAtomicCounter::operator CAtomicCounter::atomic_num_t | ( | ) | const |
void CAtomicCounter::operator++ | ( | ) |
CAtomicCounter::atomic_num_t CAtomicCounter::operator-- | ( | ) |
Atomic decrement of value and return new value.
Definition at line 100 of file atomic_incr.cpp.
References m_value.
|
private |
Forbidden method.
|
mutableprivate |
Definition at line 56 of file atomic_incr.h.
Referenced by operator atomic_num_t(), operator++(), and operator--().
Page generated by Doxygen 1.8.14 for MRPT 1.5.5 Git: e06b63dbf Fri Dec 1 14:41:11 2017 +0100 at lun oct 28 01:31:35 CET 2019 |