Logo ROOT  
Reference Guide
ROOT::Experimental::Internal::RNTupleSerializer Class Reference

A helper class for serializing and deserialization of the RNTuple binary format.

All serialization and deserialization routines return the number of bytes processed (written or read).

The serialization routines can be called with a nullptr buffer, in which case only the size required to perform a serialization is returned. Deserialization routines must be called with a buffer that is sufficiently large.

Deserialization errors throw exceptions. Only when indicated or when passed as a parameter is the buffer size checked.

Definition at line 54 of file RNTupleSerialize.hxx.

Classes

struct  RClusterGroup
 
struct  RClusterSummary
 
class  RContext
 The serialization context is used for the piecewise serialization of a descriptor. More...
 
struct  REnvelopeLink
 

Static Public Member Functions

static RResult< std::uint32_t > DeserializeClusterGroup (const void *buffer, std::uint32_t bufSize, RClusterGroup &clusterGroup)
 
static RResult< std::uint32_t > DeserializeClusterSummary (const void *buffer, std::uint32_t bufSize, RClusterSummary &clusterSummary)
 
static RResult< std::uint16_t > DeserializeColumnType (const void *buffer, ROOT::Experimental::EColumnType &type)
 
static RResult< std::uint32_t > DeserializeEnvelope (const void *buffer, std::uint32_t bufSize)
 
static RResult< std::uint32_t > DeserializeEnvelope (const void *buffer, std::uint32_t bufSize, std::uint32_t &crc32)
 Currently all enevelopes have the same version number (1). More...
 
static RResult< std::uint32_t > DeserializeEnvelopeLink (const void *buffer, std::uint32_t bufSize, REnvelopeLink &envelopeLink)
 
static RResult< std::uint32_t > DeserializeFeatureFlags (const void *buffer, std::uint32_t bufSize, std::vector< std::int64_t > &flags)
 
static RResult< std::uint16_t > DeserializeFieldStructure (const void *buffer, ROOT::Experimental::ENTupleStructure &structure)
 
static RResult< void > DeserializeFooterV1 (const void *buffer, std::uint32_t bufSize, RNTupleDescriptorBuilder &descBuilder)
 
static RResult< std::uint32_t > DeserializeFrameHeader (const void *buffer, std::uint32_t bufSize, std::uint32_t &frameSize)
 
static RResult< std::uint32_t > DeserializeFrameHeader (const void *buffer, std::uint32_t bufSize, std::uint32_t &frameSize, std::uint32_t &nitems)
 
static RResult< void > DeserializeHeaderV1 (const void *buffer, std::uint32_t bufSize, RNTupleDescriptorBuilder &descBuilder)
 
static std::uint32_t DeserializeInt16 (const void *buffer, std::int16_t &val)
 
static std::uint32_t DeserializeInt32 (const void *buffer, std::int32_t &val)
 
static std::uint32_t DeserializeInt64 (const void *buffer, std::int64_t &val)
 
static RResult< std::uint32_t > DeserializeLocator (const void *buffer, std::uint32_t bufSize, RNTupleLocator &locator)
 
static RResult< void > DeserializePageListV1 (const void *buffer, std::uint32_t bufSize, std::vector< RClusterDescriptorBuilder > &clusters)
 
static RResult< std::uint32_t > DeserializeString (const void *buffer, std::uint32_t bufSize, std::string &val)
 
static std::uint32_t DeserializeUInt16 (const void *buffer, std::uint16_t &val)
 
static std::uint32_t DeserializeUInt32 (const void *buffer, std::uint32_t &val)
 
static std::uint32_t DeserializeUInt64 (const void *buffer, std::uint64_t &val)
 
static std::uint32_t SerializeClusterGroup (const RClusterGroup &clusterGroup, void *buffer)
 
static std::uint32_t SerializeClusterSummary (const RClusterSummary &clusterSummary, void *buffer)
 
static std::uint16_t SerializeColumnType (ROOT::Experimental::EColumnType type, void *buffer)
 
static std::uint32_t SerializeCRC32 (const unsigned char *data, std::uint32_t length, std::uint32_t &crc32, void *buffer)
 Writes a CRC32 checksum of the byte range given by data and length. More...
 
static std::uint32_t SerializeEnvelopeLink (const REnvelopeLink &envelopeLink, void *buffer)
 
static std::uint32_t SerializeEnvelopePostscript (const unsigned char *envelope, std::uint32_t size, std::uint32_t &crc32, void *buffer)
 
static std::uint32_t SerializeEnvelopePostscript (const unsigned char *envelope, std::uint32_t size, void *buffer)
 
static std::uint32_t SerializeEnvelopePreamble (void *buffer)
 Currently all enevelopes have the same version number (1). More...
 
static std::uint32_t SerializeFeatureFlags (const std::vector< std::int64_t > &flags, void *buffer)
 
static std::uint16_t SerializeFieldStructure (ROOT::Experimental::ENTupleStructure structure, void *buffer)
 While we could just interpret the enums as ints, we make the translation explicit in order to avoid accidentally changing the on-disk numbers when adjusting the enum classes. More...
 
static std::uint32_t SerializeFooterV1 (void *buffer, const RNTupleDescriptor &desc, const RContext &context)
 
static std::uint32_t SerializeFramePostscript (void *frame, std::int32_t size)
 
static RContext SerializeHeaderV1 (void *buffer, const RNTupleDescriptor &desc)
 
static std::uint32_t SerializeInt16 (std::int16_t val, void *buffer)
 
static std::uint32_t SerializeInt32 (std::int32_t val, void *buffer)
 
static std::uint32_t SerializeInt64 (std::int64_t val, void *buffer)
 
static std::uint32_t SerializeListFramePreamble (std::uint32_t nitems, void *buffer)
 
static std::uint32_t SerializeLocator (const RNTupleLocator &locator, void *buffer)
 
static std::uint32_t SerializePageListV1 (void *buffer, const RNTupleDescriptor &desc, std::span< DescriptorId_t > physClusterIDs, const RContext &context)
 
static std::uint32_t SerializeRecordFramePreamble (void *buffer)
 
static std::uint32_t SerializeString (const std::string &val, void *buffer)
 
static std::uint32_t SerializeUInt16 (std::uint16_t val, void *buffer)
 
static std::uint32_t SerializeUInt32 (std::uint32_t val, void *buffer)
 
static std::uint32_t SerializeUInt64 (std::uint64_t val, void *buffer)
 
static RResult< void > VerifyCRC32 (const unsigned char *data, std::uint32_t length)
 
static RResult< void > VerifyCRC32 (const unsigned char *data, std::uint32_t length, std::uint32_t &crc32)
 Expects a CRC32 checksum in the 4 bytes following data + length and verifies it. More...
 

Static Public Attributes

static constexpr std::uint16_t kEnvelopeCurrentVersion = 1
 In order to handle changes to the serialization routine in future ntuple versions. More...
 
static constexpr std::uint16_t kEnvelopeMinVersion = 1
 
static constexpr std::uint32_t kFlagNonNegativeColumn = 0x04
 
static constexpr std::uint16_t kFlagRepetitiveField = 0x01
 
static constexpr std::uint32_t kFlagSortAscColumn = 0x01
 
static constexpr std::uint32_t kFlagSortDesColumn = 0x02
 
static constexpr std::uint32_t kReleaseCandidateTag = 1
 
static constexpr DescriptorId_t kZeroFieldId = std::uint64_t(-2)
 

#include <ROOT/RNTupleSerialize.hxx>

Member Function Documentation

◆ DeserializeClusterGroup()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeClusterGroup ( const void *  buffer,
std::uint32_t  bufSize,
RClusterGroup clusterGroup 
)
static

Definition at line 993 of file RNTupleSerialize.cxx.

◆ DeserializeClusterSummary()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeClusterSummary ( const void *  buffer,
std::uint32_t  bufSize,
RClusterSummary clusterSummary 
)
static

Definition at line 941 of file RNTupleSerialize.cxx.

◆ DeserializeColumnType()

RResult< std::uint16_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeColumnType ( const void *  buffer,
ROOT::Experimental::EColumnType type 
)
static

Definition at line 541 of file RNTupleSerialize.cxx.

◆ DeserializeEnvelope() [1/2]

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeEnvelope ( const void *  buffer,
std::uint32_t  bufSize 
)
static

Definition at line 701 of file RNTupleSerialize.cxx.

◆ DeserializeEnvelope() [2/2]

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeEnvelope ( const void *  buffer,
std::uint32_t  bufSize,
std::uint32_t &  crc32 
)
static

Currently all enevelopes have the same version number (1).

At a later point, different envelope types may have different version numbers

Definition at line 670 of file RNTupleSerialize.cxx.

◆ DeserializeEnvelopeLink()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeEnvelopeLink ( const void *  buffer,
std::uint32_t  bufSize,
REnvelopeLink envelopeLink 
)
static

Definition at line 902 of file RNTupleSerialize.cxx.

◆ DeserializeFeatureFlags()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeFeatureFlags ( const void *  buffer,
std::uint32_t  bufSize,
std::vector< std::int64_t > &  flags 
)
static

Definition at line 811 of file RNTupleSerialize.cxx.

◆ DeserializeFieldStructure()

RResult< std::uint16_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeFieldStructure ( const void *  buffer,
ROOT::Experimental::ENTupleStructure structure 
)
static

Definition at line 612 of file RNTupleSerialize.cxx.

◆ DeserializeFooterV1()

ROOT::Experimental::RResult< void > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeFooterV1 ( const void *  buffer,
std::uint32_t  bufSize,
RNTupleDescriptorBuilder descBuilder 
)
static

Definition at line 1338 of file RNTupleSerialize.cxx.

◆ DeserializeFrameHeader() [1/2]

ROOT::Experimental::RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeFrameHeader ( const void *  buffer,
std::uint32_t  bufSize,
std::uint32_t &  frameSize 
)
static

Definition at line 781 of file RNTupleSerialize.cxx.

◆ DeserializeFrameHeader() [2/2]

ROOT::Experimental::RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeFrameHeader ( const void *  buffer,
std::uint32_t  bufSize,
std::uint32_t &  frameSize,
std::uint32_t &  nitems 
)
static

Definition at line 750 of file RNTupleSerialize.cxx.

◆ DeserializeHeaderV1()

ROOT::Experimental::RResult< void > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeHeaderV1 ( const void *  buffer,
std::uint32_t  bufSize,
RNTupleDescriptorBuilder descBuilder 
)
static

Definition at line 1178 of file RNTupleSerialize.cxx.

◆ DeserializeInt16()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeInt16 ( const void *  buffer,
std::int16_t &  val 
)
static

Definition at line 393 of file RNTupleSerialize.cxx.

◆ DeserializeInt32()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeInt32 ( const void *  buffer,
std::int32_t &  val 
)
static

Definition at line 422 of file RNTupleSerialize.cxx.

◆ DeserializeInt64()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeInt64 ( const void *  buffer,
std::int64_t &  val 
)
static

Definition at line 456 of file RNTupleSerialize.cxx.

◆ DeserializeLocator()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeLocator ( const void *  buffer,
std::uint32_t  bufSize,
RNTupleLocator locator 
)
static

Definition at line 856 of file RNTupleSerialize.cxx.

◆ DeserializePageListV1()

ROOT::Experimental::RResult< void > ROOT::Experimental::Internal::RNTupleSerializer::DeserializePageListV1 ( const void *  buffer,
std::uint32_t  bufSize,
std::vector< RClusterDescriptorBuilder > &  clusters 
)
static

Definition at line 1446 of file RNTupleSerialize.cxx.

◆ DeserializeString()

RResult< std::uint32_t > ROOT::Experimental::Internal::RNTupleSerializer::DeserializeString ( const void *  buffer,
std::uint32_t  bufSize,
std::string &  val 
)
static

Definition at line 486 of file RNTupleSerialize.cxx.

◆ DeserializeUInt16()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeUInt16 ( const void *  buffer,
std::uint16_t &  val 
)
static

Definition at line 405 of file RNTupleSerialize.cxx.

◆ DeserializeUInt32()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeUInt32 ( const void *  buffer,
std::uint32_t &  val 
)
static

Definition at line 435 of file RNTupleSerialize.cxx.

◆ DeserializeUInt64()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::DeserializeUInt64 ( const void *  buffer,
std::uint64_t &  val 
)
static

Definition at line 471 of file RNTupleSerialize.cxx.

◆ SerializeClusterGroup()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeClusterGroup ( const RClusterGroup clusterGroup,
void *  buffer 
)
static

Definition at line 976 of file RNTupleSerialize.cxx.

◆ SerializeClusterSummary()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeClusterSummary ( const RClusterSummary clusterSummary,
void *  buffer 
)
static

Definition at line 919 of file RNTupleSerialize.cxx.

◆ SerializeColumnType()

std::uint16_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeColumnType ( ROOT::Experimental::EColumnType  type,
void *  buffer 
)
static

Definition at line 506 of file RNTupleSerialize.cxx.

◆ SerializeCRC32()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeCRC32 ( const unsigned char *  data,
std::uint32_t  length,
std::uint32_t &  crc32,
void *  buffer 
)
static

Writes a CRC32 checksum of the byte range given by data and length.

Definition at line 352 of file RNTupleSerialize.cxx.

◆ SerializeEnvelopeLink()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeEnvelopeLink ( const REnvelopeLink envelopeLink,
void *  buffer 
)
static

Definition at line 893 of file RNTupleSerialize.cxx.

◆ SerializeEnvelopePostscript() [1/2]

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeEnvelopePostscript ( const unsigned char *  envelope,
std::uint32_t  size,
std::uint32_t &  crc32,
void *  buffer 
)
static

Definition at line 655 of file RNTupleSerialize.cxx.

◆ SerializeEnvelopePostscript() [2/2]

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeEnvelopePostscript ( const unsigned char *  envelope,
std::uint32_t  size,
void *  buffer 
)
static

Definition at line 661 of file RNTupleSerialize.cxx.

◆ SerializeEnvelopePreamble()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeEnvelopePreamble ( void *  buffer)
static

Currently all enevelopes have the same version number (1).

At a later point, different envelope types may have different version numbers

Definition at line 643 of file RNTupleSerialize.cxx.

◆ SerializeFeatureFlags()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeFeatureFlags ( const std::vector< std::int64_t > &  flags,
void *  buffer 
)
static

Definition at line 788 of file RNTupleSerialize.cxx.

◆ SerializeFieldStructure()

std::uint16_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeFieldStructure ( ROOT::Experimental::ENTupleStructure  structure,
void *  buffer 
)
static

While we could just interpret the enums as ints, we make the translation explicit in order to avoid accidentally changing the on-disk numbers when adjusting the enum classes.

Definition at line 591 of file RNTupleSerialize.cxx.

◆ SerializeFooterV1()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeFooterV1 ( void *  buffer,
const RNTupleDescriptor desc,
const RContext context 
)
static

Definition at line 1113 of file RNTupleSerialize.cxx.

◆ SerializeFramePostscript()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeFramePostscript ( void *  frame,
std::int32_t  size 
)
static

Definition at line 732 of file RNTupleSerialize.cxx.

◆ SerializeHeaderV1()

ROOT::Experimental::Internal::RNTupleSerializer::RContext ROOT::Experimental::Internal::RNTupleSerializer::SerializeHeaderV1 ( void *  buffer,
const RNTupleDescriptor desc 
)
static

Definition at line 1019 of file RNTupleSerialize.cxx.

◆ SerializeInt16()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeInt16 ( std::int16_t  val,
void *  buffer 
)
static

Definition at line 383 of file RNTupleSerialize.cxx.

◆ SerializeInt32()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeInt32 ( std::int32_t  val,
void *  buffer 
)
static

Definition at line 410 of file RNTupleSerialize.cxx.

◆ SerializeInt64()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeInt64 ( std::int64_t  val,
void *  buffer 
)
static

Definition at line 440 of file RNTupleSerialize.cxx.

◆ SerializeListFramePreamble()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeListFramePreamble ( std::uint32_t  nitems,
void *  buffer 
)
static

Definition at line 716 of file RNTupleSerialize.cxx.

◆ SerializeLocator()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeLocator ( const RNTupleLocator locator,
void *  buffer 
)
static

Definition at line 829 of file RNTupleSerialize.cxx.

◆ SerializePageListV1()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializePageListV1 ( void *  buffer,
const RNTupleDescriptor desc,
std::span< DescriptorId_t physClusterIDs,
const RContext context 
)
static

Definition at line 1067 of file RNTupleSerialize.cxx.

◆ SerializeRecordFramePreamble()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeRecordFramePreamble ( void *  buffer)
static

Definition at line 709 of file RNTupleSerialize.cxx.

◆ SerializeString()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeString ( const std::string &  val,
void *  buffer 
)
static

Definition at line 476 of file RNTupleSerialize.cxx.

◆ SerializeUInt16()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeUInt16 ( std::uint16_t  val,
void *  buffer 
)
static

Definition at line 400 of file RNTupleSerialize.cxx.

◆ SerializeUInt32()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeUInt32 ( std::uint32_t  val,
void *  buffer 
)
static

Definition at line 430 of file RNTupleSerialize.cxx.

◆ SerializeUInt64()

std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::SerializeUInt64 ( std::uint64_t  val,
void *  buffer 
)
static

Definition at line 466 of file RNTupleSerialize.cxx.

◆ VerifyCRC32() [1/2]

RResult< void > ROOT::Experimental::Internal::RNTupleSerializer::VerifyCRC32 ( const unsigned char *  data,
std::uint32_t  length 
)
static

Definition at line 375 of file RNTupleSerialize.cxx.

◆ VerifyCRC32() [2/2]

RResult< void > ROOT::Experimental::Internal::RNTupleSerializer::VerifyCRC32 ( const unsigned char *  data,
std::uint32_t  length,
std::uint32_t &  crc32 
)
static

Expects a CRC32 checksum in the 4 bytes following data + length and verifies it.

Definition at line 363 of file RNTupleSerialize.cxx.

Member Data Documentation

◆ kEnvelopeCurrentVersion

constexpr std::uint16_t ROOT::Experimental::Internal::RNTupleSerializer::kEnvelopeCurrentVersion = 1
staticconstexpr

In order to handle changes to the serialization routine in future ntuple versions.

Definition at line 57 of file RNTupleSerialize.hxx.

◆ kEnvelopeMinVersion

constexpr std::uint16_t ROOT::Experimental::Internal::RNTupleSerializer::kEnvelopeMinVersion = 1
staticconstexpr

Definition at line 58 of file RNTupleSerialize.hxx.

◆ kFlagNonNegativeColumn

constexpr std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::kFlagNonNegativeColumn = 0x04
staticconstexpr

Definition at line 65 of file RNTupleSerialize.hxx.

◆ kFlagRepetitiveField

constexpr std::uint16_t ROOT::Experimental::Internal::RNTupleSerializer::kFlagRepetitiveField = 0x01
staticconstexpr

Definition at line 61 of file RNTupleSerialize.hxx.

◆ kFlagSortAscColumn

constexpr std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::kFlagSortAscColumn = 0x01
staticconstexpr

Definition at line 63 of file RNTupleSerialize.hxx.

◆ kFlagSortDesColumn

constexpr std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::kFlagSortDesColumn = 0x02
staticconstexpr

Definition at line 64 of file RNTupleSerialize.hxx.

◆ kReleaseCandidateTag

constexpr std::uint32_t ROOT::Experimental::Internal::RNTupleSerializer::kReleaseCandidateTag = 1
staticconstexpr

Definition at line 59 of file RNTupleSerialize.hxx.

◆ kZeroFieldId

constexpr DescriptorId_t ROOT::Experimental::Internal::RNTupleSerializer::kZeroFieldId = std::uint64_t(-2)
staticconstexpr

Definition at line 67 of file RNTupleSerialize.hxx.

Libraries for ROOT::Experimental::Internal::RNTupleSerializer:
[legend]

The documentation for this class was generated from the following files: