#include <counter.h>
Public Member Functions | |
Counter () | |
void | increment (int rand) |
increment the count by '1' | |
void | increment (int rand, int value) |
increment the count by value. | |
void | decrement (int rand) |
decrement the count by '1' | |
void | decrement (int rand, int value) |
decrement the count by value. | |
Num_Type | load () |
This will return the total count. The result might be inaccurate if parallel execution occured. In such case, it's possible for this method to return value that never appears in any moment. | |
void | store (Num_Type value) |
This method set the counter to certain value. The result is inaccurate if parallel execution occured. |
amino::Counter< Num_Type, copier_num >::Counter | ( | ) | [inline] |
void amino::Counter< Num_Type, copier_num >::increment | ( | int | rand | ) | [inline] |
increment the count by '1'
rand | a random number which helps to choose a random slot to operate |
void amino::Counter< Num_Type, copier_num >::increment | ( | int | rand, | |
int | value | |||
) | [inline] |
void amino::Counter< Num_Type, copier_num >::decrement | ( | int | rand | ) | [inline] |
decrement the count by '1'
rand | a random number which helps to choose a random slot to operate |
void amino::Counter< Num_Type, copier_num >::decrement | ( | int | rand, | |
int | value | |||
) | [inline] |
Num_Type amino::Counter< Num_Type, copier_num >::load | ( | ) | [inline] |
This will return the total count. The result might be inaccurate if parallel execution occured. In such case, it's possible for this method to return value that never appears in any moment.
void amino::Counter< Num_Type, copier_num >::store | ( | Num_Type | value | ) | [inline] |