| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | List of all members
Gaudi::Accumulators::Counter< Arithmetic, Atomicity > Struct Template Reference

A basic counter counting input values. More...

`#include <GaudiKernel/Counters.h>`

Inheritance diagram for Gaudi::Accumulators::Counter< Arithmetic, Atomicity >:
[legend]
Collaboration diagram for Gaudi::Accumulators::Counter< Arithmetic, Atomicity >:
[legend]

## Public Member Functions
Counter & | operator++ ()
Counter | operator++ (int)
template<typename stream >
stream & | printImpl (stream &o, bool tableFormat) const
std::ostream & | print (std::ostream &o, bool tableFormat=false) const override
| prints the counter to a stream More...
MsgStream & | print (MsgStream &o, bool tableFormat=false) const override
bool | toBePrinted () const override
| hint whether we should print that counter or not. More...
Public Member Functions inherited from Gaudi::Accumulators::BufferableCounter< Arithmetic, Atomicity, Accumulator >
Buffer< Arithmetic, Accumulator > | buffer ()
| PrintableCounter ()=default
template<class OWNER >
| PrintableCounter (OWNER *o, const std::string &tag)
Public Member Functions inherited from Gaudi::Accumulators::PrintableCounter
| PrintableCounter ()=default
template<class OWNER >
| PrintableCounter (OWNER *o, const std::string &tag)
virtual | ~PrintableCounter ()=default
| destructor More...
template<typename stream >
stream & | printImpl (stream &s, const std::string &tag) const
virtual std::ostream & | print (std::ostream &o, const std::string &tag) const
| prints the counter to a stream in table format, with the given tag More...
virtual MsgStream & | print (MsgStream &o, const std::string &tag) const
std::string | toString () const
| get a string representation More...
Public Member Functions inherited from Gaudi::Accumulators::CountAccumulator< Arithmetic, Atomicity >
unsigned long | nEntries () const
Public Member Functions inherited from Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >
GenericAccumulator | operator+= (const InputType by)
| GenericAccumulator ()
template<typename... Args>
| GenericAccumulator (std::in_place_t, Args &&... args)
| GenericAccumulator (const GenericAccumulator &other)
GenericAccumulator & | operator= (const GenericAccumulator &other)
OutputType | value () const
void | reset ()
template<atomicity ato, typename VH >
void | mergeAndReset (GenericAccumulator< InputType, InnerType, ato, InputTransform, OutputTransform, VH > &&other)

## Additional Inherited Members
Public Types inherited from Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >
using | OutputType = std::decay_t< std::result_of_t< OutputTransform(InnerType)> >
Protected Member Functions inherited from Gaudi::Accumulators::GenericAccumulator< InputType, InnerType, Atomicity, InputTransform, OutputTransform, ValueHandler >
void | reset (InnerType in)

## Detailed Description

### template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
struct Gaudi::Accumulators::Counter< Arithmetic, Atomicity >

A basic counter counting input values.

See also
  Gaudi::Accumulators for detailed documentation

Definition at line 653 of file Counters.h.

## Member Function Documentation

## ◆ operator++() [1/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

Counter& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::operator++ | ( |  | ) |
| inline

Definition at line 655 of file Counters.h.

655 {
656 ( *this ) += Arithmetic{};
657 return *this;
658 }

## ◆ operator++() [2/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

Counter Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::operator++ | ( | int |  | ) |
| inline

Definition at line 659 of file Counters.h.

659 {
660 auto copy = *this;
661 ++( *this );
662 return copy;
663 }
std::copy
T copy(T... args)

## ◆ print() [1/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

std::ostream& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::print | ( | std::ostream & | ,
|  | bool | tableFormat = `false`
| ) |  | const
| inline override virtual

prints the counter to a stream

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 673 of file Counters.h.

673 {
674 return printImpl( o, tableFormat );
675 }
Gaudi::Accumulators::Counter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:667

## ◆ print() [2/2]

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

MsgStream& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::print | ( | MsgStream & | o,
|  | bool | tableFormat = `false`
| ) |  | const
| inline override virtual

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 676 of file Counters.h.

676 { return printImpl( o, tableFormat ); }
Gaudi::Accumulators::Counter::printImpl
stream & printImpl(stream &o, bool tableFormat) const
Definition: Counters.h:667

## ◆ printImpl()

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
template<typename stream >

stream& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::printImpl | ( | stream & | o,
|  | bool | tableFormat
| ) |  | const
| inline

Definition at line 667 of file Counters.h.

667 {
668 // Avoid printing empty counters in non DEBUG mode
669 auto fmt = ( tableFormat ? "|%|10d| |" : "#=%|-7lu|" );
670 return o << boost::format{fmt} % this->nEntries();
671 }
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Gaudi::Accumulators::CountAccumulator::nEntries
unsigned long nEntries() const
Definition: Counters.h:423

## ◆ toBePrinted()

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>

bool Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::toBePrinted | ( |  | ) | const
| inline override virtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 677 of file Counters.h.

677 {
678 return this->nEntries() > 0;
679 ;
680 }
Gaudi::Accumulators::CountAccumulator::nEntries
unsigned long nEntries() const
Definition: Counters.h:423

The documentation for this struct was generated from the following file:

- GaudiKernel/GaudiKernel/Counters.h