The Gaudi Framework  master (181af51f)
Loading...
Searching...
No Matches
FSMCallbackTestAlgo.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#include <Gaudi/Algorithm.h>
13
14namespace Gaudi::TestSuite {
15
20 FSMCallbackTestAlgo( const std::string& name, ISvcLocator* pSvcLocator )
21 : FSMCallbackHolder<Algorithm>( name, pSvcLocator ) {
22 registerCallBack( StateMachine::INITIALIZE, []() { std::cout << "Callback properly called at INITIALIZE\n"; } );
23 registerCallBack( StateMachine::START, []() { std::cout << "Callback properly called at START\n"; } );
24 registerCallBack( StateMachine::STOP, []() { std::cout << "Callback properly called at STOP\n"; } );
25 registerCallBack( StateMachine::FINALIZE, []() { std::cout << "Callback properly called at FINALIZE\n"; } );
26 }
27 StatusCode execute( const EventContext& ) const override {
28 std::cout << "Executing\n";
30 }
31 };
32 DECLARE_COMPONENT( FSMCallbackTestAlgo );
33
34} // namespace Gaudi::TestSuite
#define DECLARE_COMPONENT(type)
This class represents an entry point to all the event specific data.
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:87
const std::string & name() const override
The identifying name of the algorithm object.
Helper class to implement the IFSMCallbackHolder interface.
void registerCallBack(StateMachine::Transition s, IFSMCallbackHolder::CallBack c) override
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
constexpr static const auto SUCCESS
Definition StatusCode.h:99
FSMCallbackTestAlgo(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode execute(const EventContext &) const override