Blender V2.61 - r43446
|
#include <KX_TimeCategoryLogger.h>
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 |
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.
typedef std::map<TimeCategory, KX_TimeLogger*> KX_TimeCategoryLogger::KX_TimeLoggerMap [protected] |
Storage for the loggers.
Definition at line 125 of file KX_TimeCategoryLogger.h.
typedef int KX_TimeCategoryLogger::TimeCategory |
Definition at line 51 of file KX_TimeCategoryLogger.h.
KX_TimeCategoryLogger::KX_TimeCategoryLogger | ( | unsigned int | maxNumMeasurements = 10 | ) |
Constructor.
maxNumMesasurements | Maximum number of measurements stored (> 1). |
Definition at line 35 of file KX_TimeCategoryLogger.cpp.
KX_TimeCategoryLogger::~KX_TimeCategoryLogger | ( | void | ) | [virtual] |
void KX_TimeCategoryLogger::AddCategory | ( | TimeCategory | tc | ) | [virtual] |
Adds a category.
category | The 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.
tc | The category to log to. |
now | The 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.
now | The 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.
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.
now | The 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.
tc | The category to log to. |
now | The current time. |
endOtherCategories | Whether 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().
KX_TimeLoggerMap KX_TimeCategoryLogger::m_loggers [protected] |
Definition at line 126 of file KX_TimeCategoryLogger.h.
Referenced by AddCategory(), DisposeLoggers(), EndLog(), GetAverage(), NextMeasurement(), SetMaxNumMeasurements(), and StartLog().
unsigned int KX_TimeCategoryLogger::m_maxNumMeasurements [protected] |
Maximum number of measurements.
Definition at line 128 of file KX_TimeCategoryLogger.h.
Referenced by AddCategory(), GetMaxNumMeasurements(), and SetMaxNumMeasurements().