Atomic counter class. More...
#include <atomic_counter.h>
Public Member Functions | |
| atomic_counter () | |
| Constructor. | |
| atomic_counter (int value) | |
| Constructor. | |
| atomic_counter (const atomic_counter &src) | |
| Copy constructor. | |
| const atomic_counter & | operator= (const atomic_counter &src) |
| Assignment operator. | |
| void | operator++ () |
| Increment the counter. | |
| void | operator-- () |
| Decrement the counter. | |
Atomic counter class.
This class represents the one of the synchronization object - the atomic counter. The increments and decrements of the counter are serializable, so you can use the shared counter in the multithreaded environment.
| dbp::atomic_counter::atomic_counter | ( | ) | [inline] |
Constructor.
Initialize the counter with zero.
| dbp::atomic_counter::atomic_counter | ( | int | value | ) | [inline] |
Constructor.
Initialize the counter with value passed.
| value | the counter initial value. |
| dbp::atomic_counter::atomic_counter | ( | const atomic_counter & | src | ) | [inline] |
Copy constructor.
Initialize the counter with value of the other counter.
| src | the source counter. |