Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes
Counter< T > Class Template Reference

The counter template is used for generic objects which act as automatic counters. More...

#include <counter.h>

Collaboration diagram for Counter< T >:
Collaboration graph
[legend]

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

count
 

Detailed Description

template<typename T>
class 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 dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org Automatic counter template class.

Definition at line 63 of file counter.h.

Constructor & Destructor Documentation

template<typename T >
Counter< T >::Counter ( )
inline

Construct and initialize a counter to zero.

Definition at line 72 of file counter.h.

template<typename T >
Counter< T >::Counter ( const Counter< T > &  counter)
inline

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

Parameters
counterto copy from.

Definition at line 80 of file counter.h.

template<typename T >
Counter< T >::Counter ( initial)
inline

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

Parameters
initialvalue to set.

Definition at line 89 of file counter.h.

Member Function Documentation

template<typename T >
Counter< T >::operator T ( )
inline

Definition at line 95 of file counter.h.

template<typename T >
T& Counter< T >::operator= ( c)
inline

Definition at line 92 of file counter.h.

Field Documentation

template<typename T >
T Counter< T >::count
protected

Definition at line 66 of file counter.h.


The documentation for this class was generated from the following file: