The Gaudi Framework  v29r0 (ff2e7097)
FetchDataFromFile.cpp
Go to the documentation of this file.
2 
3 namespace Gaudi
4 {
5  namespace Hive
6  {
7  class FetchDataFromFile final : public GaudiAlgorithm
8  {
9  public:
12  {
14  if ( sc ) {
15  // this is a hack to reuse the automatic dependencies declaration
16  for ( auto k : m_dataKeys ) {
18  }
19  }
20  return sc;
21  }
22  StatusCode start() override
23  {
25  if ( sc ) {
26  for ( const auto& k : outputDataObjs() ) {
27  if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "adding data key " << k << endmsg;
28  evtSvc()->addPreLoadItem( k.key() );
29  }
30  }
31  return sc;
32  }
33  StatusCode execute() override { return evtSvc()->preLoad(); }
34 
35  private:
37  this, "DataKeys", {}, "list of objects to be read from file"};
38  };
39  }
40 }
#define UNLIKELY(x)
Definition: Kernel.h:128
Implementation of property with value of concrete type.
Definition: Property.h:319
virtual StatusCode addPreLoadItem(const DataStoreItem &item)=0
Add an item to the preload list.
StatusCode initialize() override
standard initialization method
Header file for class GaudiAlgorithm.
virtual StatusCode preLoad()=0
Load all preload items of the list.
Gaudi::Property< std::vector< std::string > > m_dataKeys
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
The useful base class for data processing algorithms.
StatusCode initialize() override
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition: Algorithm.h:280
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:181
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Helper functions to set/get the application return code.
Definition: __init__.py:1
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209