Go to the documentation of this file.
15 #ifndef STATCOLLECTION_H
16 #define STATCOLLECTION_H
38 void AddStat(
const char *category,
const char *owner,
double value);
39 void AddStat(
const char *category,
const char *owner,
long value);
40 void SumStat(
const char *category,
const char *owner,
double value);
41 void SumStat(
const char *category,
const char *owner,
long value);
63 int FindNextStat(
const char *category,
const char *owner,
int startIndex=0)
const;
64 int FindPrevStat(
const char *category,
const char *owner,
int startIndex=-1)
const;
65 int FindNextStat(
const char *what,
bool findCategory,
int startIndex = 0)
const;
66 int FindPrevStat(
const char *what,
bool findCategory,
int startIndex = -1)
const;
int FindPrevStat(const char *category, const char *owner, int startIndex=-1) const
Find the previous stat entry that matches the given category and owner name.
bool passFilter(const char *category) const
Check to see if the category stats should be saved.
void AddFilter(const char *category)
Adding a filter will cause only stats of the given category to be collected.
std::vector< std::string > categories
bool LookupStat(const char *category, const char *owner, statValue &) const
Find the last stat entered that matches the category and owner.
const char * LookupOwnerID(int id) const
Given a owner ID, return the text description.
std::vector< statistics > stats
void PrintStatsTable() const
void EnablePrintOutput(bool pO)
int LookupCategory(const char *category) const
Given a category, look up the ID.
void SumStat(const char *category, const char *owner, double value)
Given stats for the category and owner, find an existing stat (chronologically backwards search) with...
void ClearAllStats()
Remove all stat entries from the collection.
std::vector< std::string > includeFilters
statValue * getLastStat(const char *category, const char *owner)
Find the last stat entered that matches the category and owner.
void AddExcludeFilter(const char *category)
void ClearFilters()
Clear any filters being used for stat entry.
const char * lookupCategoryID(int id) const
Given a category ID, return the text description.
int addCategory(const char *category)
Add a new category to the category list.
const statistics * GetStatNum(int which) const
Return the nth stat which has been collected.
std::vector< std::string > excludeFilters
The StatCollection class is for collecting stats across different parts of the simulation.
std::vector< std::string > owners
int addOwner(const char *owner)
Add a new owner to the owner list.
void AddStat(const char *category, const char *owner, double value)
Add a new stat entry for the given category, owner and value.
void AddIncludeFilter(const char *category)
int GetNumStats() const
The number of stats collected so far.
int FindNextStat(const char *category, const char *owner, int startIndex=0) const
Find the next stat entry that matches the given category and owner name.
int LookupOwner(const char *owner) const
Given an owner, look up the ID.