16 #ifndef QUALITYCONTROL_ROOTCLASSFACTORY_H 17 #define QUALITYCONTROL_ROOTCLASSFACTORY_H 21 #include <Common/Exceptions.h> 27 #include <boost/filesystem/path.hpp> 31 namespace bfs = boost::filesystem;
36 namespace root_class_factory
39 using FatalException = AliceO2::Common::FatalException;
40 using errinfo_details = AliceO2::Common::errinfo_details;
43 T* create(std::string moduleName, std::string className)
46 QcInfoLogger& logger = QcInfoLogger::GetInstance();
49 std::string library = bfs::path(moduleName).is_absolute() ? moduleName :
"lib" + moduleName;
50 logger <<
"Loading library " << library << AliceO2::InfoLogger::InfoLogger::endm;
51 int libLoaded = gSystem->Load(library.c_str(),
"",
true);
53 BOOST_THROW_EXCEPTION(FatalException() << errinfo_details(
"Failed to load Detector Publisher Library"));
57 logger <<
"Loading class " << className << AliceO2::InfoLogger::InfoLogger::endm;
58 TClass* cl = TClass::GetClass(className.c_str());
59 std::string tempString(
"Failed to instantiate Quality Control Module");
61 tempString +=
" because no dictionary for class named \"";
62 tempString += className;
63 tempString +=
"\" could be retrieved";
64 BOOST_THROW_EXCEPTION(FatalException() << errinfo_details(tempString));
66 logger <<
"Instantiating class " << className <<
" (" << cl <<
")" 67 << AliceO2::InfoLogger::InfoLogger::endm;
68 result =
static_cast<T*
>(cl->New());
70 BOOST_THROW_EXCEPTION(FatalException() << errinfo_details(tempString));
72 logger <<
"QualityControl Module " << moduleName <<
" loaded " << AliceO2::InfoLogger::InfoLogger::endm;
81 #endif //QUALITYCONTROL_ROOTCLASSFACTORY_H
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19