#include <TdkSimpleProfiler.h>
Public Types | |
enum | TdkProfilerReportType { TdkProfilerReportText = 0, TdkProfilerReportHtml } |
Public Member Functions | |
TdkSimpleProfiler () | |
Default constructor. | |
virtual | ~TdkSimpleProfiler () |
Virtual destructor. | |
void | begin (TdkSimpleProfilerEntry::EntryId_t &entryId, std::string sEntryName) |
void | end (const TdkSimpleProfilerEntry::EntryId_t entryId) |
void | endAll (void) |
Ends all the profiling tracking. | |
void | reset (void) |
Destroys the contained profiler entries. | |
std::string | createReport (const TdkSimpleProfiler::TdkProfilerReportType reportType) |
Private Member Functions | |
std::string | createSimpleTextReport (void) |
std::string | createHtmlReport (void) |
TdkSimpleProfilerEntry::EntryId_t | getNextEntryId (void) |
Get's the id that will be used to create the next profile entry. | |
void | incrementIdCounter (void) |
std::string | genStringTimeNow (void) |
void | destroyProfilerEntries (void) |
Helper method to delete all the profile entries in the collection. | |
Private Attributes | |
std::vector< TdkSimpleProfilerEntry * > | _collection |
Collection that holds the profiling entries. | |
TdkSimpleProfilerEntry::EntryId_t | _nextEntryId |
Used to keep track of the next entry id to be used. |
TdkSimpleProfiler::TdkSimpleProfiler | ( | ) |
Default constructor.
TdkSimpleProfiler::~TdkSimpleProfiler | ( | ) | [virtual] |
Virtual destructor.
void TdkSimpleProfiler::begin | ( | TdkSimpleProfilerEntry::EntryId_t & | entryId, | |
std::string | sEntryName | |||
) |
Begins a profiling entry. Creates a profile entry named sEntryName whose id is returned in entryId and sets it's starting time.
Identifier | of the new entry. | |
name | of the entry. (uniqueness is not required) |
void TdkSimpleProfiler::end | ( | const TdkSimpleProfilerEntry::EntryId_t | entryId | ) |
Ends a profiling entry's tracking. Terminates the profile tracking of the entry id is entryId.
Identifier | of the entry to be closed. |
void TdkSimpleProfiler::endAll | ( | void | ) |
Ends all the profiling tracking.
void TdkSimpleProfiler::reset | ( | void | ) |
Destroys the contained profiler entries.
std::string TdkSimpleProfiler::createReport | ( | const TdkSimpleProfiler::TdkProfilerReportType | reportType | ) |
Creates a report of the reportType type.
Type | of the report to generate. |
std::string TdkSimpleProfiler::createSimpleTextReport | ( | void | ) | [private] |
Creates a simple text report of all the tracked profile entries.
std::string TdkSimpleProfiler::createHtmlReport | ( | void | ) | [private] |
Creates a html report of all the tracked profile entries.
TdkSimpleProfilerEntry::EntryId_t TdkSimpleProfiler::getNextEntryId | ( | void | ) | [private] |
Get's the id that will be used to create the next profile entry.
void TdkSimpleProfiler::incrementIdCounter | ( | void | ) | [private] |
Increments the next id used to generate unique identifiers for the profiler entries within this profiler.
std::string TdkSimpleProfiler::genStringTimeNow | ( | void | ) | [private] |
Helper method to get the current time as a string.
void TdkSimpleProfiler::destroyProfilerEntries | ( | void | ) | [private] |
Helper method to delete all the profile entries in the collection.
std::vector<TdkSimpleProfilerEntry *> TdkSimpleProfiler::_collection [private] |
Collection that holds the profiling entries.
Used to keep track of the next entry id to be used.