1 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
2 #include "artdaq-core/Utilities/ExceptionHandler.hh"
4 #include "cetlib/BasicPluginFactory.h"
5 #include "fhiclcpp/ParameterSet.h"
10 std::unique_ptr<artdaq::TransferInterface>
12 const std::string& plugin_label,
15 static cet::BasicPluginFactory bpf(
"transfer",
"make");
17 fhicl::ParameterSet transfer_pset;
21 transfer_pset = pset.get<fhicl::ParameterSet>(plugin_label);
25 std::stringstream errmsg;
27 <<
"Error in artdaq::MakeTransferPlugin: Unable to find the transfer plugin parameters in the FHiCL code \"" << transfer_pset.to_string()
28 <<
"\"; FHiCL table with label \"" << plugin_label
29 <<
"\" may not exist, or if it does, one or more parameters may be missing.";
30 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
36 bpf.makePlugin<std::unique_ptr<TransferInterface>,
37 const fhicl::ParameterSet&,
39 transfer_pset.get<std::string>(
"transferPluginType"),
47 std::stringstream errmsg;
49 <<
"Unable to create transfer plugin using the FHiCL parameters \""
50 << transfer_pset.to_string()
52 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.