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.
References mrpt::utils::operator++().
|
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 56 of file atomic_incr.h.
| Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Tue Aug 22 01:03:35 UTC 2017 |