1 #ifndef artdaq_core_Data_ContainerFragment_hh
2 #define artdaq_core_Data_ContainerFragment_hh
4 #include "artdaq-core/Data/Fragment.hh"
5 #include "cetlib/exception.h"
12 #ifndef CONTAINER_FRAGMENT_CAPACITY
13 #define CONTAINER_FRAGMENT_CAPACITY 100
19 class ContainerFragment;
111 if (index >
block_count())
throw cet::exception(
"Buffer overrun detected! ContainerFragment::at was asked for a non-existant Fragment!");
123 if (index >=
block_count())
throw cet::exception(
"Buffer overrun detected! ContainerFragment::at was asked for a non-existant Fragment!");
125 if (index == 0)
return end;
137 return this->
at(index);
148 if (index >
block_count())
throw cet::exception(
"Buffer overrun detected! ContainerFragment::at was asked for a non-existant Fragment!");
149 if (index == 0) {
return 0; }
static constexpr size_t words_per_frag_word_()
Gets the ratio between the fundamental data storage type and the representation within the Fragment...
size_t fragmentIndex(size_t index) const
Get the offset of a Fragment within the ContainerFragment.
Fragment const * dataBegin() const
Gets the start of the data.
The artdaq::ContainerFragment class represents a Fragment which contains other Fragments.
detail::RawFragmentHeader::type_t type_t
typedef for type_t from RawFragmentHeader
bool missing_data() const
Gets the flag if the ContainerFragment knows that it is missing data.
Fragment::type_t fragment_type() const
Get the Fragment::type_t of stored Fragment objects.
static const int CONTAINER_FRAGMENT_COUNT_MAX
The maximum capacity of the ContainerFragment (in fragments)
size_t lastFragmentIndex() const
Returns the offset of the last Fragment in the ContainerFragment.
Fragment const * operator[](size_t index) const
Alias to ContainerFragment::at()
iterator dataBegin()
Return an iterator to the beginning of the data payload (after header and metadata) ...
QuickVec< RawDataType >::value_type value_type
Alias value_type type from QuickVec<RawDataType>
Fragment const * dataEnd() const
Gets the last Fragment in the ContainerFragment.
ContainerFragment(Fragment const &f)
Metadata::count_t block_count() const
Gets the number of fragments stored in the ContainerFragment.
T * metadata()
Return a pointer to the metadata. This throws an exception if the Fragment contains no metadata...
Metadata const * metadata() const
const getter function for the Metadata
Fragment const * at(size_t index) const
Gets a specific Fragment from the ContainerFragment.
A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is t...
size_t fragSize(size_t index) const
Gets the size of the Fragment at the specified location in the ContainerFragment. ...