DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
appfwk
src
DAQModule.cpp
Go to the documentation of this file.
1
8
9
#include "
appfwk/DAQModule.hpp
"
10
#include "
logging/Logging.hpp
"
11
12
#include <string>
13
#include <vector>
14
15
namespace
dunedaq::appfwk
{
16
17
void
18
DAQModule::execute_command(
const
std::string& cmd_name,
const
CommandData_t& data)
19
{
20
auto
cmd = m_commands.find(cmd_name);
21
if
(cmd != m_commands.end()) {
22
std::invoke(cmd->second, data);
23
return
;
24
}
25
throw
UnknownCommand(
ERS_HERE
, get_name(), cmd_name);
26
}
27
28
std::vector<std::string>
29
DAQModule::get_commands()
const
30
{
31
std::vector<std::string> cmds;
32
for
(
const
auto
& [key, value] : m_commands)
33
cmds.push_back(key);
34
return
cmds;
35
}
36
37
bool
38
DAQModule::has_command(
const
std::string& cmd_name)
const
39
{
40
return
m_commands.find(cmd_name) != m_commands.end();
41
}
42
43
}
// namespace dunedaq::appfwk
DAQModule.hpp
ERS_HERE
#define ERS_HERE
Definition
LocalContext.hpp:141
Logging.hpp
dunedaq::appfwk
Definition
Nljs.hpp:18
Generated on
for DUNE-DAQ by
1.17.0