#include <Counter.h>
Inheritance diagram for Counter::
Public Methods | |
Counter () | |
Start the counter a 1, the min is 1, the max is 2^16. More... | |
Counter (int maxNumber) | |
Start the counter at 1. More... | |
Counter (int minNumber, int maxNumber) | |
Start the counter at minNumber, go up to maxNumber. More... | |
Counter (int minNumber, int maxNumber, int startValue) | |
Start the counter at startValue, with the range of numbers being [minNumber, maxNumber]. More... | |
Counter (const Counter &) | |
Copy constructor. More... | |
int | getCount () |
Return the current value of the counter. More... | |
int | increment () |
Add one to the counter value. More... | |
int | decrement () |
Subtract one from the counter value. More... | |
void | setTo (int value) |
Set the counter to the value specified. More... | |
void | setMin (int min) |
void | setMax (int max) |
void | toStream (std::ostream &out) |
Private Attributes | |
int | m_count |
int | m_minValue |
int | m_maxValue |
Definition at line 10 of file Counter.h.
|
Start the counter a 1, the min is 1, the max is 2^16.
Definition at line 13 of file Counter.cpp. |
|
Start the counter at 1.
Definition at line 25 of file Counter.cpp. |
|
Start the counter at minNumber, go up to maxNumber. Only positive values allowed. Definition at line 36 of file Counter.cpp. |
|
Start the counter at startValue, with the range of numbers being [minNumber, maxNumber]. Only positive values allowed. Definition at line 48 of file Counter.cpp. |
|
Copy constructor.
Definition at line 59 of file Counter.cpp. |
|
Subtract one from the counter value. This will automatically wrap the counter around to the highest value if it goes past the lowest value. Definition at line 87 of file Counter.cpp. Referenced by SendWindow::onAckRecvd().
|
|
Return the current value of the counter.
Definition at line 142 of file Counter.cpp. Referenced by SendWindow::onAckRecvd(), and SendWindow::segment().
|
|
Add one to the counter value. This will automatically wrap the counter around to the lowest value if it goes past the highest value. Definition at line 71 of file Counter.cpp. Referenced by ServiceTable::generateConnectionDescriptor(), ServiceTable::generateServiceNumber(), and SendWindow::segment().
|
|
Definition at line 117 of file Counter.cpp. Referenced by Counter().
|
|
Definition at line 128 of file Counter.cpp. Referenced by Counter().
|
|
Set the counter to the value specified. If above the max value, it will set it to the max value. If below the min value, it will set it to the min value. Definition at line 102 of file Counter.cpp. Referenced by Counter(), and ServiceTable::ServiceTable().
|
|
Reimplemented from BasicObject. Definition at line 149 of file Counter.cpp. |
|
|
|
|
|
|