#include <AbsVisitor.h>
Public Member Functions | |
void | clear () |
void | process (const Input &) |
unsigned long | result () |
VisitCounter () | |
Private Attributes | |
unsigned long | counter_ |
Simple counter of visits is needed often, so it makes sense to put it together with AbsVisitor in the same header. Do not derive from this class, its destructor is not virtual.
Definition at line 39 of file AbsVisitor.h.
npstat::VisitCounter< Input >::VisitCounter | ( | ) | [inline] |
Definition at line 42 of file AbsVisitor.h.
: counter_(0UL) {}
void npstat::VisitCounter< Input >::clear | ( | void | ) | [inline, virtual] |
Clear all accumulated results
Implements npstat::AbsVisitor< Input, unsigned long >.
Definition at line 44 of file AbsVisitor.h.
References npstat::VisitCounter< Input >::counter_.
{counter_ = 0UL;}
void npstat::VisitCounter< Input >::process | ( | const Input & | value | ) | [inline, virtual] |
Process one array point
Implements npstat::AbsVisitor< Input, unsigned long >.
Definition at line 45 of file AbsVisitor.h.
References npstat::VisitCounter< Input >::counter_.
{++counter_;}
unsigned long npstat::VisitCounter< Input >::result | ( | ) | [inline, virtual] |
Return the result at the end of array processing
Implements npstat::AbsVisitor< Input, unsigned long >.
Definition at line 46 of file AbsVisitor.h.
References npstat::VisitCounter< Input >::counter_.
{return counter_;}
unsigned long npstat::VisitCounter< Input >::counter_ [private] |
Definition at line 49 of file AbsVisitor.h.
Referenced by npstat::VisitCounter< Input >::clear(), npstat::VisitCounter< Input >::process(), and npstat::VisitCounter< Input >::result().