13#ifndef DAQDATAFORMATS_INCLUDE_DAQDATAFORMATS_FRAGMENT_HPP_
14#define DAQDATAFORMATS_INCLUDE_DAQDATAFORMATS_FRAGMENT_HPP_
52 inline explicit Fragment(
const std::vector<std::pair<void*, size_t>>& pieces);
71 other.m_alloc =
false;
77 other.m_alloc =
false;
252 return static_cast<void*
>(
header_() + 1);
272 std::accumulate(pieces.begin(), pieces.end(), 0ULL, [](
const size_t& a,
const std::pair<void*, size_t>& b) {
277 throw std::length_error(
"The Fragment size is smaller than the Fragment header size.");
282 throw std::bad_alloc();
291 for (
auto& piece : pieces) {
292 if (piece.first ==
nullptr) {
293 throw std::invalid_argument(
"The Fragment buffer point to NULL.");
295 memcpy(
static_cast<uint8_t*
>(
m_data_arr) +
offset, piece.first, piece.second);
313 auto header =
reinterpret_cast<FragmentHeader*
>(existing_fragment_buffer);
316 throw std::bad_alloc();
319 memcpy(
m_data_arr, existing_fragment_buffer, header->size);
349 bits[
static_cast<size_t>(bit)] = value;
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk size