DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
C++ Representation of a DUNE Fragment, wrapping the flat byte array that is the Fragment's "actual" form. More...
#include <Fragment.hpp>
Public Types | |
enum class | BufferAdoptionMode { kReadOnlyMode , kTakeOverBuffer , kCopyFromBuffer } |
Describes how the "existing Fragment buffer" Constructor should treat the given buffer. More... | |
Public Member Functions | |
Fragment (const std::vector< std::pair< void *, size_t > > &pieces) | |
Fragment constructor using a vector of buffer pointers. | |
Fragment (void *buffer, size_t size) | |
Fragment constructor using a buffer and size. | |
Fragment (void *existing_fragment_buffer, BufferAdoptionMode adoption_mode) | |
Framgnet constructor using existing Fragment array. | |
Fragment (Fragment const &)=delete | |
Fragment copy constructor is deleted. | |
Fragment & | operator= (Fragment const &)=delete |
Fragment copy assignment operator is deleted. | |
Fragment (Fragment &&other) | |
Fragment & | operator= (Fragment &&other) |
~Fragment () | |
Fragment destructor. | |
FragmentHeader | get_header () const |
Get a copy of the FragmentHeader struct. | |
void | set_header_fields (const FragmentHeader &header) |
Copy fields from the provided header in this Fragment's header. | |
const void * | get_storage_location () const |
Get a pointer to the Fragment's data array to read its contents directly. | |
trigger_number_t | get_trigger_number () const |
Get the trigger_number field from the header. | |
void | set_trigger_number (trigger_number_t trigger_number) |
Set the trigger_number for the Fragment. | |
run_number_t | get_run_number () const |
Get the run_number field from the header. | |
void | set_run_number (run_number_t run_number) |
Set the run_number for the Fragment. | |
timestamp_t | get_trigger_timestamp () const |
Get the trigger_timestamp field from the header. | |
void | set_trigger_timestamp (timestamp_t trigger_timestamp) |
Set the trigger_timestamp for the Fragment. | |
timestamp_t | get_window_begin () const |
Get the window_begin field from the header. | |
void | set_window_begin (timestamp_t window_begin) |
Set the window_begin for the Fragment. | |
timestamp_t | get_window_end () const |
Get the window_end field from the header. | |
void | set_window_end (timestamp_t window_end) |
Set the window_end for the Fragment. | |
SourceID | get_element_id () const |
Get the SourceID for the Fragment. | |
void | set_element_id (SourceID element_id) |
Set the SourceID for the Fragment. | |
uint16_t | get_detector_id () const noexcept |
Get the DetID for the Fragment. | |
void | set_detector_id (const uint16_t &detector_id) noexcept |
Set the DetID for the Fragment. | |
std::bitset< 32 > | get_error_bits () const |
Get the error_bits header field. | |
void | set_error_bits (std::bitset< 32 > error_bits) |
Overwrite the error_bits header field. | |
bool | get_error_bit (FragmentErrorBits bit) const |
Get the value of a designated error bit. | |
void | set_error_bit (FragmentErrorBits bit, bool value) |
Set the designated error bit. | |
fragment_type_t | get_fragment_type_code () const |
Get the fragment_type_t value stored in the header. | |
FragmentType | get_fragment_type () const |
Get the fragment_type header field. | |
void | set_type (FragmentType fragment_type) |
Set the fragment_type header field. | |
sequence_number_t | get_sequence_number () const |
Get the sequence_number field from the header. | |
void | set_sequence_number (sequence_number_t number) |
Set the sequence_number for the Fragment. | |
fragment_size_t | get_size () const |
Get the total size of the Fragment. | |
fragment_size_t | get_data_size () const |
Get the size of the Fragment data. | |
void * | get_data () const |
Get a pointer to the data payload in the Fragmnet. | |
Private Member Functions | |
FragmentHeader * | header_ () const |
Get the FragmentHeader from the m_data_arr array. | |
Private Attributes | |
void * | m_data_arr { nullptr } |
Flat memory containing a FragmentHeader and the data payload. | |
bool | m_alloc { false } |
Whether the Fragment owns the memory pointed by m_data_arr. | |
C++ Representation of a DUNE Fragment, wrapping the flat byte array that is the Fragment's "actual" form.
Definition at line 37 of file Fragment.hpp.
|
strong |
Describes how the "existing Fragment buffer" Constructor should treat the given buffer.
Enumerator | |
---|---|
kReadOnlyMode | Just use the buffer in non-owning mode. |
kTakeOverBuffer | Take over control of the buffer. |
kCopyFromBuffer | Copy the contents of the buffer into a new Fragment array. |
Definition at line 43 of file Fragment.hpp.
|
inlineexplicit |
Fragment constructor using a vector of buffer pointers.
pieces | Vector of pairs of pointer/size pairs used to initialize Fragment payload |
Definition at line 272 of file Fragment.hpp.
|
inline |
Fragment constructor using a buffer and size.
buffer | Pointer to Fragment payload |
size | Size of payload |
Definition at line 302 of file Fragment.hpp.
|
inlineexplicit |
Framgnet constructor using existing Fragment array.
existing_fragment_buffer | Pointer to existing Fragment array |
adoption_mode | How the constructor should treat the existing_fragment_buffer |
Definition at line 306 of file Fragment.hpp.
|
delete |
Fragment copy constructor is deleted.
|
inline |
Definition at line 70 of file Fragment.hpp.
|
inline |
Fragment destructor.
Definition at line 324 of file Fragment.hpp.
|
inline |
Get a pointer to the data payload in the Fragmnet.
Definition at line 254 of file Fragment.hpp.
|
inline |
Get the size of the Fragment data.
Definition at line 248 of file Fragment.hpp.
|
inlinenoexcept |
Get the DetID for the Fragment.
Definition at line 177 of file Fragment.hpp.
|
inline |
Get the SourceID for the Fragment.
Definition at line 164 of file Fragment.hpp.
|
inline |
Get the value of a designated error bit.
bit | Bit to query |
Definition at line 202 of file Fragment.hpp.
|
inline |
Get the error_bits header field.
Definition at line 191 of file Fragment.hpp.
|
inline |
Get the fragment_type header field.
Definition at line 220 of file Fragment.hpp.
|
inline |
Get the fragment_type_t value stored in the header.
Definition at line 215 of file Fragment.hpp.
|
inline |
Get a copy of the FragmentHeader struct.
Definition at line 92 of file Fragment.hpp.
|
inline |
Get the run_number field from the header.
Definition at line 122 of file Fragment.hpp.
|
inline |
Get the sequence_number field from the header.
Definition at line 231 of file Fragment.hpp.
|
inline |
|
inline |
Get a pointer to the Fragment's data array to read its contents directly.
Definition at line 105 of file Fragment.hpp.
|
inline |
Get the trigger_number field from the header.
Definition at line 112 of file Fragment.hpp.
|
inline |
Get the trigger_timestamp field from the header.
Definition at line 133 of file Fragment.hpp.
|
inline |
Get the window_begin field from the header.
Definition at line 143 of file Fragment.hpp.
|
inline |
Get the window_end field from the header.
Definition at line 153 of file Fragment.hpp.
|
inlineprivate |
Get the FragmentHeader from the m_data_arr array.
Definition at line 265 of file Fragment.hpp.
Definition at line 76 of file Fragment.hpp.
Fragment copy assignment operator is deleted.
|
inlinenoexcept |
Set the DetID for the Fragment.
detector_id | DetID to use as the detector_id |
Definition at line 184 of file Fragment.hpp.
|
inline |
Set the SourceID for the Fragment.
element_id | SourceID to use as element_id |
Definition at line 170 of file Fragment.hpp.
|
inline |
Set the designated error bit.
bit | Bit to set |
value | Value (true/false) for the error bit |
Definition at line 346 of file Fragment.hpp.
|
inline |
Overwrite the error_bits header field.
error_bits | Bitset of error bits to set |
Definition at line 196 of file Fragment.hpp.
|
inline |
Copy fields from the provided header in this Fragment's header.
header | Header to copy into the Fragment data array |
The size FragmentHeader field is not copied from the given FragmentHeader
Definition at line 331 of file Fragment.hpp.
|
inline |
Set the run_number for the Fragment.
run_number | Value of run_number to set |
Definition at line 127 of file Fragment.hpp.
|
inline |
Set the sequence_number for the Fragment.
sequence_number | Value of sequence_number to set |
Definition at line 236 of file Fragment.hpp.
|
inline |
Set the trigger_number for the Fragment.
trigger_number | Value of trigger_number to set |
Definition at line 117 of file Fragment.hpp.
|
inline |
Set the trigger_timestamp for the Fragment.
trigger_timestamp | Value of trigger_timestamp to set |
Definition at line 138 of file Fragment.hpp.
|
inline |
Set the fragment_type header field.
fragment_type | Value to set |
Definition at line 225 of file Fragment.hpp.
|
inline |
Set the window_begin for the Fragment.
window_begin | Value of the window_begin to set |
Definition at line 148 of file Fragment.hpp.
|
inline |
Set the window_end for the Fragment.
window_end | Value of the window_end to set |
Definition at line 158 of file Fragment.hpp.
|
private |
Whether the Fragment owns the memory pointed by m_data_arr.
Definition at line 267 of file Fragment.hpp.
|
private |
Flat memory containing a FragmentHeader and the data payload.
Definition at line 266 of file Fragment.hpp.