/** \file IProfilerOutputHandler.h
* Declares the IProfilerOutputHandler interface
*
* @author Vovansim (aka Scorpion)
* @version Version 1.0
* @date September 14, 2003
*/
#ifndef PROJECT_AXIS_PROFILE_OUTPUT_HANDLER
#define PROJECT_AXIS_PROFILE_OUTPUT_HANDLER
#include
/**
* The IProfilerOutputHandler interface is here to make the output
* system of a profiler more flexible. One can implement the output
* handler however they want, and use it with the profiler to obtain
* any kind of results. The possibilities of the output handler
* include: printing to a plain text file, printing to console,
* generating an XML file, or even outputting the results graphically
* to screen. The structure of the interface doesn't really limit the
* choices the programmer has, and at the same time insulates the
* profiler from the final output method making it much more flexible.
*/
class IProfilerOutputHandler {
public:
/** This method will be called by the profiler just before
* sending in any of the sample data. It allows the output
* handler to prepare for output: open files, write headers,
* or whatever else needs to be done. */
virtual void BeginOutput(float totalTime) = 0;
/** This method will be called once for each sample and is
* provided all of the information about the current sample
* being processed.
*
* @param minimum - The minimum percentage of an iteration of the game loop the current sample ever took.
* @param average - The average percentage of an iteration of the game loop the current sample ever took.
* @param maximum - The maximum percentage of an iteration of the game loop the current sample ever took.
* @param averageTime - The average time the profiled code to execute in one game loop
* @param callCount - The number of times the profiled code was called
* @param name - The name of the sample
* @param parentCount - The number of samples between this sample and the parent sample
*/
virtual void Sample(float minimum, float average, float maximum, float averageTime, int callCount, std::string name, int parentCount) = 0;
/** This method will be called by the profiler when all of the
* samples have been processed. It will allow the handler to
* write footers, close file streams and perform whatever
* other clean-up operations that need to be done. */
virtual void EndOutput() = 0;
};
#endif//PROJECT_AXIS_PROFILE_OUTPUT_HANDLER