The Gaudi Framework  master (41389df7)
Loading...
Searching...
No Matches
EventContextFormatter< BASE > Struct Template Reference

Custom formatter for EventContext to support std::format and fmt. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/EventContext.h>

Inheritance diagram for EventContextFormatter< BASE >:
Collaboration diagram for EventContextFormatter< BASE >:

Public Member Functions

auto format (const EventContext &ec, auto &ctx) const
 

Detailed Description

template<class BASE>
struct EventContextFormatter< BASE >

Custom formatter for EventContext to support std::format and fmt.

TODO: can be simplified once we drop fmt support

Definition at line 148 of file EventContext.h.

Member Function Documentation

◆ format()

template<class BASE>
auto EventContextFormatter< BASE >::format ( const EventContext & ec,
auto & ctx ) const
inline

Definition at line 149 of file EventContext.h.

149 {
150 if ( ec.valid() ) {
152 if ( ec.usesSubSlot() ) {
153 out = std::format( "s: {} e: {} sub: {}", ec.slot(), ec.evt(), ec.subSlot() );
154 } else {
155 out = std::format( "s: {} e: {}", ec.slot(), ec.evt() );
156 }
157 return BASE::format( out, ctx );
158
159 } else {
160 return BASE::format( "INVALID", ctx );
161 }
162 }
Custom formatter for EventContext to support std::format and fmt.

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