#include <GenericEventHandler.hpp>
Static Public Member Functions | |
static void | Reset () |
static void | BeginEvent (unsigned event) throw (Exception) |
static void | EndEvent (unsigned event) |
static double | GetElapsedTime (unsigned event) |
static void | Report () |
static void | Headings () |
static void | Enable () |
static void | Disable () |
static bool | IsEnabled () |
Static Private Member Functions | |
static double | GetCpuTime () |
static double | ConvertTicksToMilliseconds (double clockTicks) |
static double | ConvertTicksToSeconds (double clockTicks) |
static void | CheckVectorSizes () |
Static Private Attributes | |
static std::vector< double > | mCpuTime |
static std::vector< bool > | mHasBegun |
static bool | mEnabled = true |
static bool | mInitialised = false |
Note: this class assume that, for any given concrete class, the last event represents the total time, and thus wraps all other events.
Definition at line 48 of file GenericEventHandler.hpp.
static double GenericEventHandler< NUM_EVENTS, CONCRETE >::GetCpuTime | ( | ) | [inline, static, private] |
Helper function - get the current CPU clock tick count
Definition at line 57 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent(), GenericEventHandler< 9, CancerEventHandler >::EndEvent(), and GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime().
static double GenericEventHandler< NUM_EVENTS, CONCRETE >::ConvertTicksToMilliseconds | ( | double | clockTicks | ) | [inline, static, private] |
Convert a CPU clock tick count to milliseconds.
clockTicks |
Definition at line 67 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime().
static double GenericEventHandler< NUM_EVENTS, CONCRETE >::ConvertTicksToSeconds | ( | double | clockTicks | ) | [inline, static, private] |
Convert a CPU clock tick count to seconds.
clockTicks |
Definition at line 77 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::Report().
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::CheckVectorSizes | ( | ) | [inline, static, private] |
Make sure the vectors are the right length
Definition at line 83 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent(), GenericEventHandler< 9, CancerEventHandler >::Disable(), GenericEventHandler< 9, CancerEventHandler >::Enable(), GenericEventHandler< 9, CancerEventHandler >::EndEvent(), GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime(), GenericEventHandler< 9, CancerEventHandler >::Headings(), GenericEventHandler< 9, CancerEventHandler >::Report(), and GenericEventHandler< 9, CancerEventHandler >::Reset().
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::Reset | ( | ) | [inline, static] |
Reset the event handler - set all event durations to zero.
Definition at line 98 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::Report().
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::BeginEvent | ( | unsigned | event | ) | throw (Exception) [inline, static] |
Record the start of an event.
event |
Definition at line 114 of file GenericEventHandler.hpp.
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::EndEvent | ( | unsigned | event | ) | [inline, static] |
Record the ending of an event.
event |
Definition at line 142 of file GenericEventHandler.hpp.
static double GenericEventHandler< NUM_EVENTS, CONCRETE >::GetElapsedTime | ( | unsigned | event | ) | [inline, static] |
Get the time (in milliseconds) accounted so far to the given event.
Will automatically determine if the event is currently ongoing or not.
event |
Definition at line 170 of file GenericEventHandler.hpp.
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::Report | ( | ) | [inline, static] |
Print a report on the timed events and reset the handler.
Assumes all events have ended.
If there is a collection of processes then the report will include an average and maximum over all CPUs.
Definition at line 198 of file GenericEventHandler.hpp.
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::Headings | ( | ) | [inline, static] |
Output the headings for a report.
Definition at line 275 of file GenericEventHandler.hpp.
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::Enable | ( | ) | [inline, static] |
Enable the event handler so that it will record event durations.
Definition at line 301 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::Reset().
static void GenericEventHandler< NUM_EVENTS, CONCRETE >::Disable | ( | ) | [inline, static] |
Disable the event handler, so that event durations are no longer recorded.
Definition at line 308 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent().
static bool GenericEventHandler< NUM_EVENTS, CONCRETE >::IsEnabled | ( | ) | [inline, static] |
Check whether the event handler is enabled.
Definition at line 315 of file GenericEventHandler.hpp.
std::vector< double > GenericEventHandler< NUM_EVENTS, CONCRETE >::mCpuTime [inline, static, private] |
CPU ticks assigned to each event
Definition at line 51 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent(), GenericEventHandler< 9, CancerEventHandler >::CheckVectorSizes(), GenericEventHandler< 9, CancerEventHandler >::EndEvent(), GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime(), GenericEventHandler< 9, CancerEventHandler >::Report(), and GenericEventHandler< 9, CancerEventHandler >::Reset().
std::vector< bool > GenericEventHandler< NUM_EVENTS, CONCRETE >::mHasBegun [inline, static, private] |
Whether each event is in progress
Definition at line 52 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent(), GenericEventHandler< 9, CancerEventHandler >::CheckVectorSizes(), GenericEventHandler< 9, CancerEventHandler >::EndEvent(), GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime(), and GenericEventHandler< 9, CancerEventHandler >::Reset().
bool GenericEventHandler< NUM_EVENTS, CONCRETE >::mEnabled = true [inline, static, private] |
Whether the event handler is recording event times
Definition at line 53 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::BeginEvent(), GenericEventHandler< 9, CancerEventHandler >::Disable(), GenericEventHandler< 9, CancerEventHandler >::Enable(), GenericEventHandler< 9, CancerEventHandler >::EndEvent(), GenericEventHandler< 9, CancerEventHandler >::GetElapsedTime(), GenericEventHandler< 9, CancerEventHandler >::IsEnabled(), and GenericEventHandler< 9, CancerEventHandler >::Report().
bool GenericEventHandler< NUM_EVENTS, CONCRETE >::mInitialised = false [inline, static, private] |
For internal use
Definition at line 54 of file GenericEventHandler.hpp.
Referenced by GenericEventHandler< 9, CancerEventHandler >::CheckVectorSizes().