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 "datahandlinglibs/FrameErrorRegistry.hpp"
15 : #include "datahandlinglibs/ReadoutLogging.hpp"
16 : #include "hsilibs/Types.hpp"
17 : #include "logging/Logging.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,
37 : bool /*post_processing*/)
38 0 : : TaskRawDataProcessorModel<hsilibs::HSI_FRAME_STRUCT>(error_registry, false)
39 0 : , m_previous_ts(0)
40 : {
41 0 : }
42 :
43 : // Override config for pipeline setup
44 : void conf(const appmodel::DataHandlerModule* conf) override;
45 :
46 : protected:
47 : /**
48 : * Pipeline Stage 1.: Check proper timestamp increments in HSI frame
49 : * */
50 : void timestamp_check(frameptr /*fp*/);
51 :
52 : /**
53 : * Pipeline Stage 2.: Check for error
54 : * */
55 : void frame_error_check(frameptr /*fp*/);
56 :
57 : // Internals
58 : timestamp_t m_previous_ts;
59 :
60 : private:
61 : };
62 :
63 : } // namespace hsilibs
64 : } // namespace dunedaq
65 :
66 : #endif // HSILIBS_SRC_HSI_HSIFRAMEPROCESSOR_HPP_
|