DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
EmptyFragmentRequestHandlerModel.hxx
Go to the documentation of this file.
1// Declarations for EmptyFragmentRequestHandlerModel
2
3namespace dunedaq {
4namespace datahandlinglibs {
5
6// Override the issue_request implementation of the DefaultRequestHandlerModel
7// in order to always respond with empty fragments.
8template<class ReadoutType, class LatencyBufferType>
9void
11 dfmessages::DataRequest datarequest, bool is_retry)
12{
13 auto frag_header = inherited::create_fragment_header(datarequest);
14 frag_header.status_bits |= (0x1 << static_cast<size_t>(daqdataformats::FragmentStatusBits::kEmptyFragment));
15 auto fragment = std::make_unique<daqdataformats::Fragment>(std::vector<std::pair<void*, size_t>>());
16 fragment->set_header_fields(frag_header);
17
18 TLOG_DEBUG(TLVL_WORK_STEPS) << "DLH is configured to send empty fragment";
19
20 try { // Push to Fragment queue
21 TLOG_DEBUG(TLVL_QUEUE_PUSH) << "Sending fragment with trigger_number " << fragment->get_trigger_number()
22 << ", run number " << fragment->get_run_number() << ", and SourceID "
23 << fragment->get_element_id();
24 //auto frag = std::make_pair(std::move(fragment), datarequest.data_destination);
26 ->send(std::move(fragment), inherited::m_fragment_send_timeout_ms);
27 } catch (const ers::Issue& excpt) {
28 ers::warning(CannotWriteToQueue(
30 }
31}
32
33} // namespace datahandlinglibs
34} // namespace dunedaq
#define ERS_HERE
void issue_request(dfmessages::DataRequest datarequest, bool is_retry=false) override
Issue a data request to the request handler.
Base class for any user define issue.
Definition Issue.hpp:69
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
@ kEmptyFragment
This Fragment contains no data.
Including Qt Headers.
static std::shared_ptr< iomanager::SenderConcept< Datatype > > get_iom_sender(iomanager::ConnectionId const &id)
void warning(const Issue &issue)
Definition ers.hpp:115
This message represents a request for data sent to a single component of the DAQ.