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.error_bits |= (0x1 << static_cast<size_t>(daqdataformats::FragmentErrorBits::kDataNotFound));
15 auto fragment = std::make_unique<daqdataformats::Fragment>(std::vector<std::pair<void*, size_t>>());
16 fragment->set_header_fields(frag_header);
17
18 // ers::warning(dunedaq::datahandlinglibs::TrmWithEmptyFragment(ERS_HERE, "DLH is configured to send empty fragment"));
19 TLOG_DEBUG(TLVL_WORK_STEPS) << "DLH is configured to send empty fragment";
20
21 try { // Push to Fragment queue
22 TLOG_DEBUG(TLVL_QUEUE_PUSH) << "Sending fragment with trigger_number " << fragment->get_trigger_number()
23 << ", run number " << fragment->get_run_number() << ", and SourceID "
24 << fragment->get_element_id();
25 //auto frag = std::make_pair(std::move(fragment), datarequest.data_destination);
27 ->send(std::move(fragment), inherited::m_fragment_send_timeout_ms);
28 } catch (const ers::Issue& excpt) {
29 ers::warning(CannotWriteToQueue(
31 }
32}
33
34} // namespace datahandlinglibs
35} // 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
@ kDataNotFound
The requested data was not found at all, so the fragment is empty.
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.