The Gaudi Framework  v32r2 (46d42edc)
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 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 ( )
virtualdefault

destructor

Member Function Documentation

◆ print() [1/4]

◆ print() [2/4]

◆ print() [3/4]

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 Gaudi::StatEntity, and Gaudi::Accumulators::BinomialCounter< Arithmetic, Atomicity >.

Definition at line 619 of file Counters.h.

619 { return printImpl( o, tag ); }
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
inlinevirtual

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

Definition at line 620 of file Counters.h.

620 { return printImpl( o, tag ); }
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  }
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
string s
Definition: gaudirun.py:318

◆ toBePrinted()

virtual bool Gaudi::Accumulators::PrintableCounter::toBePrinted ( ) const
inlinevirtual

◆ 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  }
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream
T str(T... args)

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