| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | List of all members
Gaudi::Accumulators::PrintableCounter Struct Referenceabstract

An empty ancester of all counters that knows how to print themselves. More...

`#include <GaudiKernel/Counters.h>`

Inheritance diagram for Gaudi::Accumulators::PrintableCounter:
[legend]

## Public Member Functions
| 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 &, bool tableFormat=false) const =0
| prints the counter to a stream More...
virtual MsgStream & | print (MsgStream &, bool tableFormat=true) const =0
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
virtual bool | toBePrinted () const
| hint whether we should print that counter or not. More...
std::string | toString () const
| get a string representation More...

## Detailed Description

An empty ancester of all counters that knows how to print themselves.

See also
  Gaudi::Accumulators for detailed documentation

Definition at line 601 of file Counters.h.

## Constructor & Destructor Documentation

## ◆ PrintableCounter() [1/2]

Gaudi::Accumulators::PrintableCounter::PrintableCounter | ( |  | ) |
| default

## ◆ PrintableCounter() [2/2]

template<class OWNER >

Gaudi::Accumulators::PrintableCounter::PrintableCounter | ( | OWNER * | o,
|  | const std::string & | tag
| ) |  |
| inline

Definition at line 604 of file Counters.h.

604 {
605 o->declareCounter( tag, *this );
606 }

## ◆ ~PrintableCounter()

virtual Gaudi::Accumulators::PrintableCounter::~PrintableCounter | ( |  | ) |
| virtual default

destructor

## Member Function Documentation

## ◆ print() [1/4]

virtual std::ostream& Gaudi::Accumulators::PrintableCounter::print | ( | std::ostream & | ,
|  | bool | tableFormat = `false`
| ) |  | const
| pure virtual

prints the counter to a stream

Implemented in Gaudi::StatEntity, Gaudi::Accumulators::details::MsgCounter< level, Atomicity >, Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Unit >, Gaudi::Accumulators::SigmaCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >, and Gaudi::Accumulators::Counter< Arithmetic, Atomicity >.

## ◆ print() [2/4]

virtual MsgStream& Gaudi::Accumulators::PrintableCounter::print | ( | MsgStream & | ,
|  | bool | tableFormat = `true`
| ) |  | const
| pure virtual

Implemented in Gaudi::StatEntity, Gaudi::Accumulators::details::MsgCounter< level, Atomicity >, Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Unit >, Gaudi::Accumulators::SigmaCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >, and Gaudi::Accumulators::Counter< Arithmetic, Atomicity >.

## ◆ print() [3/4]

virtual std::ostream& Gaudi::Accumulators::PrintableCounter::print | ( | std::ostream & | o,
|  | const std::string & | tag
| ) |  | const
| inline virtual

prints the counter to a stream in table format, with the given tag

Reimplemented in Gaudi::StatEntity, and Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >.

Definition at line 619 of file Counters.h.

619 { return printImpl( o, tag ); }
Gaudi::Accumulators::PrintableCounter::printImpl
stream & printImpl(stream &s, const std::string &tag) const
Definition: Counters.h:611

## ◆ print() [4/4]

virtual MsgStream& Gaudi::Accumulators::PrintableCounter::print | ( | MsgStream & | o,
|  | const std::string & | tag
| ) |  | const
| inline virtual

Reimplemented in Gaudi::StatEntity, and Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >.

Definition at line 620 of file Counters.h.

620 { return printImpl( o, tag ); }
Gaudi::Accumulators::PrintableCounter::printImpl
stream & printImpl(stream &s, const std::string &tag) const
Definition: Counters.h:611

## ◆ printImpl()

template<typename stream >

stream& Gaudi::Accumulators::PrintableCounter::printImpl | ( | stream & | s,
|  | const std::string & | tag
| ) |  | const
| inline

Definition at line 611 of file Counters.h.

611 {
612 s << boost::format{" | %|-48.48s|%|50t|"} % ( "\"" + tag + "\"" );
613 return print( s, true );
614 }
Gaudi::Accumulators::PrintableCounter::print
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
gaudirun.s
string s
Definition: gaudirun.py:316

## ◆ toBePrinted()

virtual bool Gaudi::Accumulators::PrintableCounter::toBePrinted | ( |  | ) | const
| inline virtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

Reimplemented in Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::StatCounter< Unit >, Gaudi::Accumulators::SigmaCounter< Arithmetic, Atomicity >, Gaudi::Accumulators::AveragingCounter< Arithmetic, Atomicity >, and Gaudi::Accumulators::Counter< Arithmetic, Atomicity >.

Definition at line 623 of file Counters.h.

623 { return true; }

## ◆ toString()

std::string Gaudi::Accumulators::PrintableCounter::toString | ( |  | ) | const
| inline

get a string representation

Definition at line 625 of file Counters.h.

625 {
626 std::ostringstream ost;
627 print( ost );
628 return ost.str();
629 }
Gaudi::Accumulators::PrintableCounter::print
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
std::ostringstream
STL class.
std::ostringstream::str
T str(T... args)

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

- GaudiKernel/GaudiKernel/Counters.h