The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
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
\***********************************************************************************/
11
#include <
GaudiKernel/Algorithm.h
>
12
13
namespace
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
}
21
StatusCode
initialize
()
override
{
22
StatusCode
sc =
Algorithm::initialize
();
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
{
30
StatusCode
sc =
Algorithm::start
();
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
:
42
Gaudi::Property<std::vector<std::string>
>
m_dataKeys
{
43
this
,
"DataKeys"
, {},
"list of objects to be read from file"
};
44
};
45
}
// namespace Hive
46
}
// namespace Gaudi
47
using
Gaudi::Hive::FetchDataFromFile
;
48
DECLARE_COMPONENT
(
FetchDataFromFile
)
setProperty
bool PyHelper setProperty(IInterface *p, char *name, char *value)
Definition
Bootstrap.cpp:211
Algorithm.h
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition
MsgStream.h:198
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition
PluginServiceV1.h:45
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition
CommonMessaging.h:118
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition
CommonMessaging.h:127
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::outputDataObjs
const DataObjIDColl & outputDataObjs() const override
Definition
DataHandleHolderBase.h:83
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::addDependency
void addDependency(const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
Definition
DataHandleHolderBase.h:85
FetchDataFromFile::FetchDataFromFile
FetchDataFromFile(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FetchDataFromFile.cpp:17
Gaudi::Algorithm::Algorithm
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition
Algorithm.h:98
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition
Algorithm.h:175
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition
Algorithm.cpp:518
Gaudi::Algorithm::start
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition
Algorithm.h:177
Gaudi::Algorithm::evtSvc
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Definition
Algorithm.h:233
Gaudi::DataHandle::Writer
@ Writer
Definition
DataHandle.h:45
Gaudi::Hive::FetchDataFromFile
Definition
FetchDataFromFile.cpp:15
Gaudi::Hive::FetchDataFromFile::start
StatusCode start() override
Definition
FetchDataFromFile.cpp:29
Gaudi::Hive::FetchDataFromFile::m_dataKeys
Gaudi::Property< std::vector< std::string > > m_dataKeys
Definition
FetchDataFromFile.cpp:42
Gaudi::Hive::FetchDataFromFile::FetchDataFromFile
FetchDataFromFile(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FetchDataFromFile.cpp:17
Gaudi::Hive::FetchDataFromFile::initialize
StatusCode initialize() override
Definition
FetchDataFromFile.cpp:21
Gaudi::Hive::FetchDataFromFile::execute
StatusCode execute() override
Definition
FetchDataFromFile.cpp:39
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
IDataProviderSvc::preLoad
virtual StatusCode preLoad()=0
Load all preload items of the list.
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
Gaudi::Hive
Definition
FetchDataFromFile.cpp:14
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition
__init__.py:1
MSG::DEBUG
@ DEBUG
Definition
IMessageSvc.h:22
GaudiHive
src
FetchDataFromFile.cpp
Generated on
for The Gaudi Framework by
1.17.0