1 #ifndef artdaq_core_Data_ContainerFragment_hh
2 #define artdaq_core_Data_ContainerFragment_hh
4 #include "artdaq-core/Data/Fragment.hh"
5 #include "cetlib_except/exception.h"
12 #ifndef CONTAINER_FRAGMENT_CAPACITY
13 #define CONTAINER_FRAGMENT_CAPACITY 100
19 class ContainerFragment;
91 return reinterpret_cast<void const *
>(&*artdaq_Fragment_.
dataBegin());
113 throw cet::exception(
"ArgumentOutOfRange") <<
"Buffer overrun detected! ContainerFragment::at was asked for a non-existent Fragment!";
130 throw cet::exception(
"ArgumentOutOfRange") <<
"Buffer overrun detected! ContainerFragment::fragSize was asked for a non-existent Fragment!";
133 if (index == 0)
return end;
145 return this->
at(index);
158 throw cet::exception(
"ArgumentOutOfRange") <<
"Buffer overrun detected! ContainerFragment::fragmentIndex was asked for a non-existent Fragment!";
160 if (index == 0) {
return 0; }
std::unique_ptr< Fragment > FragmentPtr
A std::unique_ptr to a Fragment object.
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.
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.
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>
void const * dataBegin() const
Gets the start of the data.
void 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
detail::RawFragmentHeader::RawDataType RawDataType
The RawDataType (currently a 64-bit integer) is the basic unit of data representation within artdaq ...
FragmentPtr operator[](size_t index) const
Alias to ContainerFragment::at()
A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is t...
FragmentPtr at(size_t index) const
Gets a specific Fragment from the ContainerFragment.
size_t fragSize(size_t index) const
Gets the size of the Fragment at the specified location in the ContainerFragment, in bytes...