A class which safely increment and equivalently decrement a counter. More...
Public Member Functions | |
| QtlIncrement (INT *counter=0, INT increment=1) | |
| Constructor. More... | |
| ~QtlIncrement () | |
| Destructor, decrement the counter. More... | |
Private Attributes | |
| INT * | _counter |
| The address of the counter to increment. More... | |
| INT | _increment |
| The amount of unit to decrement in destructor. More... | |
A class which safely increment and equivalently decrement a counter.
| INT | The integer type of the counter to increment. |
|
inlineexplicit |
Constructor.
| [in,out] | counter | The address of the counter to increment. Can be null. |
| [in] | increment | The amount of unit to increment. Default to 1. |
|
inline |
Destructor, decrement the counter.
The counter is decremented by the same amount as it was incremented in the constructor.
|
private |
The address of the counter to increment.
|
private |
The amount of unit to decrement in destructor.