DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
datahandlinglibs
include
datahandlinglibs
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 "
daqdataformats/FragmentHeader.hpp
"
12
13
#include <cstdint>
// uint_t types
14
#include <memory>
// unique_ptr
15
#include <tuple>
// std::tie
16
17
#include <iostream>
18
19
namespace
dunedaq
{
20
namespace
datahandlinglibs
{
21
namespace
types
{
22
23
const
constexpr
std::size_t
DUMMY_FRAME_SIZE
= 1024;
24
struct
DUMMY_FRAME_STRUCT
25
{
26
using
FrameType
=
DUMMY_FRAME_STRUCT
;
27
28
// header
29
uint64_t
timestamp
;
// NOLINT(build/unsigned)
30
uint64_t
another_key
;
// NOLINT(build/unsigned)
31
32
// data
33
char
data
[
DUMMY_FRAME_SIZE
];
34
35
// comparable based on composite key (timestamp + other unique keys)
36
bool
operator<
(
const
DUMMY_FRAME_STRUCT
& other)
const
37
{
38
auto
const
& f1 = std::tie(this->timestamp, this->another_key);
39
auto
const
& f2 = std::tie(other.
timestamp
, other.
another_key
);
40
return
f1 < f2;
41
}
42
43
uint64_t
get_timestamp
() const
// NOLINT(build/unsigned)
44
{
45
return
timestamp
;
46
}
47
48
size_t
get_num_frames
()
const
{
return
frames_per_element
; }
49
50
size_t
get_frame_size
()
const
{
return
frame_size
; }
51
52
size_t
get_payload_size
()
const
{
return
get_num_frames
() *
get_frame_size
(); }
53
54
void
set_another_key
(uint64_t compkey)
55
{
56
another_key
= compkey;
57
}
58
59
void
set_timestamp
(uint64_t ts)
// NOLINT(build/unsigned)
60
{
61
timestamp
= ts;
62
}
63
64
void
fake_timestamp
(uint64_t
/*first_timestamp*/
, uint64_t
/*offset = 25*/
)
// NOLINT(build/unsigned)
65
{
66
// tp.time_start = first_timestamp;
67
}
68
69
FrameType
*
begin
() {
return
this
; }
70
71
FrameType
*
end
() {
return
(
this
+ 1); }
// NOLINT
72
73
static
const
constexpr
size_t
frame_size
=
DUMMY_FRAME_SIZE
;
74
static
const
constexpr
uint8_t
frames_per_element
= 1;
// NOLINT(build/unsigned)
75
static
const
constexpr
size_t
element_size
=
DUMMY_FRAME_SIZE
;
76
static
const
constexpr
dunedaq::daqdataformats::SourceID::Subsystem
subsystem
=
77
dunedaq::daqdataformats::SourceID::Subsystem::kUnknown
;
78
static
const
constexpr
dunedaq::daqdataformats::FragmentType
fragment_type
=
79
dunedaq::daqdataformats::FragmentType::kUnknown
;
80
static
const
constexpr
uint64_t
expected_tick_difference
= 1;
// NOLINT(build/unsigned)
81
};
82
83
}
// namespace types
84
}
// namespace datahandlinglibs
85
}
// namespace dunedaq
86
87
#endif
// DATAHANDLINGLIBS_INCLUDE_DATAHANDLINGLIBS_READOUTTYPES_HPP_
FragmentHeader.hpp
dunedaq::daqdataformats::FragmentType
FragmentType
All defined Fragment types.
Definition
FragmentHeader.hpp:114
dunedaq::daqdataformats::FragmentType::kUnknown
@ kUnknown
Definition
FragmentHeader.hpp:115
dunedaq::datahandlinglibs::types
Definition
ReadoutTypes.hpp:21
dunedaq::datahandlinglibs::types::DUMMY_FRAME_SIZE
const constexpr std::size_t DUMMY_FRAME_SIZE
Definition
ReadoutTypes.hpp:23
dunedaq::datahandlinglibs
Definition
DataHandlingConcept.hpp:16
dunedaq
Including Qt Headers.
Definition
module.cpp:16
dunedaq::daqdataformats::SourceID::Subsystem
Subsystem
The Subsystem enum describes the kind of source we're dealing with.
Definition
SourceID.hpp:40
dunedaq::daqdataformats::SourceID::Subsystem::kUnknown
@ kUnknown
Definition
SourceID.hpp:41
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT
Definition
ReadoutTypes.hpp:25
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::FrameType
DUMMY_FRAME_STRUCT FrameType
Definition
ReadoutTypes.hpp:26
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::begin
FrameType * begin()
Definition
ReadoutTypes.hpp:69
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::operator<
bool operator<(const DUMMY_FRAME_STRUCT &other) const
Definition
ReadoutTypes.hpp:36
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::get_timestamp
uint64_t get_timestamp() const
Definition
ReadoutTypes.hpp:43
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::expected_tick_difference
static const constexpr uint64_t expected_tick_difference
Definition
ReadoutTypes.hpp:80
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::get_frame_size
size_t get_frame_size() const
Definition
ReadoutTypes.hpp:50
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::end
FrameType * end()
Definition
ReadoutTypes.hpp:71
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::data
char data[DUMMY_FRAME_SIZE]
Definition
ReadoutTypes.hpp:33
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::fake_timestamp
void fake_timestamp(uint64_t, uint64_t)
Definition
ReadoutTypes.hpp:64
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::element_size
static const constexpr size_t element_size
Definition
ReadoutTypes.hpp:75
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::set_timestamp
void set_timestamp(uint64_t ts)
Definition
ReadoutTypes.hpp:59
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::subsystem
static const constexpr dunedaq::daqdataformats::SourceID::Subsystem subsystem
Definition
ReadoutTypes.hpp:76
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::get_payload_size
size_t get_payload_size() const
Definition
ReadoutTypes.hpp:52
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::fragment_type
static const constexpr dunedaq::daqdataformats::FragmentType fragment_type
Definition
ReadoutTypes.hpp:78
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::frames_per_element
static const constexpr uint8_t frames_per_element
Definition
ReadoutTypes.hpp:74
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::another_key
uint64_t another_key
Definition
ReadoutTypes.hpp:30
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::get_num_frames
size_t get_num_frames() const
Definition
ReadoutTypes.hpp:48
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::frame_size
static const constexpr size_t frame_size
Definition
ReadoutTypes.hpp:73
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::set_another_key
void set_another_key(uint64_t compkey)
Definition
ReadoutTypes.hpp:54
dunedaq::datahandlinglibs::types::DUMMY_FRAME_STRUCT::timestamp
uint64_t timestamp
Definition
ReadoutTypes.hpp:29
Generated on
for DUNE-DAQ by
1.17.0