1 #include "artdaq/TransferPlugins/MakeTransferPlugin.hh"
2 #include "artdaq-core/Utilities/ExceptionHandler.hh"
4 #include "cetlib/BasicPluginFactory.h"
5 #include "fhiclcpp/ParameterSet.h"
11 std::unique_ptr<artdaq::TransferInterface>
13 std::string plugin_label,
16 static cet::BasicPluginFactory bpf(
"transfer",
"make");
18 fhicl::ParameterSet transfer_pset;
22 transfer_pset = pset.get<fhicl::ParameterSet>(plugin_label);
26 std::stringstream errmsg;
28 <<
"Error in artdaq::MakeTransferPlugin: Unable to find the transfer plugin parameters in the FHiCL code \"" << transfer_pset.to_string()
29 <<
"\"; FHiCL table with label \"" << plugin_label
30 <<
"\" may not exist, or if it does, one or more parameters may be missing.";
31 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
37 bpf.makePlugin<std::unique_ptr<TransferInterface>,
38 const fhicl::ParameterSet&,
40 transfer_pset.get<std::string>(
"transferPluginType"),
44 return std::move(transfer);
48 std::stringstream errmsg;
50 <<
"Unable to create transfer plugin using the FHiCL parameters \""
51 << transfer_pset.to_string()
53 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
std::unique_ptr< artdaq::TransferInterface > MakeTransferPlugin(const fhicl::ParameterSet &pset, std::string plugin_label, TransferInterface::Role role)
Load a TransferInterface plugin.
Role
Used to determine if a TransferInterface is a Sender or Receiver.