Yaets
Loading...
Searching...
No Matches
TraceRegistry Class Reference

Singleton class to manage global NamedSharedTrace instances. More...

#include <tracing.hpp>

Public Member Functions

void endTrace (const std::string &id)
 End a trace identified by a unique ID.
 
void registerTrace (const std::string &id, TraceSession &session)
 Register a new NamedSharedTrace with a unique identifier.
 
void startTrace (const std::string &id)
 Start a trace identified by a unique ID.
 

Static Public Member Functions

static TraceRegistrygetInstance ()
 Retrieve the singleton instance of the TraceRegistry.
 

Detailed Description

Singleton class to manage global NamedSharedTrace instances.

The TraceRegistry maintains a collection of NamedSharedTrace instances, identified by unique IDs, allowing traces to be started and ended globally through macros and without explicit object references.

Member Function Documentation

◆ endTrace()

void endTrace ( const std::string & id)

End a trace identified by a unique ID.

This function ends the NamedSharedTrace associated with the given ID, marking the end of a traced section.

Parameters
idThe unique identifier for the trace to end.

◆ getInstance()

static TraceRegistry & getInstance ( )
static

Retrieve the singleton instance of the TraceRegistry.

This function returns the single, globally accessible instance of the TraceRegistry.

Returns
The singleton instance of TraceRegistry.

◆ registerTrace()

void registerTrace ( const std::string & id,
TraceSession & session )

Register a new NamedSharedTrace with a unique identifier.

This function registers a NamedSharedTrace instance associated with a given ID and TraceSession, allowing the trace to be managed globally.

Parameters
idThe unique identifier for the trace.
sessionThe TraceSession associated with the trace.

◆ startTrace()

void startTrace ( const std::string & id)

Start a trace identified by a unique ID.

This function starts the NamedSharedTrace associated with the given ID, marking the beginning of a traced section.

Parameters
idThe unique identifier for the trace to start.

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