vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::BenchmarkWriter Class Reference

Class to write any timings and other benchmark data into file. More...

#include <BenchmarkWriter.h>

Public Member Functions

 BenchmarkWriter ()
 
 ~BenchmarkWriter ()
 
void setWriting (bool bValue)
 
bool writingAllowed ()
 
bool openFile (const char *pFileName=NULL)
 
bool isOpened ()
 
bool writeInfoStart ()
 
bool writeInfoLine (const char *pText,...)
 
bool writeInfoEnd ()
 
bool writeSettingsStart ()
 
bool writeParam (const char *pName, const char *pValue)
 
bool writeParam (const char *pName, float fValue)
 
bool writeSettingsEnd ()
 
bool writeDataStart ()
 
bool writeFrameStart (unsigned int dwTime)
 
bool writeCounter (const char *pName, float fValue)
 
bool writeFrameEnd ()
 
bool writeMiscStatsStart ()
 
bool writeRunTime (unsigned int dwTime)
 
bool writeFramesRendered (unsigned int dwNum)
 
bool writeMiscStatsEnd ()
 
bool writeDataEnd ()
 
bool closeFile ()
 

Protected Attributes

FILE * file
 
bool bWriting
 
bool bOpenMain
 
bool bOpenInfo
 
bool bOpenSettings
 
bool bOpenData
 
bool bOpenFrame
 
bool bOpenMiscStats
 

Detailed Description

Class to write any timings and other benchmark data into file.

Very suitable for writing data that come every second or even much faster (Phantom-ready :) ). For example, you can output every frame your time to calculate visibility, process the messages, number of visible objects etc.

All these data will be written to an XML file in the "log" directory. These files are easily viewable in our BenchmarkStats application (proprietary, should come with Vrecko).

This class is usually not used directly, but through a simple interface in the Logger class.

Author
Vit Kovalcik
Date
2009

Constructor & Destructor Documentation

vrecko::BenchmarkWriter::BenchmarkWriter ( )
vrecko::BenchmarkWriter::~BenchmarkWriter ( )

Member Function Documentation

bool vrecko::BenchmarkWriter::closeFile ( )
bool vrecko::BenchmarkWriter::isOpened ( )
inline
bool vrecko::BenchmarkWriter::openFile ( const char *  pFileName = NULL)

The [FileName] can be NULL, in which case unique filename will be automatically generated.

void vrecko::BenchmarkWriter::setWriting ( bool  bValue)

If [bValue] is false, then NO WRITING will be performed at all.

bool vrecko::BenchmarkWriter::writeCounter ( const char *  pName,
float  fValue 
)
Warning
The final line should be XML-save (no '<' characters etc.)
bool vrecko::BenchmarkWriter::writeDataEnd ( )
bool vrecko::BenchmarkWriter::writeDataStart ( )
bool vrecko::BenchmarkWriter::writeFrameEnd ( )
bool vrecko::BenchmarkWriter::writeFramesRendered ( unsigned int  dwNum)
bool vrecko::BenchmarkWriter::writeFrameStart ( unsigned int  dwTime)
bool vrecko::BenchmarkWriter::writeInfoEnd ( )
bool vrecko::BenchmarkWriter::writeInfoLine ( const char *  pText,
  ... 
)
Warning
The final line should be XML-save (no '<' characters etc.)
bool vrecko::BenchmarkWriter::writeInfoStart ( )
bool vrecko::BenchmarkWriter::writeMiscStatsEnd ( )
bool vrecko::BenchmarkWriter::writeMiscStatsStart ( )
bool vrecko::BenchmarkWriter::writeParam ( const char *  pName,
const char *  pValue 
)
Warning
The final line should be XML-save (no '<' characters etc.)
bool vrecko::BenchmarkWriter::writeParam ( const char *  pName,
float  fValue 
)
Warning
The final line should be XML-save (no '<' characters etc.)
bool vrecko::BenchmarkWriter::writeRunTime ( unsigned int  dwTime)
bool vrecko::BenchmarkWriter::writeSettingsEnd ( )
bool vrecko::BenchmarkWriter::writeSettingsStart ( )
bool vrecko::BenchmarkWriter::writingAllowed ( )
inline

Member Data Documentation

bool vrecko::BenchmarkWriter::bOpenData
protected
bool vrecko::BenchmarkWriter::bOpenFrame
protected
bool vrecko::BenchmarkWriter::bOpenInfo
protected
bool vrecko::BenchmarkWriter::bOpenMain
protected
bool vrecko::BenchmarkWriter::bOpenMiscStats
protected
bool vrecko::BenchmarkWriter::bOpenSettings
protected
bool vrecko::BenchmarkWriter::bWriting
protected
FILE* vrecko::BenchmarkWriter::file
protected

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