1 #ifndef GAUDIKERNEL_EVENTCONTEXT_H 2 #define GAUDIKERNEL_EVENTCONTEXT_H 1 4 #if __cplusplus >= 201703 8 #include <boost/any.hpp> 67 if ( e == INVALID_CONTEXT_EVT )
setValid(
false );
73 if ( s == INVALID_CONTEXT_ID )
setValid(
false );
90 template <
typename ValueType,
typename... Args>
93 #if __cplusplus >= 201703 100 template <
typename T>
104 return getExtension<T>();
107 template <
typename T>
110 return ::evt_context_detail::any_cast<std::decay_t<T>&>(
m_extension );
113 template <
typename T>
116 return ::evt_context_detail::any_cast<std::decay_t<T>
const&>(
m_extension );
121 #if __cplusplus >= 201703 128 template <
typename T>
149 os <<
"s: " << ctx.
slot() <<
" e: " << ctx.
evt();
153 return os <<
"INVALID";
162 return os <<
"INVALID";
166 #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)