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

KX_TimeCategoryLogger Class Reference

#include <KX_TimeCategoryLogger.h>

List of all members.

Public Types

typedef int TimeCategory

Public Member Functions

 KX_TimeCategoryLogger (unsigned int maxNumMeasurements=10)
virtual ~KX_TimeCategoryLogger (void)
virtual void SetMaxNumMeasurements (unsigned int maxNumMeasurements)
virtual unsigned int GetMaxNumMeasurements (void) const
virtual void AddCategory (TimeCategory tc)
virtual void StartLog (TimeCategory tc, double now, bool endOtherCategories=true)
virtual void EndLog (TimeCategory tc, double now)
virtual void EndLog (double now)
virtual void NextMeasurement (double now)
virtual double GetAverage (TimeCategory tc)
virtual double GetAverage (void)

Protected Types

typedef std::map< TimeCategory,
KX_TimeLogger * > 
KX_TimeLoggerMap

Protected Member Functions

virtual void DisposeLoggers (void)

Protected Attributes

KX_TimeLoggerMap m_loggers
unsigned int m_maxNumMeasurements

Detailed Description

Stores and manages time measurements by category. Categories can be added dynamically. Average measurements can be established for each separate category or for all categories together.

Definition at line 49 of file KX_TimeCategoryLogger.h.


Member Typedef Documentation

Storage for the loggers.

Definition at line 125 of file KX_TimeCategoryLogger.h.

Definition at line 51 of file KX_TimeCategoryLogger.h.


Constructor & Destructor Documentation

KX_TimeCategoryLogger::KX_TimeCategoryLogger ( unsigned int  maxNumMeasurements = 10)

Constructor.

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

Definition at line 35 of file KX_TimeCategoryLogger.cpp.

KX_TimeCategoryLogger::~KX_TimeCategoryLogger ( void  ) [virtual]

Destructor.

Definition at line 41 of file KX_TimeCategoryLogger.cpp.

References DisposeLoggers().


Member Function Documentation

void KX_TimeCategoryLogger::AddCategory ( TimeCategory  tc) [virtual]

Adds a category.

Parameters:
categoryThe new category.

Definition at line 63 of file KX_TimeCategoryLogger.cpp.

References m_loggers, and m_maxNumMeasurements.

Referenced by KX_KetsjiEngine::KX_KetsjiEngine().

void KX_TimeCategoryLogger::DisposeLoggers ( void  ) [protected, virtual]

Disposes loggers.

Definition at line 134 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

Referenced by ~KX_TimeCategoryLogger().

void KX_TimeCategoryLogger::EndLog ( TimeCategory  tc,
double  now 
) [virtual]

End logging in current measurement for the given category.

Parameters:
tcThe category to log to.
nowThe current time.

Definition at line 89 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

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

End logging in current measurement for all categories.

Parameters:
nowThe current time.

Definition at line 96 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

double KX_TimeCategoryLogger::GetAverage ( void  ) [virtual]

Returns average for grand total.

Definition at line 121 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

double KX_TimeCategoryLogger::GetAverage ( TimeCategory  tc) [virtual]

Returns average of all but the current measurement time.

Returns:
The average of all but the current measurement.

Definition at line 114 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

Referenced by KX_KetsjiEngine::EndFrame().

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

Changes the maximum number of measurements that can be stored.

Definition at line 57 of file KX_TimeCategoryLogger.cpp.

References m_maxNumMeasurements.

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

Logs time in next measurement.

Parameters:
nowThe current time.

Definition at line 105 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

Referenced by KX_KetsjiEngine::EndFrame().

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

Changes the maximum number of measurements that can be stored.

Definition at line 47 of file KX_TimeCategoryLogger.cpp.

References m_loggers, and m_maxNumMeasurements.

void KX_TimeCategoryLogger::StartLog ( TimeCategory  tc,
double  now,
bool  endOtherCategories = true 
) [virtual]

Starts logging in current measurement for the given category.

Parameters:
tcThe category to log to.
nowThe current time.
endOtherCategoriesWhether to stop logging to other categories.

Definition at line 74 of file KX_TimeCategoryLogger.cpp.

References m_loggers.

Referenced by KX_KetsjiEngine::EndFrame(), KX_KetsjiEngine::NextFrame(), KX_KetsjiEngine::Render(), and KX_KetsjiEngine::RenderDome().


Member Data Documentation

Maximum number of measurements.

Definition at line 128 of file KX_TimeCategoryLogger.h.

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


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