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. More... | |
Counter (const Counter &counter) | |
Construct a counter with an initial value set for another counter. More... | |
Counter (T initial) | |
Construct a counter with an initial value of the specified data type. More... | |
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.
Automatic counter template class.
|
inline |
Construct and initialize a counter to zero.
References ost::Counter< T >::count.
|
inline |
Construct a counter with an initial value set for another counter.
counter | to copy from. |
References ost::Counter< T >::count.
|
inline |
Construct a counter with an initial value of the specified data type.
initial | value to set. |
References ost::Counter< T >::count.
|
inline |
References ost::Counter< T >::count.
|
inline |
|
protected |
Referenced by ost::Counter< T >::Counter(), and ost::Counter< T >::operator T().