Line data Source code
1 : /**
2 : * @file HSIFrameProcessor.hpp HSI specific Task based raw processor
3 : *
4 : * This is part of the DUNE DAQ , copyright 2020.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 : #ifndef HSILIBS_SRC_HSI_HSIFRAMEPROCESSOR_HPP_
9 : #define HSILIBS_SRC_HSI_HSIFRAMEPROCESSOR_HPP_
10 :
11 : #include "datahandlinglibs/DataHandlingIssues.hpp"
12 : #include "datahandlinglibs/models/TaskRawDataProcessorModel.hpp"
13 :
14 : #include "hsilibs/Types.hpp"
15 : #include "logging/Logging.hpp"
16 : #include "datahandlinglibs/FrameErrorRegistry.hpp"
17 : #include "datahandlinglibs/ReadoutLogging.hpp"
18 :
19 : #include <atomic>
20 : #include <functional>
21 : #include <memory>
22 : #include <string>
23 :
24 : namespace dunedaq {
25 : namespace hsilibs {
26 :
27 : class HSIFrameProcessor : public datahandlinglibs::TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>
28 : {
29 :
30 : public:
31 : using inherited = datahandlinglibs::TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>;
32 : using frameptr = hsilibs::HSI_FRAME_STRUCT*;
33 : using timestamp_t = std::uint64_t; // NOLINT(build/unsigned)
34 :
35 : // Constructor
36 0 : explicit HSIFrameProcessor(std::unique_ptr<datahandlinglibs::FrameErrorRegistry>& error_registry, bool /*post_processing*/)
37 0 : : TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>(error_registry, false)
38 0 : , m_previous_ts(0)
39 0 : {}
40 :
41 : // Override config for pipeline setup
42 : void conf(const appmodel::DataHandlerModule* conf) override;
43 :
44 : protected:
45 :
46 : /**
47 : * Pipeline Stage 1.: Check proper timestamp increments in HSI frame
48 : * */
49 : void timestamp_check(frameptr /*fp*/);
50 :
51 : /**
52 : * Pipeline Stage 2.: Check for error
53 : * */
54 : void frame_error_check(frameptr /*fp*/);
55 :
56 : // Internals
57 : timestamp_t m_previous_ts;
58 :
59 : private:
60 : };
61 :
62 : } // namespace hsilibs
63 : } // namespace dunedaq
64 :
65 : #endif // HSILIBS_SRC_HSI_HSIFRAMEPROCESSOR_HPP_
|