1 #ifndef GAUDIKERNEL_EVENTCONTEXT_H 2 #define GAUDIKERNEL_EVENTCONTEXT_H 1 4 #if __cplusplus >= 201703 8 # include <boost/any.hpp> 63 if ( e == INVALID_CONTEXT_EVT )
setValid(
false );
68 if ( s == INVALID_CONTEXT_ID )
setValid(
false );
84 template <
typename ValueType,
typename... Args>
86 #if __cplusplus >= 201703 96 return getExtension<T>();
101 return ::evt_context_detail::any_cast<std::decay_t<T>&>(
m_extension );
104 template <
typename T>
106 return ::evt_context_detail::any_cast<std::decay_t<T>
const&>(
m_extension );
110 #if __cplusplus >= 201703 117 template <
typename T>
136 os <<
"s: " << ctx.
slot() <<
" e: " << ctx.
evt();
140 return os <<
"INVALID";
148 return os <<
"INVALID";
152 #endif // GAUDIKERNEL_EVENTCONTEXT_H
void setEvt(const ContextEvt_t e)
bool hasExtension() const
void setEventID(const EventIDBase &e)
const auto & getExtension() const
auto & emplaceExtension(Args &&...args)
This class represents an entry point to all the event specific data.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
static constexpr ContextEvt_t INVALID_CONTEXT_EVT
auto & setExtension(T &&t)
const std::type_info & getExtensionType() const
static constexpr ContextID_t INVALID_CONTEXT_ID
void setSubSlot(const ContextID_t subslot)
void setSlot(const ContextID_t s)
EventContext(const ContextEvt_t e, const ContextID_t s=INVALID_CONTEXT_ID, const ContextID_t subSlot=INVALID_CONTEXT_ID)
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
const EventIDBase & eventID() const
bool hasExtension() const
void setValid(const bool b=true)
ContextID_t subSlot() const
::evt_context_detail::any m_extension
std::ostream & operator<<(std::ostream &os, const EventContext &ctx)