Blender V2.61 - r43446
Public Member Functions | Protected Attributes

KX_TimeLogger Class Reference

#include <KX_TimeLogger.h>

List of all members.

Public Member Functions

 KX_TimeLogger (unsigned int maxNumMeasurements=10)
virtual ~KX_TimeLogger (void)
virtual void SetMaxNumMeasurements (unsigned int maxNumMeasurements)
virtual unsigned int GetMaxNumMeasurements (void) const
virtual void StartLog (double now)
virtual void EndLog (double now)
virtual void NextMeasurement (double now)
virtual double GetAverage (void) const

Protected Attributes

std::deque< double > m_measurements
unsigned int m_maxNumMeasurements
double m_logStart
bool m_logging

Detailed Description

Stores and manages time measurements.

Definition at line 48 of file KX_TimeLogger.h.


Constructor & Destructor Documentation

KX_TimeLogger::KX_TimeLogger ( unsigned int  maxNumMeasurements = 10)

Constructor.

Parameters:
maxNumMesasurementsMaximum number of measurements stored (>1).

Definition at line 35 of file KX_TimeLogger.cpp.

KX_TimeLogger::~KX_TimeLogger ( void  ) [virtual]

Destructor.

Definition at line 43 of file KX_TimeLogger.cpp.


Member Function Documentation

void KX_TimeLogger::EndLog ( double  now) [virtual]

End logging in current measurement.

Parameters:
nowThe current time.

Definition at line 72 of file KX_TimeLogger.cpp.

References m_logging, m_logStart, and m_measurements.

Referenced by NextMeasurement().

double KX_TimeLogger::GetAverage ( void  ) const [virtual]

Returns average of all but the current measurement.

Returns:
The average of all but the current measurement.

Definition at line 103 of file KX_TimeLogger.cpp.

References avg, i, and m_measurements.

unsigned int KX_TimeLogger::GetMaxNumMeasurements ( void  ) const [virtual]

Changes the maximum number of measurements that can be stored.

Definition at line 57 of file KX_TimeLogger.cpp.

References m_maxNumMeasurements.

void KX_TimeLogger::NextMeasurement ( double  now) [virtual]

Logs time in next measurement.

Parameters:
nowThe current time.

Definition at line 84 of file KX_TimeLogger.cpp.

References EndLog(), m_maxNumMeasurements, and m_measurements.

void KX_TimeLogger::SetMaxNumMeasurements ( unsigned int  maxNumMeasurements) [virtual]

Changes the maximum number of measurements that can be stored.

Definition at line 48 of file KX_TimeLogger.cpp.

References m_maxNumMeasurements.

void KX_TimeLogger::StartLog ( double  now) [virtual]

Starts logging in current measurement.

Parameters:
nowThe current time.

Definition at line 63 of file KX_TimeLogger.cpp.

References m_logging, and m_logStart.


Member Data Documentation

bool KX_TimeLogger::m_logging [protected]

State of logging.

Definition at line 106 of file KX_TimeLogger.h.

Referenced by EndLog(), and StartLog().

double KX_TimeLogger::m_logStart [protected]

Time at start of logging.

Definition at line 103 of file KX_TimeLogger.h.

Referenced by EndLog(), and StartLog().

unsigned int KX_TimeLogger::m_maxNumMeasurements [protected]

Maximum number of measurements.

Definition at line 100 of file KX_TimeLogger.h.

Referenced by GetMaxNumMeasurements(), NextMeasurement(), and SetMaxNumMeasurements().

std::deque<double> KX_TimeLogger::m_measurements [protected]

Storage for the measurements.

Definition at line 97 of file KX_TimeLogger.h.

Referenced by EndLog(), GetAverage(), and NextMeasurement().


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