|
Public Member Functions |
| statCollection () |
| ~statCollection () |
void | addStat (const char *category, const char *owner, double value) |
| Add a new stat entry for the given category, owner and value.
|
void | addStat (const char *category, const char *owner, long value) |
| Add a new stat entry for the given category, owner and value.
|
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 the same category and owner, and add this stat to the existing value.
|
void | sumStat (const char *category, const char *owner, long value) |
| Given stats for the category and owner, find an existing stat (chronologically backwards search) with the same category and owner, and add this stat to the existing value.
|
void | clearAllStats () |
| Remove all stat entries from the collection.
|
int | getNumStats () const |
| The number of stats collected so far.
|
const stat * | getStatNum (int which) const |
| Return the nth stat which has been collected.
|
int | lookupCategory (const char *category) const |
| Given a category, look up the ID.
|
int | lookupOwner (const char *owner) const |
| Given an owner, look up the ID.
|
const char * | lookupCategoryID (int id) const |
| Given a category ID, return the text description.
|
const char * | lookupOwnerID (int id) const |
| Given a owner ID, return the text description.
|
bool | lookupStat (const char *category, const char *owner, statValue &) const |
| Find the last stat entered that matches the category and owner.
|
bool | lookupStat (unsigned int index, statValue &) const |
void | addFilter (char *category) |
| Adding a filter will cause only stats of the given category to be collected.
|
void | addIncludeFilter (char *category) |
void | addExcludeFilter (char *category) |
void | clearFilters () |
| Clear any filters being used for stat entry.
|
void | enablePrintOutput (bool pO) |
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 | findPrevStat (const char *category, const char *owner, int startIndex=-1) const |
| Find the previous stat entry that matches the given category and owner name.
|
int | findNextStat (const char *what, bool findCategory, int startIndex=0) const |
| Find the next stat entry that matches the category if findCategory is true, otherwise look to match the owner name.
|
int | findPrevStat (const char *what, bool findCategory, int startIndex=-1) const |
| Find the next stat entry that matches the category if findCategory is true, otherwise look to match the owner name.
|
void | printStatsTable () const |
Private Member Functions |
int | addCategory (const char *category) |
| Add a new category to the category list.
|
int | addOwner (const char *owner) |
| Add a new owner to the owner list.
|
bool | passFilter (const char *category) const |
| Check to see if the category stats should be saved.
|
statValue * | getLastStat (const char *category, const char *owner) |
| Find the last stat entered that matches the category and owner.
|
Private Attributes |
std::vector< const char * > | categories |
std::vector< const char * > | owners |
std::vector< const char * > | includeFilters |
std::vector< const char * > | excludeFilters |
std::vector< stat > | stats |
bool | printOutput |
This class aggregates results and allows access to the collected information.