|
|
Counter management class. Keep a value between 0 and a given maximum one
| inline SignallingCounter (u_int32_t maxVal)
| SignallingCounter |
Constructor
Parameters:
| maxVal | The maximum value for the counter |
| inline void maxVal (u_int32_t value)
| maxVal |
Set the maximum value for the counter
Parameters:
| value | The new maximum value for the counter |
| inline u_int32_t maxVal ()
| maxVal |
[const]
Get the maximum value for the counter
Returns: The maximum value for the counter
| inline u_int32_t count ()
| count |
[const]
Get the current value of the counter
Returns: The current value of the counter
| inline void reset (bool down = true)
| reset |
Reset the counter's value
Parameters:
| down | True to reset to 0, false to reset to maxVal() |
| inline bool inc ()
| inc |
Increment the counter's value if it can
Returns: False if the counter is full (reached the maximum value)
| inline bool dec ()
| dec |
Decrement the counter's value if it can
Returns: False if the counter is empty (reached 0)
| inline bool empty ()
| empty |
[const]
Check if the counter is empty (the value is 0)
Returns: True if the counter is empty
| inline bool full ()
| full |
[const]
Check if the counter is full (the value reached the maximum)
Returns: True if the counter is full
| Generated by: paulc on bussard on Fri Apr 1 18:17:10 2011, using kdoc 2.0a54. |