ESyS-Particle  2.3.4
CCounter Class Reference

#include <Counter.h>

Public Member Functions

 CCounter ()
 
 CCounter (char *Name, int Id=0)
 
virtual ~CCounter ()
 
void create (char *Name, int Id=0)
 create counter, call by constructor More...
 
CCounteroperator+= (int n)
 increment counter by n More...
 
CCounteroperator-= (int n)
 decrement counter by n More...
 
CCounteroperator++ ()
 increment counter by 1 More...
 
CCounteroperator-- ()
 decrement counter by 1 More...
 
CCounteroperator++ (int)
 increment counter by 1 More...
 
CCounteroperator-- (int)
 decrement counter by 1 More...
 
CCounterreset ()
 reset the counter to 0 More...
 
char * getName ()
 return name of counter More...
 
 operator int ()
 return the value of the counter More...
 
ostream & print (ostream &Out)
 method to print the value More...
 

Protected Attributes

char * Name
 Name is allocated or deallocated on construction or destruction, respectively. More...
 
int Value
 
int Id
 

Detailed Description

Provide a basic "counter", a counter has a Name and a value and an optional Id.

Constructor & Destructor Documentation

◆ CCounter() [1/2]

CCounter::CCounter ( )

References Id, Name, NULL, and Value.

◆ CCounter() [2/2]

CCounter::CCounter ( char *  Name,
int  Id = 0 
)

References create().

Here is the call graph for this function:

◆ ~CCounter()

CCounter::~CCounter ( )
virtual

References Name.

Member Function Documentation

◆ create()

void CCounter::create ( char *  Name,
int  Id = 0 
)

create counter, call by constructor

References Id, Name, and Value.

Referenced by CCounter().

Here is the caller graph for this function:

◆ getName()

char * CCounter::getName ( )

return name of counter

References Name.

Referenced by CCounterList::counter(), and CCounterList::operator<<().

Here is the caller graph for this function:

◆ operator int()

CCounter::operator int ( )

return the value of the counter

◆ operator++() [1/2]

CCounter & CCounter::operator++ ( )

increment counter by 1

References Value.

◆ operator++() [2/2]

CCounter & CCounter::operator++ ( int  )

increment counter by 1

References Value.

◆ operator+=()

CCounter & CCounter::operator+= ( int  n)

increment counter by n

References Value.

◆ operator--() [1/2]

CCounter & CCounter::operator-- ( )

decrement counter by 1

References Value.

◆ operator--() [2/2]

CCounter & CCounter::operator-- ( int  )

decrement counter by 1

References Value.

◆ operator-=()

CCounter & CCounter::operator-= ( int  n)

decrement counter by n

References Value.

◆ print()

ostream & CCounter::print ( ostream &  Out)

method to print the value

References Name, and Value.

Referenced by operator<<(), and CCounterList::print().

Here is the caller graph for this function:

◆ reset()

CCounter & CCounter::reset ( )

reset the counter to 0

References Value.

Member Data Documentation

◆ Id

int CCounter::Id
protected

Referenced by CCounter(), and create().

◆ Name

char* CCounter::Name
protected

Name is allocated or deallocated on construction or destruction, respectively.

Referenced by CCounter(), create(), getName(), print(), and ~CCounter().

◆ Value

int CCounter::Value
protected

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