12 #ifndef EVIO_6_0_RECORDHEADER_H
13 #define EVIO_6_0_RECORDHEADER_H
187 static uint32_t padValue[4];
257 static const uint32_t COMP_PADDING_MASK = 0x03000000;
259 static const uint32_t DATA_PADDING_MASK = 0x00C00000;
261 static const uint32_t USER_PADDING_MASK = 0x00300000;
263 static const uint32_t HEADER_TYPE_MASK = 0xF0000000;
268 uint64_t recordUserRegisterFirst = 0ULL;
270 uint64_t recordUserRegisterSecond = 0ULL;
272 size_t position = 0ULL;
274 uint32_t recordLength = 0;
276 uint32_t recordLengthWords = 0;
278 uint32_t recordNumber = 1;
282 uint32_t entries = 0;
284 uint32_t bitInfo = 0;
290 uint32_t eventType = 0;
296 uint32_t userHeaderLength = 0;
298 uint32_t userHeaderLengthWords = 0;
300 uint32_t indexLength = 0;
302 uint32_t dataLength = 0;
304 uint32_t dataLengthWords = 0;
306 uint32_t compressedDataLength = 0;
308 uint32_t compressedDataLengthWords = 0;
311 uint32_t headerVersion = 6;
318 uint32_t userHeaderLengthPadding = 0;
322 uint32_t dataLengthPadding = 0;
326 uint32_t compressedDataLengthPadding = 0;
352 void decodeBitInfoWord(uint32_t word);
356 void copy(std::shared_ptr<RecordHeader>
const & head);
359 static uint32_t
getWords(uint32_t length);
398 bool isEnd, uint32_t eventType);
401 uint32_t headerType = 0);
445 void writeHeader(ByteBuffer & buf,
size_t off = 0);
446 void writeHeader(std::shared_ptr<ByteBuffer> & buffer,
size_t off = 0);
447 void writeHeader(uint8_t *array,
const ByteOrder & order);
450 static void writeTrailer(uint8_t* array,
size_t arrayLen,
451 uint32_t recordNum,
const ByteOrder & order,
452 const std::shared_ptr<std::vector<uint32_t>> & recordLengths =
nullptr);
454 static void writeTrailer(std::vector<uint8_t> & array,
size_t off,
455 uint32_t recordNum,
const ByteOrder & order,
456 const std::shared_ptr<std::vector<uint32_t>> & recordLengths =
nullptr);
458 static void writeTrailer(ByteBuffer & buf,
size_t off, uint32_t recordNum,
459 const std::shared_ptr<std::vector<uint32_t>> & recordLengths =
nullptr);
461 static void writeTrailer(std::shared_ptr<ByteBuffer> & buf,
size_t off, uint32_t recordNum,
462 const std::shared_ptr<std::vector<uint32_t>> & recordLengths =
nullptr);
465 static bool isCompressed(ByteBuffer & buffer,
size_t offset);
466 static bool isCompressed(std::shared_ptr<ByteBuffer> & buffer,
size_t offset);
469 void readHeader(ByteBuffer & buffer,
size_t offset = 0);
470 void readHeader(std::shared_ptr<ByteBuffer> & buffer,
size_t offset = 0);
471 void readHeader(uint8_t *src, ByteOrder order);
490 size_t write(ByteBuffer & byteBuffer)
override;
503 int main(
int argc,
char **argv);
510 #endif //EVIO_6_0_RECORDHEADER_H
CompressionType
Enum of supported data compression types.
Definition: Compressor.h:65
Numerical values associated with endian byte order.
Definition: ByteOrder.h:53
Definition: Compressor.h:66
static const ByteOrder ENDIAN_LOCAL
Local host's byte order.
Definition: ByteOrder.h:61