DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DAPHNEListRequestHandler.hpp
Go to the documentation of this file.
1
9#ifndef FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNELISTREQUESTHANDLER_HPP_
10#define FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNELISTREQUESTHANDLER_HPP_
11
12#include "logging/Logging.hpp"
13
19
21
23
24#include <atomic>
25#include <deque>
26#include <functional>
27#include <future>
28#include <iomanip>
29#include <memory>
30#include <string>
31#include <thread>
32#include <utility>
33#include <vector>
34
36
37namespace dunedaq {
38namespace fdreadoutlibs {
39
42 types::DAPHNESuperChunkTypeAdapter,
43 datahandlinglibs::SkipListLatencyBufferModel<types::DAPHNESuperChunkTypeAdapter>>
44{
45public:
46 // Using shorter typenames
47 using inherited =
50 using SkipListAcc = typename folly::ConcurrentSkipList<types::DAPHNESuperChunkTypeAdapter>::Accessor;
51 using SkipListSkip = typename folly::ConcurrentSkipList<types::DAPHNESuperChunkTypeAdapter>::Skipper;
52
53 // Constructor
56 std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry)
57 : DefaultRequestHandlerModel<types::DAPHNESuperChunkTypeAdapter,
58 datahandlinglibs::SkipListLatencyBufferModel<types::DAPHNESuperChunkTypeAdapter>>(
59 latency_buffer,
60 error_registry)
61 {
62 TLOG_DEBUG(TLVL_WORK_STEPS) << "DAPHNEListRequestHandler created...";
63 }
64
65protected:
66 // Override cleanup with special implementation
67 void cleanup() override { daphne_cleanup_request(); }
68
69 // The DAPHNE with SkipList needs a special cleanup method.
71
72private:
73 // Constants
74 static const constexpr uint64_t m_max_ts_diff = 10000000; // NOLINT(build/unsigned)
75
76 // Stats
77 std::atomic<int> m_found_requested_count{ 0 };
78 std::atomic<int> m_bad_requested_count{ 0 };
79};
80
81} // namespace fdreadoutlibs
82} // namespace dunedaq
83
84#endif // FDREADOUTLIBS_INCLUDE_FDREADOUTLIBS_DAPHNE_DAPHNELISTREQUESTHANDLER_HPP_
DefaultRequestHandlerModel(std::shared_ptr< datahandlinglibs::SkipListLatencyBufferModel< types::DAPHNESuperChunkTypeAdapter > > &latency_buffer, std::unique_ptr< FrameErrorRegistry > &error_registry)
typename folly::ConcurrentSkipList< types::DAPHNESuperChunkTypeAdapter >::Accessor SkipListAcc
DAPHNEListRequestHandler(std::shared_ptr< datahandlinglibs::SkipListLatencyBufferModel< types::DAPHNESuperChunkTypeAdapter > > &latency_buffer, std::unique_ptr< datahandlinglibs::FrameErrorRegistry > &error_registry)
typename folly::ConcurrentSkipList< types::DAPHNESuperChunkTypeAdapter >::Skipper SkipListSkip
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
Including Qt Headers.