Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Protected Attributes
CProfileNode Class Reference

#include <btQuickprof.h>

Collaboration diagram for CProfileNode:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CProfileNode (const char *name, CProfileNode *parent)
 ~CProfileNode (void)
CProfileNodeGet_Sub_Node (const char *name)
CProfileNodeGet_Parent (void)
CProfileNodeGet_Sibling (void)
CProfileNodeGet_Child (void)
void Reset (void)
void Call (void)
bool Return (void)
const char * Get_Name (void)
int Get_Total_Calls (void)
float Get_Total_Time (void)

Protected Attributes

const char * Name
int TotalCalls
float TotalTime
unsigned long int StartTime
int RecursionCounter
CProfileNodeParent
CProfileNodeChild
CProfileNodeSibling

Detailed Description

Definition at line 238 of file btQuickprof.h.


Constructor & Destructor Documentation

CProfileNode::CProfileNode ( const char *  name,
CProfileNode parent 
)

Definition at line 51 of file btQuickprof.cpp.

                                                                     :
       Name( name ),
       TotalCalls( 0 ),
       TotalTime( 0 ),
       StartTime( 0 ),
       RecursionCounter( 0 ),
       Parent( parent ),
       Child( NULL ),
       Sibling( NULL )
{
       Reset();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 65 of file btQuickprof.cpp.

{
       delete Child;
       delete Sibling;
}

Member Function Documentation

void CProfileNode::Call ( void  )

Definition at line 114 of file btQuickprof.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

CProfileNode* CProfileNode::Get_Child ( void  ) [inline]

Definition at line 248 of file btQuickprof.h.

{ return Child; }

Here is the caller graph for this function:

const char* CProfileNode::Get_Name ( void  ) [inline]

Definition at line 254 of file btQuickprof.h.

{ return Name; }

Here is the caller graph for this function:

CProfileNode* CProfileNode::Get_Parent ( void  ) [inline]

Definition at line 246 of file btQuickprof.h.

{ return Parent; }

Here is the caller graph for this function:

Definition at line 247 of file btQuickprof.h.

{ return Sibling; }

Here is the caller graph for this function:

CProfileNode * CProfileNode::Get_Sub_Node ( const char *  name)

Definition at line 80 of file btQuickprof.cpp.

{
       // Try to find this sub node
       CProfileNode * child = Child;
       while ( child ) {
              if ( child->Name == name ) {
                     return child;
              }
              child = child->Sibling;
       }

       // We didn't find it, so add it
       CProfileNode * node = new CProfileNode( name, this );
       node->Sibling = Child;
       Child = node;
       return node;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CProfileNode::Get_Total_Calls ( void  ) [inline]

Definition at line 255 of file btQuickprof.h.

{ return TotalCalls; }

Here is the caller graph for this function:

float CProfileNode::Get_Total_Time ( void  ) [inline]

Definition at line 256 of file btQuickprof.h.

{ return TotalTime; }

Here is the caller graph for this function:

void CProfileNode::Reset ( void  )

Definition at line 99 of file btQuickprof.cpp.

{
       TotalCalls = 0;
       TotalTime = 0.0f;
       gProfileClock.reset();

       if ( Child ) {
              Child->Reset();
       }
       if ( Sibling ) {
              Sibling->Reset();
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool CProfileNode::Return ( void  )

Definition at line 123 of file btQuickprof.cpp.

{
       if ( --RecursionCounter == 0 && TotalCalls != 0 ) { 
              unsigned long int time;
              Profile_Get_Ticks(&time);
              time-=StartTime;
              TotalTime += (float)time / Profile_Get_Tick_Rate();
       }
       return ( RecursionCounter == 0 );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 267 of file btQuickprof.h.

const char* CProfileNode::Name [protected]

Definition at line 260 of file btQuickprof.h.

Definition at line 266 of file btQuickprof.h.

Definition at line 264 of file btQuickprof.h.

Definition at line 268 of file btQuickprof.h.

unsigned long int CProfileNode::StartTime [protected]

Definition at line 263 of file btQuickprof.h.

int CProfileNode::TotalCalls [protected]

Definition at line 261 of file btQuickprof.h.

float CProfileNode::TotalTime [protected]

Definition at line 262 of file btQuickprof.h.


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