1 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
2 #include "artdaq-core/Utilities/ExceptionHandler.hh"
4 #include "fhiclcpp/ParameterSet.h"
6 #include "cetlib/BasicPluginFactory.h"
12 std::unique_ptr<artdaq::TransferInterface>
14 const std::string& plugin_label,
17 static cet::BasicPluginFactory bpf(
"transfer",
"make");
19 fhicl::ParameterSet transfer_pset;
23 transfer_pset = pset.get<fhicl::ParameterSet>(plugin_label);
27 std::stringstream errmsg;
29 <<
"Error in artdaq::MakeTransferPlugin: Unable to find the transfer plugin parameters in the FHiCL code \"" << transfer_pset.to_string()
30 <<
"\"; FHiCL table with label \"" << plugin_label
31 <<
"\" may not exist, or if it does, one or more parameters may be missing.";
32 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
38 bpf.makePlugin<std::unique_ptr<TransferInterface>,
39 const fhicl::ParameterSet&,
41 transfer_pset.get<std::string>(
"transferPluginType"),
49 std::stringstream errmsg;
51 <<
"Unable to create transfer plugin using the FHiCL parameters \""
52 << transfer_pset.to_string()
54 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
std::unique_ptr< artdaq::TransferInterface > MakeTransferPlugin(const fhicl::ParameterSet &pset, const std::string &plugin_label, TransferInterface::Role role)
Load a TransferInterface plugin.
Role
Used to determine if a TransferInterface is a Sender or Receiver.