DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Types.hpp
Go to the documentation of this file.
1/*
2 * @file Types.hpp
3 *
4 * Contains declaration of HSI_FRAME_STRUCT.
5 *
6 * This is part of the DUNE DAQ Application Framework, copyright 2020.
7 * Licensing/copyright details are in the COPYING file that you should have
8 * received with this code.
9 */
10
11#ifndef HSILIBS_INCLUDE_HSILIBS_TYPES_HPP_
12#define HSILIBS_INCLUDE_HSILIBS_TYPES_HPP_
13
18
19#include <algorithm> // For std::min
20#include <cassert> // For assert()
21#include <cstdio>
22#include <cstdlib>
23#include <stdexcept> // For std::out_of_range
24#include <stdint.h> // For uint32_t etc
25
26namespace dunedaq {
27namespace hsilibs {
28
33const constexpr std::size_t HSI_FRAME_STRUCT_SIZE = 28;
34
36{
37public:
39
41
42 // comparable based on start timestamp
43 bool operator<(const FrameType& other) const
44 {
45 return this->get_timestamp() < other.get_timestamp() ? true : false;
46 }
47
48 uint64_t get_timestamp() const // NOLINT(build/unsigned)
49 {
50 return frame.get_timestamp(); // NOLINT
51 }
52
53 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
54 {
56 }
57
58 void fake_timestamps(uint64_t first_timestamp, uint64_t /*offset*/= 0 ) // NOLINT(build/unsigned)
59 {
60 frame.set_timestamp(first_timestamp);
61 }
62
63 FrameType* begin() { return this; }
64
65 FrameType* end() { return (this + 1); } // NOLINT
66
68
69 size_t get_num_frames() { return 1; }
70
72
76 static const constexpr uint64_t expected_tick_difference = 1; // NOLINT(build/unsigned)
77};
78
79static_assert(sizeof(struct HSI_FRAME_STRUCT) == HSI_FRAME_STRUCT_SIZE,
80 "Check your assumptions on HSI_FRAME_STRUCT");
81
82} // namespace hsilibs
83
85
86} // namespace dunedaq
87
88#endif // HSILIBS_INCLUDE_HSILIBS_TYPES_HPP_
89
90// Local Variables:
91// c-basic-offset: 2
92// End:
#define DUNE_DAQ_TYPESTRING(Type, typestring)
void set_timestamp(uint64_t ts)
Definition HSIFrame.hpp:37
static const constexpr uint64_t expected_tick_difference
Definition Types.hpp:76
bool operator<(const FrameType &other) const
Definition Types.hpp:43
uint64_t get_timestamp() const
Definition Types.hpp:48
dunedaq::detdataformats::HSIFrame frame
Definition Types.hpp:40
void set_timestamp(uint64_t ts)
Definition Types.hpp:53
void fake_timestamps(uint64_t first_timestamp, uint64_t=0)
Definition Types.hpp:58
static const constexpr daqdataformats::FragmentType fragment_type
Definition Types.hpp:75
static const constexpr daqdataformats::SourceID::Subsystem subsystem
Definition Types.hpp:73
FragmentType
This enumeration should list all defined Fragment types.
const constexpr std::size_t HSI_FRAME_STRUCT_SIZE
For HSI the numbers are different. 1[HSI frames] x 24[Bytes] = 24[Bytes].
Definition Types.hpp:33
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ts
Subsystem
The Subsystem enum describes the kind of source we're dealing with.
Definition SourceID.hpp:43