DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ReadoutTypes.hpp
Go to the documentation of this file.
1
8#ifndef DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_READOUTTYPES_HPP_
9#define DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_READOUTTYPES_HPP_
10
11#include <cstdint> // uint_t types
12#include <memory> // unique_ptr
13#include <tuple> // std::tie
14
15#include <iostream>
16
17namespace dunedaq {
18namespace datahandlinglibs {
19namespace types {
20
21const constexpr std::size_t DUMMY_FRAME_SIZE = 1024;
23{
25
26 // header
27 uint64_t timestamp; // NOLINT(build/unsigned)
28 uint64_t another_key; // NOLINT(build/unsigned)
29
30 // data
32
33 // comparable based on composite key (timestamp + other unique keys)
34 bool operator<(const DUMMY_FRAME_STRUCT& other) const
35 {
36 auto const & f1 = std::tie(this->timestamp, this->another_key);
37 auto const & f2 = std::tie(other.timestamp, other.another_key);
38 return f1 < f2;
39 }
40
41 uint64_t get_timestamp() const // NOLINT(build/unsigned)
42 {
43 return timestamp;
44 }
45
46 void set_another_key(uint64_t compkey)
47 {
48 another_key = compkey;
49 }
50
51 void set_timestamp(uint64_t ts) // NOLINT(build/unsigned)
52 {
53 timestamp = ts;
54 }
55
56 void fake_timestamp(uint64_t /*first_timestamp*/, uint64_t /*offset = 25*/) // NOLINT(build/unsigned)
57 {
58 // tp.time_start = first_timestamp;
59 }
60
61 FrameType* begin() { return this; }
62
63 FrameType* end() { return (this + 1); } // NOLINT
64
65 static const constexpr size_t frame_size = DUMMY_FRAME_SIZE;
66 static const constexpr uint8_t frames_per_element = 1; // NOLINT(build/unsigned)
67 static const constexpr size_t element_size = DUMMY_FRAME_SIZE;
68};
69
70} // namespace types
71} // namespace datahandlinglibs
72} // namespace dunedaq
73
74#endif // DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_READOUTTYPES_HPP_
const constexpr std::size_t DUMMY_FRAME_SIZE
Including Qt Headers.
PDS Frame with unphysical timestamp detected with ts
bool operator<(const DUMMY_FRAME_STRUCT &other) const