TdkSimpleProfiler Class Reference
[The TDK utilities group.]

#include <TdkSimpleProfiler.h>

List of all members.

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.


Detailed Description

Simple profiler class. This class can be used to make raw measures of code usage.


Member Enumeration Documentation

enum TdkSimpleProfiler::TdkProfilerReportType

Enumerator:
TdkProfilerReportText 
TdkProfilerReportHtml 


Constructor & Destructor Documentation

TdkSimpleProfiler::TdkSimpleProfiler (  ) 

Default constructor.

TdkSimpleProfiler::~TdkSimpleProfiler (  )  [virtual]

Virtual destructor.


Member Function Documentation

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.

Parameters:
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.

Parameters:
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.

Parameters:
Type of the report to generate.
Returns:
A reportType type profiler report.

std::string TdkSimpleProfiler::createSimpleTextReport ( void   )  [private]

Creates a simple text report of all the tracked profile entries.

Returns:
A string containg the text version of the profile report.

std::string TdkSimpleProfiler::createHtmlReport ( void   )  [private]

Creates a html report of all the tracked profile entries.

Returns:
A string containg the html version of the profile report.

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.

Returns:
The current time as a string.

void TdkSimpleProfiler::destroyProfilerEntries ( void   )  [private]

Helper method to delete all the profile entries in the collection.


Member Data Documentation

std::vector<TdkSimpleProfilerEntry *> TdkSimpleProfiler::_collection [private]

Collection that holds the profiling entries.

TdkSimpleProfilerEntry::EntryId_t TdkSimpleProfiler::_nextEntryId [private]

Used to keep track of the next entry id to be used.


The documentation for this class was generated from the following files:
Generated on Fri Jun 15 16:54:54 2007 for TDK by  doxygen 1.5.2