SYNOPSIS

#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

Detailed Description

template<typename T>class ost::Counter< T >

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.

Author:

David Sugar [email protected] Automatic counter template class.

Constructor & Destructor Documentation

template<typename T > \fBost::Counter\fP< T >::\fBCounter\fP ()\fC [inline]\fP

Construct and initialize a counter to zero.

References ost::Counter< T >::count.

template<typename T > \fBost::Counter\fP< T >::\fBCounter\fP (const \fBCounter\fP< T > &counter)\fC [inline]\fP

Construct a counter with an initial value set for another counter.

Parameters:

counter to copy from.

References ost::Counter< T >::count.

template<typename T > \fBost::Counter\fP< T >::\fBCounter\fP (Tinitial)\fC [inline]\fP

Construct a counter with an initial value of the specified data type.

Parameters:

initial value to set.

References ost::Counter< T >::count.

Member Function Documentation

template<typename T > \fBost::Counter\fP< T >::operator T ()\fC [inline]\fP

References ost::Counter< T >::count.

template<typename T > T& \fBost::Counter\fP< T >::operator= (Tc)\fC [inline]\fP

Member Data Documentation

template<typename T > T \fBost::Counter\fP< T >::count\fC [protected]\fP

Referenced by ost::Counter< T >::Counter(), and ost::Counter< T >::operator T().

Author

Generated automatically by Doxygen for GNU CommonC++ from the source code.