72 :
flags(
none), precision(-1), prereq(0), storageParams()
104 while (item !=
vec.end()) {
108 std::string::const_iterator
c = item->begin();
111 if (!isalpha(*
c) && *
c !=
'_')
115 while (++
c != item->end()) {
116 if (!isalnum(*
c) && *
c !=
'_')
139 panic_if(!
p.second,
"same statistic name used twice! name=%s\n",
name);
148 const std::string &name1 = stat1->
name;
149 const std::string &name2 = stat2->
name;
157 size_type last = std::min(v1.size(), v2.size()) - 1;
160 return v1[
i] < v2[
i];
163 if (v1[last] == v2[last])
164 return v1.size() < v2.size();
166 return v1[last] < v2[last];
175 panic(
"this is stat number %d\n"
176 "Not all stats have been initialized.\n"
177 "You may need to add <ParentClass>::regStats() to a"
178 " new SimObject's regStats() function. Name: %s",
184 panic(
"all printable stats must be named");
void setName(const std::string &name, bool old_style=true)
Set the name of this statistic.
std::unique_ptr< const StorageParams > storageParams
Flags flags
The formatting flags.
StorageParams const * getStorageParams() const
Getter for the storage params.
virtual void enable()
Enable the stat for use.
void setStorageParams(const StorageParams *const params)
Setter for the storage params.
std::string name
The name of the stat.
static int id_count
A unique stat ID for each stat in the simulator.
static std::string separatorString
The separator string used for vectors, dist, etc.
static bool less(Info *stat1, Info *stat2)
Checks if the first stat's name is alphabetically less than the second.
void enable()
Enable the stat for use.
std::vector< std::string > subdescs
std::vector< std::string > y_subnames
std::vector< std::string > subnames
Names and descriptions of subfields.
virtual size_type size() const =0
void enable()
Enable the stat for use.
std::vector< std::string > subdescs
std::vector< std::string > subnames
Names and descriptions of subfields.
void enable()
Enable the stat for use.
virtual size_type size() const =0
std::vector< std::string > subdescs
std::vector< std::string > subnames
Names and descriptions of subfields.
#define panic(...)
This implements a cprintf based panic() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
const FlagsType init
This Stat is Initialized.
std::map< std::string, Info * > NameMapType
const FlagsType display
Print this stat.
bool validateStatName(const std::string &name)
const FlagsType none
Nothing extra to print.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
void tokenize(std::vector< std::string > &v, const std::string &s, char token, bool ignore)
const std::string & name()