DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
HSIEventSender.hpp
Go to the documentation of this file.
1
7#ifndef HSILIBS_INCLUDE_HSILIBS_HSIEVENTSENDER_HPP_
8#define HSILIBS_INCLUDE_HSILIBS_HSIEVENTSENDER_HPP_
9
10#include "hsilibs/Issues.hpp"
11#include "hsilibs/Types.hpp"
12
13#include "appfwk/DAQModule.hpp"
17#include <ers/Issue.hpp>
18
19#include <bitset>
20#include <chrono>
21#include <memory>
22#include <random>
23#include <string>
24#include <vector>
25
26namespace dunedaq {
27namespace hsilibs {
28
33class HSIEventSender : public dunedaq::appfwk::DAQModule
34{
35public:
40 explicit HSIEventSender(const std::string& name);
41
42 HSIEventSender(const HSIEventSender&) = delete;
46
47 void init(std::shared_ptr<appfwk::ConfigurationManager> mcfg) override;
48
49protected:
50 // Commands
51 virtual void do_configure(const nlohmann::json& obj) = 0;
52 virtual void do_start(const nlohmann::json& obj) = 0;
53 virtual void do_stop(const nlohmann::json& obj) = 0;
54 virtual void do_scrap(const nlohmann::json& obj) = 0;
55
56 // Configuration
58 std::chrono::milliseconds m_queue_timeout;
59
61
63 std::shared_ptr<hsievent_sender_ct> m_hsievent_sender;
64
65 // push events to HSIEvent output queue
66 virtual bool ready_to_send(std::chrono::milliseconds timeout);
67 virtual void send_hsi_event(dfmessages::HSIEvent& event);
68 virtual void send_raw_hsi_data(const std::array<uint32_t, 7>& raw_data, raw_sender_ct* sender);
69
70 std::atomic<uint64_t> m_sent_counter; // NOLINT(build/unsigned)
71 std::atomic<uint64_t> m_failed_to_send_counter; // NOLINT(build/unsigned)
72 std::atomic<uint64_t> m_last_sent_timestamp; // NOLINT(build/unsigned)
73};
74} // namespace hsilibs
75} // namespace dunedaq
76
77#endif // TIMINGLIBS_SRC_HSIEVENTSENDER_HPP_
78
79// Local Variables:
80// c-basic-offset: 2
81// End:
HSIEventSender provides an interface to process and and send HSIEvents.
HSIEventSender(const std::string &name)
HSIEventSender Constructor.
virtual void do_stop(const nlohmann::json &obj)=0
HSIEventSender & operator=(HSIEventSender &&)=delete
HSIEventSender is not move-assignable.
virtual void do_scrap(const nlohmann::json &obj)=0
virtual void send_hsi_event(dfmessages::HSIEvent &event)
HSIEventSender & operator=(const HSIEventSender &)=delete
HSIEventSender is not copy-assignable.
HSIEventSender(const HSIEventSender &)=delete
HSIEventSender is not copy-constructible.
virtual void do_configure(const nlohmann::json &obj)=0
virtual void send_raw_hsi_data(const std::array< uint32_t, 7 > &raw_data, raw_sender_ct *sender)
std::atomic< uint64_t > m_last_sent_timestamp
void init(std::shared_ptr< appfwk::ConfigurationManager > mcfg) override
std::atomic< uint64_t > m_failed_to_send_counter
std::atomic< uint64_t > m_sent_counter
std::shared_ptr< hsievent_sender_ct > m_hsievent_sender
std::chrono::milliseconds m_queue_timeout
virtual bool ready_to_send(std::chrono::milliseconds timeout)
HSIEventSender(HSIEventSender &&)=delete
HSIEventSender is not move-constructible.
virtual void do_start(const nlohmann::json &obj)=0
Including Qt Headers.
A message used to convey an HSI event.
Definition HSIEvent.hpp:26