Bayonne2 / Common C++ 2 Framework
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
counter to copy from.

Definition at line 80 of file counter.h.

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

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

Parameters
initial value 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= ( T  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:

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /