The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
FetchDataFromFile.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2019 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\***********************************************************************************/
12
13namespace Gaudi {
14 namespace Hive {
15 class FetchDataFromFile final : public ::Algorithm {
16 public:
17 FetchDataFromFile( const std::string& name, ISvcLocator* pSvcLocator ) : Algorithm( name, pSvcLocator ) {
18 // make sure this algorithm is seen as reentrant by Gaudi
19 this->setProperty( "Cardinality", 0 ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
20 }
23 if ( sc ) {
24 // this is a hack to reuse the automatic dependencies declaration
25 for ( auto k : m_dataKeys ) { addDependency( k, Gaudi::DataHandle::Writer ); }
26 }
27 return sc;
28 }
29 StatusCode start() override {
31 if ( sc ) {
32 for ( const auto& k : outputDataObjs() ) {
33 if ( msgLevel( MSG::DEBUG ) ) debug() << "adding data key " << k << endmsg;
34 if ( sc = evtSvc()->addPreLoadItem( k.key() ); !sc ) return sc;
35 }
36 }
37 return sc;
38 }
39 StatusCode execute() override { return evtSvc()->preLoad(); }
40
41 private:
43 this, "DataKeys", {}, "list of objects to be read from file" };
44 };
45 } // namespace Hive
46} // namespace Gaudi
bool PyHelper setProperty(IInterface *p, char *name, char *value)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define DECLARE_COMPONENT(type)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition Algorithm.h:98
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition Algorithm.h:175
const std::string & name() const override
The identifying name of the algorithm object.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition Algorithm.h:177
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition Algorithm.h:233
Gaudi::Property< std::vector< std::string > > m_dataKeys
FetchDataFromFile(const std::string &name, ISvcLocator *pSvcLocator)
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
virtual StatusCode preLoad()=0
Load all preload items of the list.
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
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition __init__.py:1
@ DEBUG
Definition IMessageSvc.h:22