GNU CommonC++
|
The counter template is used for generic objects which act as automatic counters. More...
#include <counter.h>
Public Member Functions | |
Counter () | |
Construct and initialize a counter to zero. | |
Counter (const Counter &counter) | |
Construct a counter with an initial value set for another counter. | |
Counter (T initial) | |
Construct a counter with an initial value of the specified data type. | |
T & | operator= (T c) |
operator T () | |
Protected Attributes | |
T | count |
The counter template is used for generic objects which act as automatic counters.
Each time the object is accessed, the underlying counted data type is incremented.
ost::Counter::Counter | ( | ) | [inline] |
Construct and initialize a counter to zero.
References count.
ost::Counter::Counter | ( | const Counter & | counter | ) | [inline] |
Construct a counter with an initial value set for another counter.
counter | to copy from. |
References count.
ost::Counter::Counter | ( | T | initial | ) | [inline] |
Construct a counter with an initial value of the specified data type.
initial | value to set. |
References count.
ost::Counter::operator T | ( | ) | [inline] |
References count.
T& ost::Counter::operator= | ( | T | c | ) | [inline] |
T ost::Counter::count [protected] |
Referenced by Counter(), and operator T().