29 std::vector<std::string> preloaderList;
30 for (
auto&& part : std::views::split(
preloader.value(),
',')) preloaderList.emplace_back(part.begin(), part.end());
32 if (preloaderList.size() % 2 != 0)
35 return StatusCode::FAILURE;
38 for (std::size_t iter = 0; iter < preloaderList.size(); iter += 2)
40 const std::string& libName = preloaderList[iter];
41 const std::string& funcName = preloaderList[iter + 1];
43 if (gSystem->Load(libName.c_str()) != 0)
46 return StatusCode::FAILURE;
48 if (gInterpreter->Calc((funcName +
"()").c_str()) != 1)
50 ANA_MSG_ERROR (
"Failed to call function " << funcName <<
" from library " << libName);
51 return StatusCode::FAILURE;
55 return StatusCode::SUCCESS;