The Gaudi Framework  v31r0 (aeb156f0)
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...
 
template<typename stream >
stream & printImpl (stream &s, const std::string &tag) const
 
virtual std::ostreamprint (std::ostream &, bool tableFormat=false) const =0
 prints the counter to a stream More...
 
virtual MsgStreamprint (MsgStream &, bool tableFormat=true) const =0
 
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 MsgStreamprint (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 619 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 622 of file Counters.h.

622  {
623  o->declareCounter( tag, *this );
624  }
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 637 of file Counters.h.

637 { return printImpl( o, tag ); }
stream & printImpl(stream &s, const std::string &tag) const
Definition: Counters.h:629
virtual MsgStream& Gaudi::Accumulators::PrintableCounter::print ( MsgStream o,
const std::string tag 
) const
inlinevirtual

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

Definition at line 638 of file Counters.h.

638 { return printImpl( o, tag ); }
stream & printImpl(stream &s, const std::string &tag) const
Definition: Counters.h:629
template<typename stream >
stream& Gaudi::Accumulators::PrintableCounter::printImpl ( stream &  s,
const std::string tag 
) const
inline

Definition at line 629 of file Counters.h.

629  {
630  s << boost::format{" | %|-48.48s|%|50t|"} % ( "\"" + tag + "\"" );
631  return print( s, true );
632  }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
string s
Definition: gaudirun.py:312
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 641 of file Counters.h.

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

get a string representation

Definition at line 643 of file Counters.h.

643  {
644  std::ostringstream ost;
645  print( ost );
646  return ost.str();
647  }
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: