ATLAS Offline Software
Loading...
Searching...
No Matches
WorkerConfig.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8//
9// includes
10//
11
13
21
23
24//
25// method implementations
26//
27
29
30namespace EL
31{
32 WorkerConfig ::
33 WorkerConfig (Detail::ModuleData *val_data) noexcept
34 : m_data (val_data),
35 m_metaStore (asg::SgTEventMeta::InputStore, nullptr)
36 {}
37
38
39
40 // FIX ME: something bad happens in the linker step if this is not
41 // here and instead rely on the implicit destructor, which I don't
42 // want to debug.
43 WorkerConfig :: ~WorkerConfig () noexcept = default;
44
45
46
47 void WorkerConfig ::
48 add (const EL::PythonConfigBase& config)
49 {
50 using namespace msgEventLoop;
51 ANA_MSG_INFO ("in add");
52 // no invariant used
53 std::unique_ptr<IAlgorithmWrapper> alg;
54 if (config.componentType() == "AnaAlgorithm")
55 alg = std::make_unique<AnaAlgorithmWrapper> (AnaAlgorithmConfig (config));
56 else if (config.componentType() == "AnaReentrantAlgorithm")
57 alg = std::make_unique<AnaReentrantAlgorithmWrapper> (AnaReentrantAlgorithmConfig (config));
58 else if (config.componentType() == "AsgTool")
59 alg = std::make_unique<AsgToolWrapper> (asg::AsgToolConfig (config));
60 else if (config.componentType() == "AsgService")
61 alg = std::make_unique<AsgServiceWrapper> (asg::AsgServiceConfig (config));
62 else
63 {
64 ANA_MSG_ERROR ("unknown component type: \"" << config.componentType() << "\"");
65 throw std::runtime_error ("unknown component type: \"" + config.componentType() + "\"");
66 }
67 m_data->m_algs.emplace_back (std::move (alg));
68 }
69}
#define ANA_MSG_INFO(xmsg)
Macro printing info messages.
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
ClassImp(EL::WorkerConfig) namespace EL
the base class for the python configuration of any asg::AsgComponent
an object that can create a AsgService
an object that can create a AsgTool
@ InputStore
This store is used to access the input metadata.
This module defines the arguments passed from the BATCH driver to the BATCH worker.