Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::PProfileScope Class Reference

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

#include <duckcpp/core/engine/IProfiler.hpp>

Collaboration diagram for dcpp::PProfileScope:
Collaboration graph

Public Member Functions

 PProfileScope (dcpp::int32_kt id)
 Construct with an known id.
 
 PProfileScope (dcpp::int32_kt id, const dcpp::nub::wstring &name, const dcpp::nub::wstring &groupName)
 Object will create the given name, groupName combination for the id if it doesn't exist already.
 
 PProfileScope (const dcpp::nub::wstring &name, const dcpp::nub::wstring &groupName)
 Object will create an id for the given name, groupName combination if they don't exist already.
 

Protected Attributes

dcpp::int32_kt 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.

Constructor & Destructor Documentation

◆ PProfileScope() [1/3]

dcpp::PProfileScope::PProfileScope ( dcpp::int32_kt  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.

◆ PProfileScope() [2/3]

dcpp::PProfileScope::PProfileScope ( dcpp::int32_kt  id,
const dcpp::nub::wstring name,
const dcpp::nub::wstring 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 Duckcpp. 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.

◆ PProfileScope() [3/3]

dcpp::PProfileScope::PProfileScope ( const dcpp::nub::wstring name,
const dcpp::nub::wstring 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.

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

Duckcpp    @cppfx.xyz