14template<
typename Child>
16DAQModule::register_command(
const std::string& cmd_name,
void (Child::*f)(
const CommandData_t&))
18 if (!m_command_registration_allowed) {
19 throw CommandRegistrationFailedMessage(
20 ERS_HERE, get_name(), cmd_name,
"Registering commands is not allowed at this time");
22 using namespace std::placeholders;
25 m_commands.emplace(cmd_name, std::bind(f,
dynamic_cast<Child*
>(
this), _1)).second;
28 throw CommandRegistrationFailedMessage(
29 ERS_HERE, get_name(), cmd_name,
"Emplacing command in command map failed, possible duplicate registration");
39inline std::shared_ptr<DAQModule>
40make_module(std::string
const& plugin_name, std::string
const& instance_name)
42 static cet::BasicPluginFactory bpf(
"duneDAQModule",
"make");
44 std::shared_ptr<DAQModule> mod_ptr;
46 mod_ptr = bpf.makePlugin<std::shared_ptr<DAQModule>>(plugin_name, instance_name);
47 }
catch (
const cet::exception& cexpt) {
48 throw DAQModuleCreationFailed(
ERS_HERE, plugin_name, instance_name, cexpt);
std::shared_ptr< DAQModule > make_module(std::string const &plugin_name, std::string const &instance_name)
Load a DAQModule plugin and return a shared_ptr to the contained DAQModule class.