arsa  2.7
Public Member Functions | Protected Attributes | List of all members
irr::CProfileScope Class Reference

Class where the objects profile their own life-time. More...

#include <IProfiler.h>

Public Member Functions

 CProfileScope (s32 id)
 Construct with an known id. More...
 
 CProfileScope (s32 id, const core::stringw &name, const core::stringw &groupName)
 Object will create the given name, groupName combination for the id if it doesn't exist already. More...
 
 CProfileScope (const core::stringw &name, const core::stringw &groupName)
 Object will create an id for the given name, groupName combination if they don't exist already. More...
 
 ~CProfileScope ()
 

Protected Attributes

s32 Id
 
IProfilerProfiler
 

Detailed Description

Class where the objects profile their own life-time.

This is a comfort wrapper around the IProfiler start/stop mechanism which is easier to use when you want to profile a scope. You only have to create an object and it will profile it's own lifetime for the given id.

Definition at line 233 of file IProfiler.h.

Constructor & Destructor Documentation

◆ CProfileScope() [1/3]

irr::CProfileScope::CProfileScope ( s32  id)
inline

Construct with an known id.

This is the fastest scope constructor, but the id must have been added before.

Parameters
idAny id which you did add to the profiler before.

Definition at line 239 of file IProfiler.h.

240  : Id(id), Profiler(getProfiler())
241  {
242  Profiler.start(Id);
243  }
IRRLICHT_API IProfiler &IRRCALLCONV getProfiler()
Access the Irrlicht profiler object.
IProfiler & Profiler
Definition: IProfiler.h:275
void start(s32 id)
Start profile-timing for the given id.
Definition: IProfiler.h:281

◆ CProfileScope() [2/3]

irr::CProfileScope::CProfileScope ( s32  id,
const core::stringw name,
const core::stringw groupName 
)
inline

Object will create the given name, groupName combination for the id if it doesn't exist already.

Parameters
idShould be >= 0 as negative id's are reserved for Irrlicht. Also very large numbers (near INT_MAX) might have been created already by the automatic add function of ::IProfiler.
nameName for displaying profile data.
groupNameEach id belongs into a group - this helps on displaying profile data.

Definition at line 250 of file IProfiler.h.

251  : Id(id), Profiler(getProfiler())
252  {
253  Profiler.add(Id, name, groupName);
254  Profiler.start(Id);
255  }
GLuint const GLchar * name
IRRLICHT_API IProfiler &IRRCALLCONV getProfiler()
Access the Irrlicht profiler object.
IProfiler & Profiler
Definition: IProfiler.h:275
void add(s32 id, const core::stringw &name, const core::stringw &groupName)
Add an id with given name and group which can be used for profiling with start/stop.
Definition: IProfiler.h:346
void start(s32 id)
Start profile-timing for the given id.
Definition: IProfiler.h:281

◆ CProfileScope() [3/3]

irr::CProfileScope::CProfileScope ( const core::stringw name,
const core::stringw groupName 
)
inline

Object will create an id for the given name, groupName combination if they don't exist already.

Slowest scope constructor, but usually still fine unless speed is very critical.

Parameters
nameName for displaying profile data.
groupNameEach id belongs into a group - this helps on displaying profile data.

Definition at line 261 of file IProfiler.h.

262  : Profiler(getProfiler())
263  {
264  Id = Profiler.add(name, groupName);
265  Profiler.start(Id);
266  }
GLuint const GLchar * name
IRRLICHT_API IProfiler &IRRCALLCONV getProfiler()
Access the Irrlicht profiler object.
IProfiler & Profiler
Definition: IProfiler.h:275
void add(s32 id, const core::stringw &name, const core::stringw &groupName)
Add an id with given name and group which can be used for profiling with start/stop.
Definition: IProfiler.h:346
void start(s32 id)
Start profile-timing for the given id.
Definition: IProfiler.h:281

◆ ~CProfileScope()

irr::CProfileScope::~CProfileScope ( )
inline

Definition at line 268 of file IProfiler.h.

269  {
270  Profiler.stop(Id);
271  }
IProfiler & Profiler
Definition: IProfiler.h:275
void stop(s32 id)
Stop profile-timing for the given id.
Definition: IProfiler.h:292

Member Data Documentation

◆ Id

s32 irr::CProfileScope::Id
protected

Definition at line 274 of file IProfiler.h.

◆ Profiler

IProfiler& irr::CProfileScope::Profiler
protected

Definition at line 275 of file IProfiler.h.


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