/**
* Class Profiler written by Justin Klein,
2003
* This profiler provides the ability to track entries in the heap,
as well as
* to monitor the CPU-time used by specific parts of an
application.
* This latter feature works
by adding a "monitor" for each item (say, one for
* Collision Detection), starting/stopping the monitor whenever
collision-detection
* is occurring, and then printing out the monitors to show how
much time - and
* what percentage of time relative to the other monitors - has
monitor used.
**/
/**
*
Sets up the profiler. If this system
does not support a high-resolution
* performance counter,
false is returned and the profiler will be unusable.
**/
bool Init();
/**
*
Resets all of the profiler's counters.
**/
void Reset();
/**
*
MUST be called every time a new frame is rendered.
**/
void CountFrame();
/**
*
Adds a new monitor and returns it’s unique Identifier
**/
MONITOR_ID AddMonitor(char *name);
/**
*
Starts timing a monitor
**/
void StartMonitor(MONITOR_ID
id);
/**
*
Stops timing a monitor.
**/
void StopMonitor(MONITOR_ID
id);
/**
*
Returns a string containing information about all of the
*
Monitors that are currently registered with this class;
* NOTE that the information will ONLY
be correct if ALL of the monitors have
* already been stopped.
**/
void PollCounters(char* str, int
strLen);
/**
* This
uses a callback function to print a string containing information
* about all of the
monitors that are currently registered with this class;
**/
void PrintCounters(void (*printFunc)(char
*));
/**
*
Returns the number of bytes currently allocated on the heap
**/
int CheckHeapBytes();
/**
* Returns the number of KiloBytes
currently allocated on the heap
**/
float CheckHeapKiloBytes();
/**
*
Returns a string containing information about the contents of the heap
**/
void PollHeap(char* str, int
strLen);
/**
* Prints information about ALL of the
heap's entries by calling the printFunc
**/
void PrintHeap(void (*printFunc)(char
*));