Planeshift
rcContext Class Reference

Provides an interface for optional logging and performance tracking of the Recast build process. More...

#include <Recast.h>

Public Member Functions

void enableLog (bool state)
 Enables or disables logging. More...
 
void enableTimer (bool state)
 Enables or disables the performance timers. More...
 
int getAccumulatedTime (const rcTimerLabel label) const
 Returns the total accumulated time of the specified performance timer. More...
 
void log (const rcLogCategory category, const char *format,...)
 Logs a message. More...
 
 rcContext (bool state=true)
 Contructor. More...
 
void resetLog ()
 Clears all log entries. More...
 
void resetTimers ()
 Clears all peformance timers. (Resets all to unused.) More...
 
void startTimer (const rcTimerLabel label)
 Starts the specified performance timer. More...
 
void stopTimer (const rcTimerLabel label)
 Stops the specified performance timer. More...
 
virtual ~rcContext ()
 

Protected Member Functions

virtual int doGetAccumulatedTime (const rcTimerLabel) const
 Returns the total accumulated time of the specified performance timer. More...
 
virtual void doLog (const rcLogCategory, const char *, const int)
 Logs a message. More...
 
virtual void doResetLog ()
 Clears all log entries. More...
 
virtual void doResetTimers ()
 Clears all timers. (Resets all to unused.) More...
 
virtual void doStartTimer (const rcTimerLabel)
 Starts the specified performance timer. More...
 
virtual void doStopTimer (const rcTimerLabel)
 Stops the specified performance timer. More...
 

Protected Attributes

bool m_logEnabled
 True if logging is enabled. More...
 
bool m_timerEnabled
 True if the performance timers are enabled. More...
 

Detailed Description

Provides an interface for optional logging and performance tracking of the Recast build process.

Definition at line 101 of file Recast.h.

Constructor & Destructor Documentation

rcContext::rcContext ( bool  state = true)
inline

Contructor.

Parameters
[in]stateTRUE if the logging and performance timers should be enabled. [Default: true]

Definition at line 107 of file Recast.h.

virtual rcContext::~rcContext ( )
inlinevirtual

Definition at line 108 of file Recast.h.

Member Function Documentation

virtual int rcContext::doGetAccumulatedTime ( const rcTimerLabel  ) const
inlineprotectedvirtual

Returns the total accumulated time of the specified performance timer.

Parameters
[in]labelThe category of the timer.
Returns
The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.

Definition at line 167 of file Recast.h.

virtual void rcContext::doLog ( const rcLogCategory  ,
const char *  ,
const int   
)
inlineprotectedvirtual

Logs a message.

Parameters
[in]categoryThe category of the message.
[in]msgThe formatted message.
[in]lenThe length of the formatted message.

Definition at line 151 of file Recast.h.

virtual void rcContext::doResetLog ( )
inlineprotectedvirtual

Clears all log entries.

Definition at line 145 of file Recast.h.

virtual void rcContext::doResetTimers ( )
inlineprotectedvirtual

Clears all timers. (Resets all to unused.)

Definition at line 154 of file Recast.h.

virtual void rcContext::doStartTimer ( const rcTimerLabel  )
inlineprotectedvirtual

Starts the specified performance timer.

Parameters
[in]labelThe category of timer.

Definition at line 158 of file Recast.h.

virtual void rcContext::doStopTimer ( const rcTimerLabel  )
inlineprotectedvirtual

Stops the specified performance timer.

Parameters
[in]labelThe category of the timer.

Definition at line 162 of file Recast.h.

void rcContext::enableLog ( bool  state)
inline

Enables or disables logging.

Parameters
[in]stateTRUE if logging should be enabled.

Definition at line 112 of file Recast.h.

void rcContext::enableTimer ( bool  state)
inline

Enables or disables the performance timers.

Parameters
[in]stateTRUE if timers should be enabled.

Definition at line 124 of file Recast.h.

int rcContext::getAccumulatedTime ( const rcTimerLabel  label) const
inline

Returns the total accumulated time of the specified performance timer.

Parameters
labelThe category of the timer.
Returns
The accumulated time of the timer, or -1 if timers are disabled or the timer has never been started.

Definition at line 140 of file Recast.h.

void rcContext::log ( const rcLogCategory  category,
const char *  format,
  ... 
)

Logs a message.

Parameters
[in]categoryThe category of the message.
[in]formatThe message.
void rcContext::resetLog ( )
inline

Clears all log entries.

Definition at line 115 of file Recast.h.

void rcContext::resetTimers ( )
inline

Clears all peformance timers. (Resets all to unused.)

Definition at line 127 of file Recast.h.

void rcContext::startTimer ( const rcTimerLabel  label)
inline

Starts the specified performance timer.

Parameters
labelThe category of timer.

Definition at line 131 of file Recast.h.

void rcContext::stopTimer ( const rcTimerLabel  label)
inline

Stops the specified performance timer.

Parameters
labelThe category of the timer.

Definition at line 135 of file Recast.h.

Member Data Documentation

bool rcContext::m_logEnabled
protected

True if logging is enabled.

Definition at line 170 of file Recast.h.

bool rcContext::m_timerEnabled
protected

True if the performance timers are enabled.

Definition at line 173 of file Recast.h.


The documentation for this class was generated from the following file: