14#include <fmt/format.h>
15#include <fmt/ostream.h>
26struct fmt::formatter<
StatEntity> : fmt::ostream_formatter {};
51 std::ostringstream ost;
59 if ( !
m_tag.empty() ) {
63 tag = fmt::format(
"\"{}\"",
m_tag );
66 return o << fmt::format(
" {:^30} {}", tag,
entity );
std::ostream & operator<<(std::ostream &stream, const Stat &stat)
external printout operator to std::ostream
Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
Stat operator+(const Stat &stat, const double value)
external operator for addition of Stat and a number
"Stat"-related part of interface IChronoStatSvc
backward compatible StatEntity class.
friend void reset(StatEntity &s)
Small wrapper class for easy manipulation with generic counters and IStatSvc interface.
std::string m_tag
unique stat tag(name)
Stat(StatEntity *entity=0, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
std::string toString() const
representation as string
const StatEntity * entity() const
get the entity
StatEntity * m_entity
underlying counter
std::ostream & print(std::ostream &o=std::cout) const
printout to std::ostream
SmartIF< IStatSvc > m_stat
Stat service.