Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

ProfileManager Class Reference

#include <profile.h>

Inheritance diagram for ProfileManager:

Inheritance graph
[legend]
Collaboration diagram for ProfileManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manager for profile data The profile manager keeps track of all profiling blocks, the current block and the total execution time. It can be activated and rendered onscreen from the console with the "<b>showprofile</b>" command, all profile block data can be reset to zero with the "<b>resetprofile</b>" command, and all data cleared with the "<b>clearprofile</b>" command. To start a profiling block you use the BEGIN_PROFILE( name ) macro, and to end the block you use the END_PROFILE() macro. You must match all begin calls with end calls. It is (naturally) not possible to overlap blocks, since the END_PROFILE macro closes the latest activated block. If the _PROFILE preprocessor symbol is not defined, the BEGIN/END macros resolve to a nothing, making it easy to turn on/off profiling at build time.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 ProfileManager ()
virtual ~ProfileManager ()
virtual void BeginProfile (const HashString &rstrName)
virtual void EndProfile ()
virtual void Dump ()
virtual void DumpToString (std::string *pstrDst)
virtual void Clear ()
virtual void ConsoleCmd (const HashString &rstrCmd, const HashString &rstrArgs)
virtual bool Render (Frustum *pkFrustum=0, bool bForce=false)
virtual void Reset ()
bool IsActive () const
virtual void Activate ()
virtual void Deactivate ()
bool Toggle ()
bool IsActive () const
bool Toggle ()

Public Attributes

HashString m_strName
ProfileDatam_pkParent
std::vector< ProfileData * > m_vpkChildren
uint64_t m_ulActivated
uint64_t m_ulAccTime
int m_iCount
int m_iLevel
unsigned int m_uiLastFrame

Static Public Attributes

unsigned int s_uiFrameCount

Protected Attributes

ProfileDatam_pkActiveNode
bool m_bActive
bool m_bActive


Constructor & Destructor Documentation

ProfileManager  ) 
 

virtual ~ProfileManager  )  [virtual]
 


Member Function Documentation

virtual void BeginProfile const HashString rstrName  )  [virtual]
 

Begin a new profile level

Parameters:
rstrName Level name

virtual void EndProfile  )  [virtual]
 

End last profile level

virtual void Dump  )  [virtual]
 

Dump data to log (INFO)

Reimplemented from ProfileData.

virtual void DumpToString std::string *  pstrDst  )  [virtual]
 

Dump data to string

Parameters:
pstrDst Pointer to string receiving data

Reimplemented from ProfileData.

virtual void Clear  )  [virtual]
 

 Clear all profile data

virtual void ConsoleCmd const HashString rstrCmd,
const HashString rstrArgs
[virtual]
 

Process console command

Parameters:
rstrCmd Command
rstrArgs Argument string

Implements ConsoleCmdCallback.

virtual bool Render Frustum pkFrustum = 0,
bool  bForce = false
[virtual]
 

Render profile data overlay

Parameters:
pkFrustum Current view frustum (if any)
bForce Render even if rendered previously this frame or deactivated (default false)
Returns:
true if we were rendered, false if not (already rendered, not forced)

Reimplemented from RenderEntity.

virtual void Reset  )  [virtual, inherited]
 

Reset values

bool IsActive  )  const [inline, inherited]
 

Query state of object

Returns:
true if active, false if not

void Activate  )  [inline, virtual, inherited]
 

Activate object

void Deactivate  )  [inline, virtual, inherited]
 

Deactivate object

bool Toggle  )  [inline, inherited]
 

Toggle active state. This method does not need to be overloaded, it is only a wrapper to Activate and Deactivate

Returns:
true if activated, false if deactivated

bool IsActive  )  const [inline, inherited]
 

Query state of object

Returns:
true if active, false if not

bool Toggle  )  [inline, inherited]
 

Toggle active state. This method does not need to be overloaded, it is only a wrapper to Activate and Deactivate

Returns:
true if activated, false if deactivated


Member Data Documentation

ProfileData* m_pkActiveNode [protected]
 

Current active profile node

HashString m_strName [inherited]
 

Node name

ProfileData* m_pkParent [inherited]
 

Parent data node

std::vector< ProfileData* > m_vpkChildren [inherited]
 

Child data nodes

uint64_t m_ulActivated [inherited]
 

Activated heartbeat

uint64_t m_ulAccTime [inherited]
 

Accumulated heartbeat time

int m_iCount [inherited]
 

Counter

int m_iLevel [inherited]
 

Recursion level

unsigned int s_uiFrameCount [static, inherited]
 

Frame counter (at 500 frames per second, can be active ~100 days continously before loop, and then it will just skip one frame -> safe enough)

unsigned int m_uiLastFrame [inherited]
 

Last frame count we were rendered

bool m_bActive [protected, inherited]
 

Active flag

bool m_bActive [protected, inherited]
 

Active flag


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:13 2004 for NeoEngine by doxygen 1.3.5