The Gaudi Framework  v36r9 (fd2bdac3)
Gaudi::Accumulators::PrintableCounter Struct Referenceabstract

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

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators.h>

Inheritance diagram for Gaudi::Accumulators::PrintableCounter:

Public Member Functions

 PrintableCounter ()=default
 
virtual ~PrintableCounter ()=default
 destructor More...
 
template<typename stream >
stream & printImpl (stream &s, std::string_view 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, std::string_view tag) const
 prints the counter to a stream in table format, with the given tag More...
 
virtual MsgStreamprint (MsgStream &o, std::string_view 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...
 
virtual nlohmann::json toJSON () const =0
 Basic JSON export for Gaudi::Monitoring::Hub support. 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 833 of file Accumulators.h.

Constructor & Destructor Documentation

◆ PrintableCounter()

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

◆ ~PrintableCounter()

virtual Gaudi::Accumulators::PrintableCounter::~PrintableCounter ( )
virtualdefault

destructor

Member Function Documentation

◆ print() [1/4]

◆ print() [2/4]

virtual MsgStream& Gaudi::Accumulators::PrintableCounter::print ( MsgStream o,
std::string_view  tag 
) const
inlinevirtual

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

Definition at line 848 of file Accumulators.h.

848 { return printImpl( o, tag ); }

◆ print() [3/4]

◆ print() [4/4]

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

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

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

Definition at line 847 of file Accumulators.h.

847 { return printImpl( o, tag ); }

◆ printImpl()

template<typename stream >
stream& Gaudi::Accumulators::PrintableCounter::printImpl ( stream &  s,
std::string_view  tag 
) const
inline

Definition at line 839 of file Accumulators.h.

839  {
840  s << boost::format{ " | %|-48.48s|%|50t|" } % ( std::string{ '\"' }.append( tag ).append( "\"" ) );
841  return print( s, true );
842  }

◆ toBePrinted()

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

◆ toJSON()

◆ toString()

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

get a string representation

Definition at line 853 of file Accumulators.h.

853  {
854  std::ostringstream ost;
855  print( ost );
856  return ost.str();
857  }

The documentation for this struct was generated from the following file:
Gaudi::Accumulators::PrintableCounter::printImpl
stream & printImpl(stream &s, std::string_view tag) const
Definition: Accumulators.h:839
std::string
STL class.
gaudirun.s
string s
Definition: gaudirun.py:346
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
std::string::append
T append(T... args)
std::ostringstream
STL class.
std::ostringstream::str
T str(T... args)
Gaudi::Accumulators::PrintableCounter::print
virtual std::ostream & print(std::ostream &, bool tableFormat=false) const =0
prints the counter to a stream