The Gaudi Framework  v30r4 (9b837755)
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 >:
Collaboration diagram for Gaudi::Accumulators::Counter< Arithmetic, Atomicity >:

Public Member Functions

Counteroperator++ ()
 
Counter operator++ (int)
 
std::ostreamprint (std::ostream &o, bool tableFormat=false) const override
 prints the counter to a stream More...
 
virtual 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 ()
 
- 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...
 
virtual std::ostreamprint (std::ostream &o, const std::string &tag) const
 prints the counter to a stream in table format, with the given tag More...
 
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 ()
 
 GenericAccumulator (const GenericAccumulator &other)
 
GenericAccumulatoroperator= (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 700 of file Counters.h.

Member Function Documentation

template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
Counter& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::operator++ ( )
inline

Definition at line 702 of file Counters.h.

703  {
704  ( *this ) += Arithmetic{};
705  return *this;
706  }
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
Counter Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::operator++ ( int  )
inline

Definition at line 707 of file Counters.h.

708  {
709  auto copy = *this;
710  ++( *this );
711  return copy;
712  }
T copy(T...args)
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
std::ostream& Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::print ( std::ostream ,
bool  tableFormat = false 
) const
inlineoverridevirtual

prints the counter to a stream

Implements Gaudi::Accumulators::PrintableCounter.

Definition at line 714 of file Counters.h.

715  {
716  // Avoid printing empty counters in non DEBUG mode
717  std::string fmt( "#=%|-7lu|" );
718  if ( tableFormat ) {
719  fmt = "|%|10d| |";
720  }
721  o << boost::format{fmt} % this->nEntries();
722  return o;
723  }
unsigned long nEntries() const
Definition: Counters.h:464
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
STL class.
template<typename Arithmetic = double, atomicity Atomicity = atomicity::full>
virtual bool Gaudi::Accumulators::Counter< Arithmetic, Atomicity >::toBePrinted ( ) const
inlineoverridevirtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

Reimplemented from Gaudi::Accumulators::PrintableCounter.

Definition at line 724 of file Counters.h.

725  {
726  return this->nEntries() > 0;
727  ;
728  }
unsigned long nEntries() const
Definition: Counters.h:464

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