#include <concurrent_counter.hpp>
Public Types | |
| typedef numeric_type | counter_type |
| Type of the counter. | |
Public Member Functions | |
| concurrent_counter () | |
| Construct a new counter object. Initializes the counter with a. | |
| concurrent_counter (numeric_type upper_bound, numeric_type lower_bound) | |
| Construct a new counter object. | |
| concurrent_counter (numeric_type reset_value, numeric_type upper_bound, numeric_type lower_bound) | |
| Construct a new counter object. | |
| concurrent_counter (numeric_type initial_value, numeric_type reset_value, numeric_type upper_bound, numeric_type lower_bound) | |
| Construct a new counter object. | |
| virtual | ~concurrent_counter ()=default |
| std::atomic< numeric_type > & | operator() () |
| numeric_type | operator++ (int32_t) |
| overloaded post increment operator | |
| numeric_type | operator++ () |
| overloaded pre increment operator | |
| numeric_type | operator-- (int32_t) |
| overloaded post decrement operator | |
| numeric_type | operator-- () |
| overloaded pre decrement operator | |
| operator numeric_type () const | |
| type conversion operator | |
| void | reset () |
| Returns the counter to its reset value. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const concurrent_counter &rhs) |
| overloaded ostream operator for capturing the counter value | |
Concurrent counter class
| numeric_type | integral numeric type |
| numeric_type corelink::utils::concurrent_counter< numeric_type >::counter_type |
Type of the counter.
|
inlineexplicit |
Construct a new counter object. Initializes the counter with a.
|
inlineexplicit |
Construct a new counter object.
| upper_bound | upper bound of the counter variable after which the counter will be reset |
| lower_bound | lower bound of the counter variable after which the counter will be reset |
|
inline |
Construct a new counter object.
| reset_value | value to which the counter will be reset to |
| upper_bound | upper bound of the counter variable after which the counter will be reset |
| lower_bound | lower bound of the counter variable after which the counter will be reset |
|
inline |
Construct a new counter object.
| initial_value | the initial value that will be loaded in to the counter at initialisation |
| reset_value | value to which the counter will be reset to |
| upper_bound | upper bound of the counter variable after which the counter will be reset |
| lower_bound | lower bound of the counter variable after which the counter will be reset |
|
virtualdefault |
|
inlineexplicit |
type conversion operator
|
inline |
Get the underlying counter. Do not access
|
inline |
overloaded pre increment operator
|
inline |
overloaded post increment operator
|
inline |
overloaded pre decrement operator
|
inline |
overloaded post decrement operator
|
inline |
Returns the counter to its reset value.
|
friend |
overloaded ostream operator for capturing the counter value
| os | std::ostream instance |
| rhs | instance of the counter class |