|
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 { 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) | |
| Fragment constructor using existing Fragment array. | |
| FragmentHeader | get_header () const |
| void | set_header_fields (const FragmentHeader &header) |
| Fields from the provided header overwrite this Fragment's header, except for the size field. | |
| const void * | get_storage_location () const |
| Get read-only access to the Fragment's underlying data array via a pointer. | |
| trigger_number_t | get_trigger_number () const |
| void | set_trigger_number (trigger_number_t trigger_number) |
| run_number_t | get_run_number () const |
| void | set_run_number (run_number_t run_number) |
| timestamp_t | get_trigger_timestamp () const |
| void | set_trigger_timestamp (timestamp_t trigger_timestamp) |
| timestamp_t | get_window_begin () const |
| void | set_window_begin (timestamp_t window_begin) |
| timestamp_t | get_window_end () const |
| void | set_window_end (timestamp_t window_end) |
| 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 |
| void | set_detector_id (const uint16_t &detector_id) noexcept |
| std::bitset< 32 > | get_status_bits () const |
| Get the status_bits header field. | |
| void | set_status_bits (std::bitset< 32 > status_bits) |
| Overwrite the status_bits header field. | |
| bool | get_status_bit (FragmentStatusBits bit) const |
| Get the value of a designated status bit. | |
| void | set_status_bit (FragmentStatusBits bit, bool value) |
| Set the designated status 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 |
| void | set_sequence_number (sequence_number_t number) |
| fragment_size_t | get_size () const |
| Get the total size of the Fragment in bytes, including header and all payload pieces. | |
| fragment_size_t | get_data_size () const |
| Get the size of the Fragment payload in bytes (total size minus FragmentHeader). | |
| void * | get_data () const |
| Get a pointer to the data payload in the Fragmnet. | |
| Fragment (Fragment const &)=delete | |
| Fragment & | operator= (Fragment const &)=delete |
| Fragment (Fragment &&other) | |
| Fragment & | operator= (Fragment &&other) |
| ~Fragment () | |
Private Member Functions | |
| FragmentHeader * | header_ () const |
Private Attributes | |
| void * | m_data_arr { nullptr } |
| Points to 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 | |
|---|---|
| kTakeOverBuffer | Take over control of the buffer. |
| kCopyFromBuffer | Copy the contents of the buffer into a new Fragment array. |
Definition at line 41 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 183 of file Fragment.hpp.
|
inline |
Fragment constructor using a buffer and size.
Definition at line 213 of file Fragment.hpp.
|
inlineexplicit |
Fragment 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 218 of file Fragment.hpp.
|
delete |
|
inline |
Definition at line 161 of file Fragment.hpp.
|
inline |
Definition at line 234 of file Fragment.hpp.
|
inline |
Get a pointer to the data payload in the Fragmnet.
Definition at line 153 of file Fragment.hpp.
|
inline |
Get the size of the Fragment payload in bytes (total size minus FragmentHeader).
Definition at line 150 of file Fragment.hpp.
|
inlinenoexcept |
Definition at line 100 of file Fragment.hpp.
|
inline |
Get the SourceID for the Fragment.
Definition at line 92 of file Fragment.hpp.
|
inline |
Get the fragment_type header field.
Definition at line 136 of file Fragment.hpp.
|
inline |
Get the fragment_type_t value stored in the header.
Definition at line 131 of file Fragment.hpp.
|
inline |
Definition at line 65 of file Fragment.hpp.
|
inline |
Definition at line 76 of file Fragment.hpp.
|
inline |
Definition at line 143 of file Fragment.hpp.
|
inline |
Get the total size of the Fragment in bytes, including header and all payload pieces.
Definition at line 147 of file Fragment.hpp.
|
inline |
Get the value of a designated status bit.
| bit | Bit to query |
Definition at line 118 of file Fragment.hpp.
|
inline |
Get the status_bits header field.
Definition at line 107 of file Fragment.hpp.
|
inline |
Get read-only access to the Fragment's underlying data array via a pointer.
Definition at line 71 of file Fragment.hpp.
|
inline |
Definition at line 73 of file Fragment.hpp.
|
inline |
Definition at line 79 of file Fragment.hpp.
|
inline |
Definition at line 82 of file Fragment.hpp.
|
inline |
Definition at line 85 of file Fragment.hpp.
|
inlineprivate |
Definition at line 178 of file Fragment.hpp.
Definition at line 167 of file Fragment.hpp.
|
inlinenoexcept |
Definition at line 101 of file Fragment.hpp.
|
inline |
Set the SourceID for the Fragment.
| element_id | SourceID to use as element_id |
Definition at line 98 of file Fragment.hpp.
|
inline |
Fields from the provided header overwrite this Fragment's header, except for the size field.
Definition at line 241 of file Fragment.hpp.
|
inline |
Definition at line 77 of file Fragment.hpp.
|
inline |
Definition at line 144 of file Fragment.hpp.
|
inline |
Set the designated status bit.
| bit | Bit to set |
| value | Value (true/false) for the status bit |
Definition at line 251 of file Fragment.hpp.
|
inline |
Overwrite the status_bits header field.
| status_bits | Bitset of status bits to set |
Definition at line 112 of file Fragment.hpp.
|
inline |
Definition at line 74 of file Fragment.hpp.
|
inline |
Definition at line 80 of file Fragment.hpp.
|
inline |
Set the fragment_type header field.
| fragment_type | Value to set |
Definition at line 141 of file Fragment.hpp.
|
inline |
Definition at line 83 of file Fragment.hpp.
|
inline |
Definition at line 86 of file Fragment.hpp.
|
private |
Whether the Fragment owns the memory pointed by m_data_arr.
Definition at line 180 of file Fragment.hpp.
|
private |
Points to flat memory containing a FragmentHeader and the data payload.
Definition at line 179 of file Fragment.hpp.