Go to the documentation of this file.
30 :categories(), owners(), stats()
81 printf(
"%s\t%s\t%1.2f\n", category, owner, value);
100 printf(
"%s\t%s\t%ld\n", category, owner, value);
118 printf(
"%s\t%s\t%1.2f\n", category, owner, sv->
fval);
121 AddStat(category, owner, value);
139 printf(
"%s\t%s\t%ld\n", category, owner, sv->
lval);
142 AddStat(category, owner, value);
160 return (
int)
stats.size();
168 return &
stats[which];
184 return owners[id].c_str();
243 for (
unsigned int x = 0; x <
categories.size(); x++)
277 for (
unsigned int x = 0; x <
owners.size(); x++)
316 for (
int x = (
int)
stats.size()-1; x >= 0; x--)
318 if ((
stats[x].category == catID) && (
stats[x].owner == ownerID))
329 if (index <
stats.size())
331 v =
stats[index].value;
348 for (
int x = (
int)
stats.size()-1; x >= 0; x--)
350 if ((
stats[x].category == catID) && (
stats[x].owner == ownerID))
351 return &
stats[x].value;
395 if (startIndex < 0 || startIndex > (
int)
stats.size()-1)
402 for (
int x = startIndex; x < (int)
stats.size(); x++)
404 if ((
stats[x].category == catID) && (
stats[x].owner == ownerID))
423 if (startIndex < 0 || startIndex > (
int)
stats.size() - 1)
424 startIndex = (int)
stats.size() -1;
430 for (
int x = startIndex; x > 0; x--)
432 if ((
stats[x].category == catID) && (
stats[x].owner == ownerID))
451 if (startIndex < 0 || startIndex > (
int)
stats.size()-1)
460 for (
int x = startIndex; x < (int)
stats.size(); x++)
462 if ((findCategory && (
stats[x].category == ID)) ||
463 (!findCategory && (
stats[x].owner == ID)))
483 if (startIndex < 0 || startIndex > (
int)
stats.size() - 1)
484 startIndex = (int)
stats.size() -1;
492 for (
int x = startIndex; x > 0; x--)
494 if ((findCategory && (
stats[x].category == ID)) ||
495 (!findCategory && (
stats[x].owner == ID)))
508 printf(
"Stats Table:\n----------------------------\n");
510 for (
int x = 0; x < (int)
stats.size(); x++)
512 printf(
"%d \t%s \t%s \t%le\n", x,
categories[
stats[x].category].c_str(),
515 printf(
"%d \t%s \t%s \t%ld\n", x,
categories[
stats[x].category].c_str(),
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
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
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.