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 44 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. | |
atomic_num_t | operator-- () |
Atomic decrement of value and return new value. | |
operator atomic_num_t () const | |
Get current value. | |
Private Member Functions | |
CAtomicCounter (CAtomicCounter const &) | |
Forbidden method. | |
CAtomicCounter & | operator= (CAtomicCounter const &) |
Forbidden method. | |
Private Attributes | |
atomic_num_t | m_value |
typedef int mrpt::synch::CAtomicCounter::atomic_num_t |
Definition at line 50 of file atomic_incr.h.
mrpt::synch::CAtomicCounter::CAtomicCounter | ( | long | v | ) | [inline, explicit] |
Definition at line 53 of file atomic_incr.h.
mrpt::synch::CAtomicCounter::CAtomicCounter | ( | CAtomicCounter const & | ) | [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.
CAtomicCounter& mrpt::synch::CAtomicCounter::operator= | ( | CAtomicCounter const & | ) | [private] |
Forbidden method.
atomic_num_t mrpt::synch::CAtomicCounter::m_value [mutable, private] |
Definition at line 61 of file atomic_incr.h.
Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |