ost::Counter
ost::Counter
Section: C Library Functions (3) Updated: 16 Feb 2010 Local index
Up
NAME
ost::Counter -
The counter template is used for generic objects which act as automatic counters.
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 <dyfet@gnutelephony.org > Automatic counter template class.
Constructor & Destructor Documentation
template<typename T > ost::Counter < T >::Counter () [inline]
Construct and initialize a counter to zero.
References ost::Counter< T >::count.
template<typename T > ost::Counter < T >::Counter (const Counter < T > & counter) [inline]
Construct a counter with an initial value set for another counter. Parameters:
counter to copy from.
References ost::Counter< T >::count.
template<typename T > ost::Counter < T >::Counter (T initial) [inline]
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 > ost::Counter < T >::operator T () [inline]
References ost::Counter< T >::count.
template<typename T > T& ost::Counter < T >::operator= (T c) [inline]
Member Data Documentation
template<typename T > T ost::Counter < T >::count [protected]
Referenced by ost::Counter< T >::Counter(), and ost::Counter< T >::operator T().
Author
Generated automatically by Doxygen for GNU CommonC++ from the source code.
Index
NAME
SYNOPSIS
Public Member Functions
Protected Attributes
Detailed Description
template<typename T> class ost::Counter< T >
Constructor & Destructor Documentation
template<typename T > ost::Counter < T >::Counter () [inline]
template<typename T > ost::Counter < T >::Counter (const Counter < T > & counter) [inline]
template<typename T > ost::Counter < T >::Counter (T initial) [inline]
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]
Author
This document was created by
man2html ,
using the manual pages.
Time: 21:51:50 GMT, April 16, 2011