| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

HiveReadAlgorithm.cpp
Go to the documentation of this file.
1 #include "GaudiAlg/GaudiAlgorithm.h"
2 #include "GaudiKernel/AlgFactory.h"
3 #include "GaudiKernel/DataStoreItem.h"
4 #include "GaudiKernel/ThreadLocalContext.h"
5
6 class GAUDI_API HiveReadAlgorithm : public GaudiAlgorithm
7 {
8 public:
9 HiveReadAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : GaudiAlgorithm( name, pSvcLocator ) {}
10 ~HiveReadAlgorithm() override {}
11 StatusCode initialize() override;
12 StatusCode execute() override;
13 StatusCode finalize() override { return StatusCode::SUCCESS; }
14 };
15
16 DECLARE_ALGORITHM_FACTORY( HiveReadAlgorithm )
17
18 StatusCode HiveReadAlgorithm::initialize() { return evtSvc()->addPreLoadItem( DataStoreItem( "/Event", 99 ) ); }
19
20 StatusCode HiveReadAlgorithm::execute()
21 {
22 info() << "Running now for event " << Gaudi::Hive::currentContext().evt() << endmsg;
23 return evtSvc()->preLoad();
24 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:117
IDataProviderSvc::addPreLoadItem
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
GaudiAlgorithm::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiAlgorithm.cpp:43
ThreadLocalContext.h
GaudiAlgorithm.h
Header file for class GaudiAlgorithm.
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
GaudiAlgorithm::execute
StatusCode execute() override
standard execution method
Definition: GaudiAlgorithm.cpp:72
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:39
std::string
STL class.
DataStoreItem.h
HiveReadAlgorithm::HiveReadAlgorithm
HiveReadAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveReadAlgorithm.cpp:9
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
HiveReadAlgorithm::~HiveReadAlgorithm
~HiveReadAlgorithm() override
Definition: HiveReadAlgorithm.cpp:10
DECLARE_ALGORITHM_FACTORY
#define DECLARE_ALGORITHM_FACTORY(x)
Definition: Algorithm.h:629
GaudiAlgorithm
The useful base class for data processing algorithms.
Definition: GaudiAlgorithm.h:94
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:24
HiveReadAlgorithm::execute
StatusCode execute() override
Definition: HiveReadAlgorithm.cpp:20
Algorithm::evtSvc
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:280
AlgFactory.h
HiveReadAlgorithm
Definition: HiveReadAlgorithm.cpp:6
HiveReadAlgorithm::finalize
StatusCode finalize() override
Definition: HiveReadAlgorithm.cpp:13
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209