Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Examples  

ost::Counter Class Template Reference

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

#include <counter.h>

List of all members.

Public Methods

 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 ost::Counter

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

Each time the object is accessed, the underlying counted data type is incremented.

Author:
David Sugar <dyfet@gnutelephony.org>


Constructor & Destructor Documentation

template<typename T>
ost::Counter<T>::Counter<T> ( ) [inline]
 

Construct and initialize a counter to zero.

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

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

Parameters:
counter   to copy from.

template<typename T>
ost::Counter<T>::Counter<T> ( T initial ) [inline]
 

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

Parameters:
initial   value to set.


Member Function Documentation

template<typename T>
ost::Counter<T>::operator T ( ) [inline]
 

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


Member Data Documentation

template<typename T>
T ost::Counter<T>::count [protected]
 


The documentation for this class was generated from the following file:
Generated at Sat May 12 18:59:40 2007 for GNU CommonC++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001