|
Yate
|
A counter class. More...
#include <yatesig.h>
Public Member Functions | |
| SignallingCounter (u_int32_t maxVal) | |
| void | maxVal (u_int32_t value) |
| u_int32_t | maxVal () const |
| u_int32_t | count () const |
| void | reset (bool down=true) |
| bool | inc () |
| bool | dec () |
| bool | empty () const |
| bool | full () const |
A counter class.
Counter management class. Keep a value between 0 and a given maximum one
|
inline |
|
inline |
Get the current value of the counter
|
inline |
Decrement the counter's value if it can
References empty().
|
inline |
Check if the counter is empty (the value is 0)
Referenced by dec().
|
inline |
|
inline |
Increment the counter's value if it can
References full().
|
inline |
Get the maximum value for the counter
|
inline |
Set the maximum value for the counter
| value | The new maximum value for the counter |
Referenced by full(), and SignallingCounter().
|
inline |
Reset the counter's value
| down | True to reset to 0, false to reset to maxVal() |