Sleipnir C++ API
Loading...
Searching...
No Matches
slp::TimeTracerTree< Tracer, Entries > Class Template Reference

#include </home/runner/work/Sleipnir/Sleipnir/include/sleipnir/util/time_tracer.hpp>

Public Types

using ID = typename TimeTracerIndex< Entries >::ID
 Time tracer ID enum type.
 

Public Member Functions

 TimeTracerTree (bool enabled)
 
Tracer & operator[] (TimeTracerIndex< Entries > index)
 
Tracer & root ()
 
std::span< const Tracer, Entries.size()> tracers () const
 

Static Public Member Functions

static constexpr std::span< const TimeTraceEntry< ID >, Entries.size()> entries ()
 

Detailed Description

template<TimeTracer Tracer, const auto & Entries>
requires (detail::is_valid_time_trace(Entries))
class slp::TimeTracerTree< Tracer, Entries >

A set of tracers, one per entry in a time trace.

Template Parameters
TracerTime tracer type.
EntriesTime trace entries. The first entry is the root, which should time everything the other entries do.

Constructor & Destructor Documentation

◆ TimeTracerTree()

template<TimeTracer Tracer, const auto & Entries>
slp::TimeTracerTree< Tracer, Entries >::TimeTracerTree ( bool  enabled)
inlineexplicit

Constructs the tracers.

Parameters
enabledWhether the tracers measure time.

Member Function Documentation

◆ entries()

template<TimeTracer Tracer, const auto & Entries>
static constexpr std::span< const TimeTraceEntry< ID >, Entries.size()> slp::TimeTracerTree< Tracer, Entries >::entries ( )
inlinestaticconstexpr

Returns the time trace entries.

Returns
The time trace entries.

◆ operator[]()

template<TimeTracer Tracer, const auto & Entries>
Tracer & slp::TimeTracerTree< Tracer, Entries >::operator[] ( TimeTracerIndex< Entries >  index)
inline

Returns the tracer with the given ID.

Parameters
indexTime tracer ID, converted to its index at compile time. It must be in the time trace.
Returns
The tracer with the given ID.

◆ root()

template<TimeTracer Tracer, const auto & Entries>
Tracer & slp::TimeTracerTree< Tracer, Entries >::root ( )
inline

Returns the root tracer.

Returns
The root tracer.

◆ tracers()

template<TimeTracer Tracer, const auto & Entries>
std::span< const Tracer, Entries.size()> slp::TimeTracerTree< Tracer, Entries >::tracers ( ) const
inline

Returns the tracers in time trace order.

Returns
The tracers in time trace order.

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