ost::Counter< T > - The counter template is used for generic objects which act as automatic counters.
Contents
Constructor & Destructor Documentation
template<typenameT>ost::Counter<T>::Counter()[inline]
Construct and initialize a counter to zero.
References ost::Counter< T >::count.
template<typenameT>ost::Counter<T>::Counter(constCounter<T>&counter)[inline]
Construct a counter with an initial value set for another counter.
Parameterscounter to copy from.
References ost::Counter< T >::count.
template<typenameT>ost::Counter<T>::Counter(Tinitial)[inline]
Construct a counter with an initial value of the specified data type.
Parametersinitial value to set.
References ost::Counter< T >::count.
Detailed Description
template<typenameT>
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 dyfet@gnutelephony.org
Automatic counter template class.
Member Data Documentation
template<typenameT>Tost::Counter<T>::count[protected]
Referenced by ost::Counter< T >::Counter(), and ost::Counter< T >::operator T().
Member Function Documentation
template<typenameT>ost::Counter<T>::operatorT()[inline]
References ost::Counter< T >::count.
template<typenameT>T&ost::Counter<T>::operator=(Tc)[inline]Name
ost::Counter< T > - The counter template is used for generic objects which act as automatic counters.
Synopsis
#include <counter.h>
PublicMemberFunctionsCounter ()
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)
operatorT ()
ProtectedAttributes
T count