Go to the documentation of this file.
22 ConditionAccessor<int>
m_cond{
this,
"MyCondition",
"condition/key" };
25 auto status = base_class::initialize();
26 if ( !status )
return status;
28 info() <<
"initialize" <<
endmsg;
37 const auto& cond =
m_cond.get( condCtx );
39 info() <<
"got condition value " << cond <<
endmsg;
45 info() <<
"finalize" <<
endmsg;
47 return base_class::finalize();
Example of a simple algorithm using conditions via the ConditionAccessorHolder pattern.
StatusCode initialize() override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
StatusCode finalize() override
Example of a ConditionAccessorHolder implementation.
constexpr static const auto SUCCESS
#define DECLARE_COMPONENT(type)
StatusCode execute(const EventContext &ctx) const override
const ConditionContext & getConditionContext(const EventContext &ctx) const
Helper to map the event being processed to the corresponding conditions slot.
CommonMessaging base_class
ConditionAccessor< int > m_cond
Data member to access condition values for the current event.