DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
hsilibs
include
hsilibs
HSIEventSender.hpp
Go to the documentation of this file.
1
6
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
"
14
#include "
dfmessages/HSIEvent.hpp
"
15
#include "
utilities/WorkerThread.hpp
"
16
#include "
iomanager/IOManager.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
26
namespace
dunedaq
{
27
namespace
hsilibs
{
28
33
class
HSIEventSender
:
public
dunedaq::appfwk::DAQModule
34
{
35
public
:
40
explicit
HSIEventSender
(
const
std::string& name);
41
42
HSIEventSender
(
const
HSIEventSender
&) =
delete
;
43
HSIEventSender
&
operator=
(
const
HSIEventSender
&) =
delete
;
44
HSIEventSender
(
HSIEventSender
&&) =
delete
;
45
HSIEventSender
&
operator=
(
HSIEventSender
&&) =
delete
;
46
47
void
init
(std::shared_ptr<appfwk::ConfigurationManager> mcfg)
override
;
48
49
protected
:
50
// Commands
51
virtual
void
do_configure
(
const
CommandData_t&
obj
) = 0;
52
virtual
void
do_start
(
const
CommandData_t&
obj
) = 0;
53
virtual
void
do_stop
(
const
CommandData_t&
obj
) = 0;
54
virtual
void
do_scrap
(
const
CommandData_t&
obj
) = 0;
55
56
// Configuration
57
std::string
m_hsievent_send_connection
;
58
std::chrono::milliseconds
m_queue_timeout
;
59
60
using
raw_sender_ct
=
iomanager::SenderConcept<HSI_FRAME_STRUCT>
;
61
62
using
hsievent_sender_ct
=
iomanager::SenderConcept<dfmessages::HSIEvent>
;
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:
DAQModule.hpp
HSIEvent.hpp
IOManager.hpp
Issue.hpp
WorkerThread.hpp
dunedaq::hsilibs::HSIEventSender::HSIEventSender
HSIEventSender(const std::string &name)
HSIEventSender Constructor.
Definition
HSIEventSender.cpp:26
dunedaq::hsilibs::HSIEventSender::operator=
HSIEventSender & operator=(HSIEventSender &&)=delete
HSIEventSender is not move-assignable.
dunedaq::hsilibs::HSIEventSender::send_hsi_event
virtual void send_hsi_event(dfmessages::HSIEvent &event)
Definition
HSIEventSender.cpp:65
dunedaq::hsilibs::HSIEventSender::operator=
HSIEventSender & operator=(const HSIEventSender &)=delete
HSIEventSender is not copy-assignable.
dunedaq::hsilibs::HSIEventSender::HSIEventSender
HSIEventSender(const HSIEventSender &)=delete
HSIEventSender is not copy-constructible.
dunedaq::hsilibs::HSIEventSender::do_start
virtual void do_start(const CommandData_t &obj)=0
dunedaq::hsilibs::HSIEventSender::do_stop
virtual void do_stop(const CommandData_t &obj)=0
dunedaq::hsilibs::HSIEventSender::send_raw_hsi_data
virtual void send_raw_hsi_data(const std::array< uint32_t, 7 > &raw_data, raw_sender_ct *sender)
Definition
HSIEventSender.cpp:91
dunedaq::hsilibs::HSIEventSender::m_last_sent_timestamp
std::atomic< uint64_t > m_last_sent_timestamp
Definition
HSIEventSender.hpp:72
dunedaq::hsilibs::HSIEventSender::init
void init(std::shared_ptr< appfwk::ConfigurationManager > mcfg) override
Definition
HSIEventSender.cpp:38
dunedaq::hsilibs::HSIEventSender::m_hsievent_send_connection
std::string m_hsievent_send_connection
Definition
HSIEventSender.hpp:57
dunedaq::hsilibs::HSIEventSender::m_failed_to_send_counter
std::atomic< uint64_t > m_failed_to_send_counter
Definition
HSIEventSender.hpp:71
dunedaq::hsilibs::HSIEventSender::m_sent_counter
std::atomic< uint64_t > m_sent_counter
Definition
HSIEventSender.hpp:70
dunedaq::hsilibs::HSIEventSender::m_hsievent_sender
std::shared_ptr< hsievent_sender_ct > m_hsievent_sender
Definition
HSIEventSender.hpp:63
dunedaq::hsilibs::HSIEventSender::hsievent_sender_ct
iomanager::SenderConcept< dfmessages::HSIEvent > hsievent_sender_ct
Definition
HSIEventSender.hpp:62
dunedaq::hsilibs::HSIEventSender::m_queue_timeout
std::chrono::milliseconds m_queue_timeout
Definition
HSIEventSender.hpp:58
dunedaq::hsilibs::HSIEventSender::raw_sender_ct
iomanager::SenderConcept< HSI_FRAME_STRUCT > raw_sender_ct
Definition
HSIEventSender.hpp:60
dunedaq::hsilibs::HSIEventSender::do_configure
virtual void do_configure(const CommandData_t &obj)=0
dunedaq::hsilibs::HSIEventSender::do_scrap
virtual void do_scrap(const CommandData_t &obj)=0
dunedaq::hsilibs::HSIEventSender::ready_to_send
virtual bool ready_to_send(std::chrono::milliseconds timeout)
Definition
HSIEventSender.cpp:56
dunedaq::hsilibs::HSIEventSender::HSIEventSender
HSIEventSender(HSIEventSender &&)=delete
HSIEventSender is not move-constructible.
dunedaq::iomanager::SenderConcept
Definition
Sender.hpp:44
Issues.hpp
Types.hpp
dunedaq::hsilibs
Definition
HSIEventSender.hpp:27
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::obj
msgpack::object obj
Definition
Serialization.hpp:257
dunedaq::dfmessages::HSIEvent
A message used to convey an HSI event.
Definition
HSIEvent.hpp:26
Generated on
for DUNE-DAQ by
1.17.0