Line data Source code
1 : namespace dunedaq::timinglibs {
2 :
3 : template<class Child>
4 : void
5 0 : TimingHardwareManagerBase::register_timing_hw_command(const std::string& hw_cmd_id,
6 : void (Child::*f)(const timingcmd::TimingHwCmd&))
7 : {
8 : using namespace std::placeholders;
9 :
10 0 : std::string hw_cmd_name = hw_cmd_id;
11 0 : TLOG_DEBUG(0) << "Registering timing hw command id: " << hw_cmd_name << " called with " << typeid(f).name()
12 0 : << std::endl;
13 :
14 0 : bool done = m_timing_hw_cmd_map_.emplace(hw_cmd_name, std::bind(f, dynamic_cast<Child*>(this), _1)).second;
15 0 : if (!done) {
16 0 : throw TimingHardwareCommandRegistrationFailed(ERS_HERE, hw_cmd_name, get_name());
17 : }
18 0 : }
19 :
20 : template<class TIMING_DEV>
21 : TIMING_DEV
22 0 : TimingHardwareManagerBase::get_timing_device(const std::string& device_name)
23 : {
24 0 : auto device = get_timing_device_plain(device_name);
25 0 : auto timing_device = cast_timing_device<TIMING_DEV>(device, device_name);
26 0 : return timing_device;
27 : }
28 :
29 : } // namespace dunedaq::timinglibs
|