Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
ProfileHighLevel Class Reference

The high level profiler. More...

#include <profile_highlevel.h>

Classes

class  Block
 Timer based function block profile. More...
 
class  Id
 A high level profile ID. More...
 

Static Public Member Functions

static Id AddProfile (const char *name, const char *descr, const char *unit, int precision, int exp10=0)
 Registers a new high level profile value.
 
static bool EnumProfile (unsigned index, Id &id)
 Enumerates the list of known high level profile values.
 
static bool FindProfile (const char *name, Id &id)
 Searches for the given high level profile.
 

Friends

class Profile
 

Detailed Description

The high level profiler.

Definition at line 41 of file profile_highlevel.h.

Member Function Documentation

◆ AddProfile()

ProfileHighLevel::Id ProfileHighLevel::AddProfile ( const char * name,
const char * descr,
const char * unit,
int precision,
int exp10 = 0 )
static

Registers a new high level profile value.

If there is already a high level profile with the given name the Id of that profile is returned instead.

High level profiles can only be added, never removed.

Note
Important: This function can (and should) be used in static initializers!
This function may be slow so don't use it too often.
Parameters
namevalue name, e.g. "render.texture.count.512x512"
descrdescriptive name, e.g. "# of 512x512 textures"
unitunit name, e.g. "byte" or "sec"
precisionnumber of decimal places to show
exp1010 base exponent (used for scaleing)
Returns
internal profile ID value

Definition at line 295 of file profile_highlevel.cpp.

◆ EnumProfile()

bool ProfileHighLevel::EnumProfile ( unsigned index,
Id & id )
static

Enumerates the list of known high level profile values.

Note
Profiles are always sorted ascending by profile name.
Parameters
indexindex value, >=0
idreturn buffer for ID value
Returns
true if ID found at given index, false if not

Definition at line 311 of file profile_highlevel.cpp.

◆ FindProfile()

bool ProfileHighLevel::FindProfile ( const char * name,
Id & id )
static

Searches for the given high level profile.

Note
Actually the ID returned belongs to the first profile which has a name that is equal to or larger than the name searched for.
Parameters
nameprofile name to search for
idreturn buffer for ID value
Returns
true if ID found, false if not

Definition at line 319 of file profile_highlevel.cpp.

Friends And Related Symbol Documentation

◆ Profile

friend class Profile
friend

Definition at line 43 of file profile_highlevel.h.


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