The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::FSMCallbackHolder< BASE > Class Template Reference

Helper class to implement the IFSMCallbackHolder interface. More...

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

Inheritance diagram for Gaudi::FSMCallbackHolder< BASE >:
Collaboration diagram for Gaudi::FSMCallbackHolder< BASE >:

Public Types

using Parent = extends<BASE, IFSMCallbackHolder>
 
- Public Types inherited from extends< BASE, IFSMCallbackHolder >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Public Member Functions

void registerCallBack (StateMachine::Transition s, IFSMCallbackHolder::CallBack c) override
 
StatusCode sysInitialize () override
 
StatusCode sysStart () override
 
StatusCode sysStop () override
 
StatusCode sysFinalize () override
 
- Public Member Functions inherited from extends< BASE, IFSMCallbackHolder >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 

Private Member Functions

void handleCallBacks (StateMachine::Transition state)
 

Private Attributes

std::map< StateMachine::Transition, std::vector< IFSMCallbackHolder::CallBack > > m_callbacks
 

Detailed Description

template<class BASE>
class Gaudi::FSMCallbackHolder< BASE >

Helper class to implement the IFSMCallbackHolder interface.

FSMCallbackHolder is used by components base classes (Algorithm, Tool, etc.) to provide a default implementation the IFSMCallbackHolder interface.

When needing to implement the IFSMCallbackHolder interface in a class, it is enough to wrap the base of the class with FSMCallbackHolder, as in

class MyClass : public FSMCallbackHolder<BaseClass> {
// ...
};
Helper class to implement the IFSMCallbackHolder interface.

Definition at line 37 of file FSMCallbackHolder.h.

Member Typedef Documentation

◆ Parent

template<class BASE>
using Gaudi::FSMCallbackHolder< BASE >::Parent = extends<BASE, IFSMCallbackHolder>

Definition at line 40 of file FSMCallbackHolder.h.

Member Function Documentation

◆ handleCallBacks()

template<class BASE>
void Gaudi::FSMCallbackHolder< BASE >::handleCallBacks ( StateMachine::Transition state)
inlineprivate

Definition at line 61 of file FSMCallbackHolder.h.

61 {
63 []( IFSMCallbackHolder::CallBack const& c ) { c(); } );
64 }
std::map< StateMachine::Transition, std::vector< IFSMCallbackHolder::CallBack > > m_callbacks

◆ registerCallBack()

template<class BASE>
void Gaudi::FSMCallbackHolder< BASE >::registerCallBack ( StateMachine::Transition s,
IFSMCallbackHolder< BASE >::CallBack c )
inlineoverride

Definition at line 43 of file FSMCallbackHolder.h.

43 {
44 m_callbacks[s].push_back( std::move( c ) );
45 }

◆ sysFinalize()

template<class BASE>
StatusCode Gaudi::FSMCallbackHolder< BASE >::sysFinalize ( )
inlineoverride

Definition at line 56 of file FSMCallbackHolder.h.

56 {
57 return Parent::sysFinalize().andThen( [&]() { handleCallBacks( StateMachine::FINALIZE ); } );
58 }
void handleCallBacks(StateMachine::Transition state)

◆ sysInitialize()

template<class BASE>
StatusCode Gaudi::FSMCallbackHolder< BASE >::sysInitialize ( )
inlineoverride

Definition at line 47 of file FSMCallbackHolder.h.

47 {
48 return Parent::sysInitialize().andThen( [&]() { handleCallBacks( StateMachine::INITIALIZE ); } );
49 }

◆ sysStart()

template<class BASE>
StatusCode Gaudi::FSMCallbackHolder< BASE >::sysStart ( )
inlineoverride

Definition at line 50 of file FSMCallbackHolder.h.

50 {
51 return Parent::sysStart().andThen( [&]() { handleCallBacks( StateMachine::START ); } );
52 }

◆ sysStop()

template<class BASE>
StatusCode Gaudi::FSMCallbackHolder< BASE >::sysStop ( )
inlineoverride

Definition at line 53 of file FSMCallbackHolder.h.

53 {
54 return Parent::sysStop().andThen( [&]() { handleCallBacks( StateMachine::STOP ); } );
55 }

Member Data Documentation

◆ m_callbacks

template<class BASE>
std::map<StateMachine::Transition, std::vector<IFSMCallbackHolder::CallBack> > Gaudi::FSMCallbackHolder< BASE >::m_callbacks
private

Definition at line 66 of file FSMCallbackHolder.h.


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