|
Yaets
|
Class to manage the trace of a single function execution. More...
#include <tracing.hpp>

Public Member Functions | |
| std::chrono::nanoseconds | get_start_time () const |
| Retrieve the start time of the trace. | |
| TraceGuard (TraceSession &session, const std::string &trace_name) | |
| Construct a new TraceGuard object. | |
| ~TraceGuard () | |
| Destroy the TraceGuard object. | |
Protected Member Functions | |
| std::string | extract_trace_name (const std::string &function_signature) |
| Extract the function name from the full function signature. | |
Class to manage the trace of a single function execution.
A TraceGuard object is created at the start of a function and destroyed when the function exits, automatically registering the start and end times of the function execution to the associated TraceSession.
| TraceGuard | ( | TraceSession & | session, |
| const std::string & | trace_name ) |
Construct a new TraceGuard object.
This constructor captures the function name and the start time of the function.
| session | The TraceSession to register the trace event with. |
| trace_name | The name of the function being traced. |
| ~TraceGuard | ( | ) |
Destroy the TraceGuard object.
The destructor automatically registers the end time of the function and submits the trace event to the TraceSession.
|
protected |
Extract the function name from the full function signature.
This function processes the function signature to extract only the relevant function name without parameters.
| function_signature | The full function signature. |
| std::chrono::nanoseconds get_start_time | ( | ) | const |
Retrieve the start time of the trace.
This getter provides read-only access to the start time recorded by the TraceGuard at the beginning of a traced function execution.
std::chrono::nanoseconds duration.