You.i Engine
CYIProfiler Class Reference

Detailed Description

CYIProfiler

A container class for profiling data.

This class provides access to profiling data for multiple CYIProfileData.

Note
CYIProfiler is not thread-safe by default. Construct with bThreadSafe set to true to obtain thread safety for StartProfile and StopProfile which uses a CYISpinLock.
Warning
Although constructing with bThreadSafe set to true does provide thread safety for StartProfile and StopProfile it does not provide safety for the rest of the class.

#include <utility/YiProfiler.h>

Public Types

enum  REPORT_FORMAT {
  PLAIN_TEXT,
  XML
}
 

Public Member Functions

 CYIProfiler (bool bThreadSafe=false, uint32_t uMaxProfiles=20)
 
 ~CYIProfiler ()
 
void ResetProfiles (void)
 
void StartProfile (uint32_t uIndex)
 
void StopProfile (uint32_t uIndex)
 
bool AddProfile (uint32_t uIndex, const CYIString &rName)
 
CYIProfileDataGetProfileData (uint32_t uIndex) const
 
void SetMaximumProfiles (uint32_t uMaxProfiles)
 
uint32_t GetMaximumProfiles () const
 
CYIString Report (REPORT_FORMAT eFormat=PLAIN_TEXT, CYIProfileData::ACCURACY eAccuracy=CYIProfileData::MILLISECONDS) const
 
CYIString Report (const std::vector< uint32_t > uIndexes, REPORT_FORMAT eFormat=PLAIN_TEXT, CYIProfileData::ACCURACY eAccuracy=CYIProfileData::MILLISECONDS) const
 

Member Enumeration Documentation

Report formats used for retrieving profile reports.

Enumerator
PLAIN_TEXT 
XML 

Constructor & Destructor Documentation

CYIProfiler::CYIProfiler ( bool  bThreadSafe = false,
uint32_t  uMaxProfiles = 20 
)

Constructs a CYIProfiler that is bThreadSafe capable of handling uMaxProfiles CYIProfileData items.

CYIProfiler::~CYIProfiler ( )

Member Function Documentation

bool CYIProfiler::AddProfile ( uint32_t  uIndex,
const CYIString rName 
)

Add a CYIProfileData item at uIndex with rName.

Note
uIndex is zero based.
uint32_t CYIProfiler::GetMaximumProfiles ( ) const

Returns the maximum number of CYIProfileData items supported by the CYIProfiler.

CYIProfileData* CYIProfiler::GetProfileData ( uint32_t  uIndex) const

Returns a pointer to the CYIProfileData item at uIndex.

Note
uIndex is zero based.
CYIString CYIProfiler::Report ( REPORT_FORMAT  eFormat = PLAIN_TEXT,
CYIProfileData::ACCURACY  eAccuracy = CYIProfileData::MILLISECONDS 
) const

Get a report from all CYIProfileData objects, optionally in XML format.

CYIString CYIProfiler::Report ( const std::vector< uint32_t >  uIndexes,
REPORT_FORMAT  eFormat = PLAIN_TEXT,
CYIProfileData::ACCURACY  eAccuracy = CYIProfileData::MILLISECONDS 
) const

Get a report from the CYIProfileData at indicies specified in uIndexes, optionally in XML format.

void CYIProfiler::ResetProfiles ( void  )

Resets all CYIProfileData counters to 0.

void CYIProfiler::SetMaximumProfiles ( uint32_t  uMaxProfiles)

Sets the maximum number of CYIProfileData items supported by the CYIProfiler.

void CYIProfiler::StartProfile ( uint32_t  uIndex)

Start profiling for the CYIProfileData item at uIndex.

Note
uIndex is zero based.
void CYIProfiler::StopProfile ( uint32_t  uIndex)

Stop profiling for the CYIProfileData item at uIndex.

Note
uIndex is zero based.

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