kanzi::FunctionProfilerScope Class Reference

The class FunctionProfilerScope is used to provide a convenient RAII-style mechanism to manage a function profiler for the duration of a scoped block. More...

#include <kanzi/core/profiling/function_profiler_source.hpp>

Public Member Functions

 FunctionProfilerScope (FunctionProfilerSource &functionProfiler, string_view description)
 Constructor. More...
 
 FunctionProfilerScope (FunctionProfilerSource &functionProfiler, FixedString description)
 Constructor. More...
 
 ~FunctionProfilerScope ()
 

Detailed Description

The class FunctionProfilerScope is used to provide a convenient RAII-style mechanism to manage a function profiler for the duration of a scoped block.

When a FunctionProfilerScope object is created, it calls FunctionProfilerSource.enter to indicate that the function execution starts. When control leaves the scope in which the FunctionProfilerScope object was created, it calls FunctionProfilerSource.leave to indicate that the function execution is finished.

Constructor & Destructor Documentation

kanzi::FunctionProfilerScope::FunctionProfilerScope ( FunctionProfilerSource functionProfiler,
string_view  description 
)
explicit

Constructor.

Parameters
functionProfilerFunction profiler that is managed in the scope of this object.
descriptionAdditional Function call description, such as arguments.
kanzi::FunctionProfilerScope::FunctionProfilerScope ( FunctionProfilerSource functionProfiler,
FixedString  description 
)
explicit

Constructor.

Parameters
functionProfilerFunction profiler that is managed in the scope of this object.
descriptionAdditional Function call description, such as arguments.
kanzi::FunctionProfilerScope::~FunctionProfilerScope ( )

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