The Gaudi Framework  v30r4 (9b837755)
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:

Public Member Functions

 PrintableCounter ()=default
 
template<class OWNER >
 PrintableCounter (OWNER *o, const std::string &tag)
 
virtual ~PrintableCounter ()=default
 destructor More...
 
virtual std::ostreamprint (std::ostream &, bool tableFormat=false) const =0
 prints the counter to a stream 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...
 
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 647 of file Counters.h.

Constructor & Destructor Documentation

Gaudi::Accumulators::PrintableCounter::PrintableCounter ( )
default
template<class OWNER >
Gaudi::Accumulators::PrintableCounter::PrintableCounter ( OWNER *  o,
const std::string tag 
)
inline

Definition at line 650 of file Counters.h.

651  {
652  o->registerCounter( tag, *this );
653  }
virtual Gaudi::Accumulators::PrintableCounter::~PrintableCounter ( )
virtualdefault

destructor

Member Function Documentation

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

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

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

Definition at line 659 of file Counters.h.

660  {
661  o << boost::format{" | %|-48.48s|%|50t|"} % ( "\"" + tag + "\"" );
662  return print( o, true );
663  }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
virtual bool Gaudi::Accumulators::PrintableCounter::toBePrinted ( ) const
inlinevirtual

hint whether we should print that counter or not.

Typically empty counters may not be printed

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

Definition at line 666 of file Counters.h.

666 { return true; }
std::string Gaudi::Accumulators::PrintableCounter::toString ( ) const
inline

get a string representation

Definition at line 668 of file Counters.h.

669  {
670  std::ostringstream ost;
671  print( ost );
672  return ost.str();
673  }
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream

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