79 "shouldn't register stat twice!");
94 assert(result.second &&
"this should never fail");
118 MapType::const_iterator
i =
statsMap().find(
this);
132 MapType::const_iterator
i =
statsMap().find(
this);
141 return _info !=
nullptr;
146 parent,
name, units::Unspecified::get(), desc)
160 parent,
name, units::Unspecified::get(), desc)
166 const char *desc,
const Temp &
r)
175 assert(!
root &&
"Can't change formulas");
176 root =
r.getNodePtr();
188 root =
r.getNodePtr();
239 for (VResult::size_type
i = 0;
i <
vec.size(); ++
i)
294 fatal(
"Stats are already enabled");
305 fatal(
"No registered statistics::dump handler");
314 fatal(
"No registered statistics::reset handler");
static Root * root()
Use this function to get a pointer to the single Root object in the simulation.
const Info * resolveStat(std::string name) const
Resolve a stat by its name within this group.
void setInit()
Save Storage class parameters if any.
void setParams(const StorageParams *params)
Save Storage class parameters if any.
Info * info()
Grab the information class for this statistic.
bool newStyleStats() const
Check if the info is new style stats.
void setInfo(Group *parent, Info *info)
Set up an info class for this statistic.
Flags flags
The formatting flags.
void setStorageParams(const StorageParams *const params)
Setter for the storage params.
Helper class to construct formula node trees.
The Base class is the parent class of all unit classes.
void set(Type mask)
Set all flag's bits matching the given mask.
#define fatal(...)
This implements a cprintf based fatal() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
void registerHandlers(Handler reset_handler, Handler dump_handler)
const FlagsType init
This Stat is Initialized.
std::shared_ptr< Node > NodePtr
Shared pointer to a function Node.
void registerDumpCallback(const std::function< void()> &callback)
Register a callback that should be called whenever statistics are about to be dumped.
std::map< const void *, Info * > MapType
void processResetQueue()
Process all the callbacks in the reset callbacks queue.
void(* Handler)()
Register reset and dump handlers.
const Info * resolve(const std::string &name)
void registerResetCallback(const std::function< void()> &callback)
Register a callback that should be called whenever statistics are reset.
std::list< Info * > & statsList()
void processDumpQueue()
Process all the callbacks in the dump callbacks queue.
void dump()
Dump all statistics data to the registered outputs.
double Result
All results are doubles.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Declaration of Statistics objects.
const std::string & name()