ATLAS Offline Software
Loading...
Searching...
No Matches
FactoryPreloadModule.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8//
9// includes
10//
11
13
15#include <TInterpreter.h>
16#include <TSystem.h>
17#include <ranges>
18
19//
20// method implementations
21//
22
23namespace EL
24{
25 namespace Detail
26 {
28 {
29 std::vector<std::string> preloaderList;
30 for (auto&& part : std::views::split(preloader.value(), ',')) preloaderList.emplace_back(part.begin(), part.end());
31
32 if (preloaderList.size() % 2 != 0)
33 {
34 ANA_MSG_ERROR ("Invalid preloader list");
35 return StatusCode::FAILURE;
36 }
37
38 for (std::size_t iter = 0; iter < preloaderList.size(); iter += 2)
39 {
40 const std::string& libName = preloaderList[iter];
41 const std::string& funcName = preloaderList[iter + 1];
42
43 if (gSystem->Load(libName.c_str()) != 0)
44 {
45 ANA_MSG_ERROR ("Failed to load library " << libName);
46 return StatusCode::FAILURE;
47 }
48 if (gInterpreter->Calc((funcName + "()").c_str()) != 1)
49 {
50 ANA_MSG_ERROR ("Failed to call function " << funcName << " from library " << libName);
51 return StatusCode::FAILURE;
52 }
53 }
54
55 return StatusCode::SUCCESS;
56 }
57 }
58}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Gaudi::Property< std::string > preloader
StatusCode onInitialize(ModuleData &data) override
action just before algorithms are initialized
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
the data the EventLoop core classes are sharing with the Module implementation
Definition ModuleData.h:64