|
WSF
|
Scope guard that marks a region of code for profiling. More...
#include <ProfilingRegion.hpp>
Public Member Functions | |
| ProfilingRegion (const char aRegionLabel[]) | |
| Begin a profiling region. | |
| ~ProfilingRegion () | |
| End the current profiling region. | |
| ProfilingRegion ()=delete | |
| ProfilingRegion (const ProfilingRegion &)=delete | |
| ProfilingRegion & | operator= (const ProfilingRegion &)=delete |
| ProfilingRegion (ProfilingRegion &&)=delete | |
| ProfilingRegion & | operator= (ProfilingRegion &&)=delete |
Scope guard that marks a region of code for profiling.
This class' constructor begins the profiling region. Its destructor ends the profiling region.
Profiling regions must be nested. This implies that ProfilingRegion instances should never be handled by pointer or passed as arguments to functions.
Always name the variable representing the ProfilingRegion instance. Don't just invoke the constructor without giving the variable a name. If you forget to name the variable, then the region will close right away, since the unnamed temporary object's destructor will be invoked at the end of the statement.
Exactly one ProfilingSystem instance must exist before constructing or destroying a ProfilingRegion instance. That is, the lifetime of any ProfilingRegion must fit within the lifetime of exactly one ProfilingSystem instance.
Here is an example of how to use this class in a function, assuming that the function is only ever called within the lifetime of a ProfilingSystem object.
This results in the following nested regions:
| profiling::ProfilingRegion::ProfilingRegion | ( | const char | aRegionLabel[] | ) |
Begin a profiling region.
| aRegionLabel | String label for the region |
References profiling::detail::GetGlobalProfilingHooks(), and profiling::ProfilingHooks::mBeginRegion.
Referenced by operator=(), operator=(), ProfilingRegion(), and ProfilingRegion().
| profiling::ProfilingRegion::~ProfilingRegion | ( | ) |
End the current profiling region.
References profiling::detail::GetGlobalProfilingHooks(), and profiling::ProfilingHooks::mEndRegion.
|
delete |
|
delete |
References ProfilingRegion().
|
delete |
References ProfilingRegion().
|
delete |
References ProfilingRegion().
|
delete |
References ProfilingRegion().