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 26 of file atomic_incr.h.
#include <mrpt/synch/atomic_incr.h>
Public Types | |
| typedef int | 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 int mrpt::synch::CAtomicCounter::atomic_num_t |
Definition at line 32 of file atomic_incr.h.
|
inlineexplicit |
Definition at line 35 of file atomic_incr.h.
|
private |
Forbidden method.
| mrpt::synch::CAtomicCounter::operator atomic_num_t | ( | ) | const |
Get current value.
| void mrpt::synch::CAtomicCounter::operator++ | ( | ) |
Atomic increment of value.
| atomic_num_t mrpt::synch::CAtomicCounter::operator-- | ( | ) |
Atomic decrement of value and return new value.
|
private |
Forbidden method.
|
mutableprivate |
Definition at line 43 of file atomic_incr.h.
| Page generated by Doxygen 1.9.1 for MRPT 1.4.0 SVN: at Fri Sep 3 01:11:30 UTC 2021 |