8 #ifndef OCM_SERVER_DAQ_TASKS_HPP
9 #define OCM_SERVER_DAQ_TASKS_HPP
14 #include <rad/logger.hpp>
15 #include <rad/actionMgr.hpp>
17 #include "daq/events.rad.hpp"
18 #include "daq/tasks.rad.hpp"
29 template<
typename EVENT>
30 std::function<void(rad::AnyEvent const&)>
32 return [action](rad::AnyEvent
const& ev) {
33 if (
typeid(ev) ==
typeid(EVENT)) {
34 return action(reinterpret_cast<EVENT const&>(ev));
37 RAD_LOG_ERROR() <<
"WrapAction called with unexpected event. Expected "
38 <<
typeid(EVENT).name() <<
" but got " <<
typeid(ev).name();
59 void PrepareDaq(daq::PrepareDaq
const& ev)
override;
61 void Test(rad::AnyEvent
const& ev)
override{};
73 #endif // #ifndef OCM_SERVER_DAQ_TASKS_HPP
std::function< void(rad::AnyEvent const &)> WrapAction(std::function< void(EVENT const &)> action)
Definition: action.hpp:31
void Test(rad::AnyEvent const &ev) override
Definition: action.hpp:61
void PrepareDaq(daq::PrepareDaq const &ev) override
Definition: action.cpp:16
Tasks()
Definition: action.cpp:12
Definition: action.hpp:43