Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Detail::RFieldBase Class Referenceabstract

A field translates read and write calls from/to underlying columns to/from tree values.

A field is a serializable C++ type or a container for a collection of sub fields. The RFieldBase and its type-safe descendants provide the object to column mapper. They map C++ objects to primitive columns. The mapping is trivial for simple types such as 'double'. Complex types resolve to multiple primitive columns. The field knows based on its type and the field name the type(s) and name(s) of the columns.

Definition at line 83 of file RField.hxx.

Classes

class  RBulk
 Similar to RValue but manages an array of consecutive values. More...
 
struct  RBulkSpec
 Input parameter to ReadBulk() and ReadBulkImpl(). See RBulk class for more information. More...
 
class  RColumnRepresentations
 Some fields have multiple possible column representations, e.g. More...
 
class  RSchemaIteratorTemplate
 Iterates over the sub tree of fields in depth-first search order. More...
 
class  RValue
 Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field. More...
 

Public Types

using ColumnRepresentation_t = std::vector< EColumnType >
 
enum class  EState { kUnconnected , kConnectedToSink , kConnectedToSource }
 During its lifetime, a field undergoes the following possible state transitions: More...
 
using RConstSchemaIterator = RSchemaIteratorTemplate< true >
 
using RSchemaIterator = RSchemaIteratorTemplate< false >
 

Public Member Functions

 RFieldBase (const RFieldBase &)=delete
 
 RFieldBase (RFieldBase &&)=default
 
 RFieldBase (std::string_view name, std::string_view type, ENTupleStructure structure, bool isSimple, std::size_t nRepetitions=0)
 The constructor creates the underlying column objects and connects them to either a sink or a source.
 
virtual ~RFieldBase ()
 
virtual void AcceptVisitor (RFieldVisitor &visitor) const
 
RSchemaIterator begin ()
 
RValue BindValue (void *where)
 Creates a value from a memory location with an already constructed object.
 
RConstSchemaIterator cbegin () const
 
RConstSchemaIterator cend () const
 
std::unique_ptr< RFieldBaseClone (std::string_view newName) const
 Copies the field and its sub fields using a possibly new name and a new, unconnected set of columns.
 
void CommitCluster ()
 Flushes data from active columns to disk and calls CommitClusterImpl.
 
void ConnectPageSink (RPageSink &pageSink, NTupleSize_t firstEntry=0)
 Fields and their columns live in the void until connected to a physical page storage.
 
void ConnectPageSource (RPageSource &pageSource)
 
RSchemaIterator end ()
 
RBulk GenerateBulk ()
 The returned bulk is initially empty; RBulk::ReadBulk will construct the array of values.
 
RValue GenerateValue ()
 Generates an object of the field type and allocates new initialized memory according to the type.
 
virtual size_t GetAlignment () const =0
 As a rule of thumb, the alignment is equal to the size of the type.
 
const ColumnRepresentation_tGetColumnRepresentative () const
 Returns the fColumnRepresentative pointee or, if unset, the field's default representative.
 
std::string GetDescription () const
 Get the field's description.
 
virtual std::uint32_t GetFieldVersion () const
 Indicates an evolution of the mapping scheme from C++ type to columns.
 
std::string GetName () const
 
NTupleSize_t GetNElements () const
 
std::size_t GetNRepetitions () const
 
DescriptorId_t GetOnDiskId () const
 
std::uint32_t GetOnDiskTypeVersion () const
 Return the C++ type version stored in the field descriptor; only valid after a call to ConnectPageSource()
 
RFieldBaseGetParent () const
 
std::string GetQualifiedFieldName () const
 Returns the field name and parent field names separated by dots ("grandparent.parent.child")
 
EState GetState () const
 
ENTupleStructure GetStructure () const
 
std::vector< RFieldBase * > GetSubFields () const
 
int GetTraits () const
 
std::string GetType () const
 
std::string GetTypeAlias () const
 
virtual std::uint32_t GetTypeVersion () const
 Indicates an evolution of the C++ type itself.
 
virtual size_t GetValueSize () const =0
 The number of bytes taken by a value of the appropriate type.
 
bool HasDefaultColumnRepresentative () const
 Whether or not an explicit column representative was set.
 
bool HasReadCallbacks () const
 
bool IsSimple () const
 
RFieldBaseoperator= (const RFieldBase &)=delete
 
RFieldBaseoperator= (RFieldBase &&)=default
 
void SetColumnRepresentative (const ColumnRepresentation_t &representative)
 Fixes a column representative.
 
void SetDescription (std::string_view description)
 
void SetOnDiskId (DescriptorId_t id)
 
virtual std::vector< RValueSplitValue (const RValue &value) const
 Creates the list of direct child values given a value for this field.
 

Static Public Member Functions

static RResult< std::unique_ptr< RFieldBase > > Create (const std::string &fieldName, const std::string &typeName)
 Factory method to resurrect a field from the stored on-disk type information.
 
static RResult< void > EnsureValidFieldName (std::string_view fieldName)
 Check whether a given string is a valid field name.
 

Static Public Attributes

static constexpr std::uint32_t kInvalidTypeVersion = -1U
 
static constexpr int kTraitMappable = 0x04
 A field of a fundamental type that can be directly mapped via RField<T>::Map(), i.e.
 
static constexpr int kTraitTriviallyConstructible = 0x01
 No constructor needs to be called, i.e.
 
static constexpr int kTraitTriviallyDestructible = 0x02
 The type is cleaned up just by freeing its memory. I.e. DestroyValue() is a no-op.
 
static constexpr int kTraitTrivialType = kTraitTriviallyConstructible | kTraitTriviallyDestructible
 Shorthand for types that are both trivially constructible and destructible.
 

Protected Member Functions

size_t AddReadCallback (ReadCallback_t func)
 Set a user-defined function to be called after reading a value, giving a chance to inspect and/or modify the value object.
 
std::size_t Append (const void *from)
 Write the given value into columns.
 
virtual std::size_t AppendImpl (const void *from)
 Operations on values of complex types, e.g.
 
void Attach (std::unique_ptr< Detail::RFieldBase > child)
 Add a new subfield to the list of nested fields.
 
void AutoAdjustColumnTypes (const RNTupleWriteOptions &options)
 When connecting a field to a page sink, the field's default column representation is subject to adjustment according to the write options.
 
virtual std::unique_ptr< RFieldBaseCloneImpl (std::string_view newName) const =0
 Called by Clone(), which additionally copies the on-disk ID.
 
virtual void CommitClusterImpl ()
 
virtual void DestroyValue (void *objPtr, bool dtorOnly=false) const
 Releases the resources acquired during GenerateValue (memory and constructor) This implementation works for types with a trivial destructor and should be overwritten otherwise.
 
const ColumnRepresentation_tEnsureCompatibleColumnTypes (const RNTupleDescriptor &desc) const
 Returns the on-disk column types found in the provided descriptor for fOnDiskId.
 
virtual void GenerateColumnsImpl ()=0
 Creates the backing columns corresponsing to the field type for writing.
 
virtual void GenerateColumnsImpl (const RNTupleDescriptor &desc)=0
 Creates the backing columns corresponsing to the field type for reading.
 
virtual void GenerateValue (void *where) const =0
 Constructs value in a given location of size at least GetValueSize(). Called by the base class' GenerateValue().
 
virtual const RColumnRepresentationsGetColumnRepresentations () const
 Implementations in derived classes should return a static RColumnRepresentations object.
 
virtual void OnConnectPageSource ()
 Called by ConnectPageSource() only once connected; derived classes may override this as appropriate.
 
void Read (const RClusterIndex &clusterIndex, void *to)
 
void Read (NTupleSize_t globalIndex, void *to)
 Populate a single value with data from the field.
 
std::size_t ReadBulk (const RBulkSpec &bulkSpec)
 Returns the number of newly available values, that is the number of bools in bulkSpec.fMaskAvail that flipped from false to true.
 
virtual std::size_t ReadBulkImpl (const RBulkSpec &bulkSpec)
 General implementation of bulk read.
 
virtual void ReadGlobalImpl (NTupleSize_t globalIndex, void *to)
 
virtual void ReadInClusterImpl (const RClusterIndex &clusterIndex, void *to)
 
void RemoveReadCallback (size_t idx)
 

Static Protected Member Functions

static std::size_t CallAppendOn (RFieldBase &other, const void *from)
 Allow derived classes to call Append and Read on other (sub) fields.
 
static void CallDestroyValueOn (const RFieldBase &other, void *objPtr, bool dtorOnly=false)
 
static void CallGenerateValueOn (const RFieldBase &other, void *where)
 Allow derived classes to call GenerateValue(void *) and DestroyValue on other (sub) fields.
 
static void CallReadOn (RFieldBase &other, const RClusterIndex &clusterIndex, void *to)
 
static void CallReadOn (RFieldBase &other, NTupleSize_t globalIndex, void *to)
 
static RResult< std::unique_ptr< RFieldBase > > Create (const std::string &fieldName, const std::string &canonicalType, const std::string &typeAlias)
 Factory method to resurrect a field from the stored on-disk type information.
 
static RColumnGetPrincipalColumnOf (const RFieldBase &other)
 Fields may need direct access to the principal column of their sub fields, e.g. in RRVecField::ReadBulk.
 

Protected Attributes

const ColumnRepresentation_tfColumnRepresentative = nullptr
 Points into the static vector GetColumnRepresentations().GetSerializationTypes() when SetColumnRepresentative is called.
 
std::vector< std::unique_ptr< RColumn > > fColumns
 The columns are connected either to a sink or to a source (not to both); they are owned by the field.
 
std::uint32_t fOnDiskTypeVersion = kInvalidTypeVersion
 C++ type version cached from the descriptor after a call to ConnectPageSource()
 
RFieldBasefParent
 Sub fields point to their mother field.
 
RColumnfPrincipalColumn
 Points into fColumns.
 
std::vector< ReadCallback_tfReadCallbacks
 List of functions to be called after reading a value.
 
std::vector< std::unique_ptr< RFieldBase > > fSubFields
 Collections and classes own sub fields.
 
int fTraits = 0
 Properties of the type that allow for optimizations of collections of that type.
 
std::string fTypeAlias
 A typedef or using name that was used when creating the field.
 

Private Types

using ReadCallback_t = std::function< void(void *)>
 

Private Member Functions

NTupleSize_t EntryToColumnElementIndex (NTupleSize_t globalIndex) const
 Translate an entry index to a column element index of the principal column and viceversa.
 
void InvokeReadCallbacks (void *target)
 

Private Attributes

std::string fDescription
 Free text set by the user.
 
bool fIsSimple
 A field qualifies as simple if it is both mappable and has no post-read callback.
 
std::string fName
 The field name relative to its parent field.
 
std::size_t fNRepetitions
 For fixed sized arrays, the array length.
 
DescriptorId_t fOnDiskId = kInvalidDescriptorId
 When the columns are connected to a page source or page sink, the field represents a field id in the corresponding RNTuple descriptor.
 
EState fState = EState::kUnconnected
 Changed by ConnectTo[Sink,Source], reset by Clone()
 
ENTupleStructure fStructure
 The role of this field in the data model structure.
 
std::string fType
 The C++ type captured by this field.
 

Friends

struct ROOT::Experimental::Internal::RFieldCallbackInjector
 
class ROOT::Experimental::RCollectionField
 

#include <ROOT/RField.hxx>

Inheritance diagram for ROOT::Experimental::Detail::RFieldBase:
[legend]

Member Typedef Documentation

◆ ColumnRepresentation_t

◆ RConstSchemaIterator

◆ ReadCallback_t

using ROOT::Experimental::Detail::RFieldBase::ReadCallback_t = std::function<void(void *)>
private

Definition at line 86 of file RField.hxx.

◆ RSchemaIterator

Member Enumeration Documentation

◆ EState

During its lifetime, a field undergoes the following possible state transitions:

[*] --> Unconnected --> ConnectedToSink -— | | | | --> ConnectedToSource —> [*]

| |

Enumerator
kUnconnected 
kConnectedToSink 
kConnectedToSource 

Definition at line 110 of file RField.hxx.

Constructor & Destructor Documentation

◆ RFieldBase() [1/3]

ROOT::Experimental::Detail::RFieldBase::RFieldBase ( std::string_view  name,
std::string_view  type,
ENTupleStructure  structure,
bool  isSimple,
std::size_t  nRepetitions = 0 
)

The constructor creates the underlying column objects and connects them to either a sink or a source.

If isSimple is true, the trait kTraitMappable is automatically set on construction. However, the field might be demoted to non-simple if a post-read callback is set.

Definition at line 320 of file RField.cxx.

◆ RFieldBase() [2/3]

ROOT::Experimental::Detail::RFieldBase::RFieldBase ( const RFieldBase )
delete

◆ RFieldBase() [3/3]

ROOT::Experimental::Detail::RFieldBase::RFieldBase ( RFieldBase &&  )
default

◆ ~RFieldBase()

ROOT::Experimental::Detail::RFieldBase::~RFieldBase ( )
virtual

Definition at line 327 of file RField.cxx.

Member Function Documentation

◆ AcceptVisitor()

◆ AddReadCallback()

size_t ROOT::Experimental::Detail::RFieldBase::AddReadCallback ( ReadCallback_t  func)
protected

Set a user-defined function to be called after reading a value, giving a chance to inspect and/or modify the value object.

Returns an index that can be used to remove the callback.

Definition at line 673 of file RField.cxx.

◆ Append()

std::size_t ROOT::Experimental::Detail::RFieldBase::Append ( const void *  from)
inlineprotected

Write the given value into columns.

The value object has to be of the same type as the field. Returns the number of uncompressed bytes written.

Definition at line 402 of file RField.hxx.

◆ AppendImpl()

std::size_t ROOT::Experimental::Detail::RFieldBase::AppendImpl ( const void *  from)
protectedvirtual

◆ Attach()

void ROOT::Experimental::Detail::RFieldBase::Attach ( std::unique_ptr< Detail::RFieldBase child)
protected

Add a new subfield to the list of nested fields.

Definition at line 574 of file RField.cxx.

◆ AutoAdjustColumnTypes()

void ROOT::Experimental::Detail::RFieldBase::AutoAdjustColumnTypes ( const RNTupleWriteOptions options)
protected

When connecting a field to a page sink, the field's default column representation is subject to adjustment according to the write options.

E.g., if compression is turned off, encoded columns are changed to their unencoded counterparts.

Definition at line 686 of file RField.cxx.

◆ begin()

RSchemaIterator ROOT::Experimental::Detail::RFieldBase::begin ( )
inline

Definition at line 635 of file RField.hxx.

◆ BindValue()

RValue ROOT::Experimental::Detail::RFieldBase::BindValue ( void *  where)
inline

Creates a value from a memory location with an already constructed object.

Definition at line 578 of file RField.hxx.

◆ CallAppendOn()

static std::size_t ROOT::Experimental::Detail::RFieldBase::CallAppendOn ( RFieldBase other,
const void *  from 
)
inlinestaticprotected

Allow derived classes to call Append and Read on other (sub) fields.

Definition at line 461 of file RField.hxx.

◆ CallDestroyValueOn()

static void ROOT::Experimental::Detail::RFieldBase::CallDestroyValueOn ( const RFieldBase other,
void *  objPtr,
bool  dtorOnly = false 
)
inlinestaticprotected

Definition at line 386 of file RField.hxx.

◆ CallGenerateValueOn()

static void ROOT::Experimental::Detail::RFieldBase::CallGenerateValueOn ( const RFieldBase other,
void *  where 
)
inlinestaticprotected

Allow derived classes to call GenerateValue(void *) and DestroyValue on other (sub) fields.

Definition at line 385 of file RField.hxx.

◆ CallReadOn() [1/2]

static void ROOT::Experimental::Detail::RFieldBase::CallReadOn ( RFieldBase other,
const RClusterIndex clusterIndex,
void *  to 
)
inlinestaticprotected

Definition at line 462 of file RField.hxx.

◆ CallReadOn() [2/2]

static void ROOT::Experimental::Detail::RFieldBase::CallReadOn ( RFieldBase other,
NTupleSize_t  globalIndex,
void *  to 
)
inlinestaticprotected

Definition at line 466 of file RField.hxx.

◆ cbegin()

RConstSchemaIterator ROOT::Experimental::Detail::RFieldBase::cbegin ( ) const
inline

Definition at line 640 of file RField.hxx.

◆ cend()

RConstSchemaIterator ROOT::Experimental::Detail::RFieldBase::cend ( ) const
inline

Definition at line 644 of file RField.hxx.

◆ Clone()

std::unique_ptr< ROOT::Experimental::Detail::RFieldBase > ROOT::Experimental::Detail::RFieldBase::Clone ( std::string_view  newName) const

Copies the field and its sub fields using a possibly new name and a new, unconnected set of columns.

Definition at line 512 of file RField.cxx.

◆ CloneImpl()

◆ CommitCluster()

void ROOT::Experimental::Detail::RFieldBase::CommitCluster ( )

Flushes data from active columns to disk and calls CommitClusterImpl.

Definition at line 607 of file RField.cxx.

◆ CommitClusterImpl()

virtual void ROOT::Experimental::Detail::RFieldBase::CommitClusterImpl ( )
inlineprotectedvirtual

◆ ConnectPageSink()

void ROOT::Experimental::Detail::RFieldBase::ConnectPageSink ( RPageSink pageSink,
NTupleSize_t  firstEntry = 0 
)

Fields and their columns live in the void until connected to a physical page storage.

Only once connected, data can be read or written. In order to find the field in the page storage, the field's on-disk ID has to be set.

Parameters
firstEntryThe global index of the first entry with on-disk data for the connected field

Definition at line 721 of file RField.cxx.

◆ ConnectPageSource()

void ROOT::Experimental::Detail::RFieldBase::ConnectPageSource ( RPageSource pageSource)

Definition at line 742 of file RField.cxx.

◆ Create() [1/2]

ROOT::Experimental::RResult< std::unique_ptr< ROOT::Experimental::Detail::RFieldBase > > ROOT::Experimental::Detail::RFieldBase::Create ( const std::string &  fieldName,
const std::string &  canonicalType,
const std::string &  typeAlias 
)
staticprotected

Factory method to resurrect a field from the stored on-disk type information.

This overload takes an already normalized type name and type alias TODO(jalopezg): this overload may eventually be removed leaving only the RFieldBase::Create() that takes a single type name

Definition at line 351 of file RField.cxx.

◆ Create() [2/2]

ROOT::Experimental::RResult< std::unique_ptr< ROOT::Experimental::Detail::RFieldBase > > ROOT::Experimental::Detail::RFieldBase::Create ( const std::string &  fieldName,
const std::string &  typeName 
)
static

Factory method to resurrect a field from the stored on-disk type information.

Definition at line 343 of file RField.cxx.

◆ DestroyValue()

void ROOT::Experimental::Detail::RFieldBase::DestroyValue ( void *  objPtr,
bool  dtorOnly = false 
) const
protectedvirtual

◆ end()

RSchemaIterator ROOT::Experimental::Detail::RFieldBase::end ( )
inline

Definition at line 639 of file RField.hxx.

◆ EnsureCompatibleColumnTypes()

const ROOT::Experimental::Detail::RFieldBase::ColumnRepresentation_t & ROOT::Experimental::Detail::RFieldBase::EnsureCompatibleColumnTypes ( const RNTupleDescriptor desc) const
protected

Returns the on-disk column types found in the provided descriptor for fOnDiskId.

Throws an exception if the types don't match any of the deserialization types from GetColumnRepresentations().

Definition at line 649 of file RField.cxx.

◆ EnsureValidFieldName()

ROOT::Experimental::RResult< void > ROOT::Experimental::Detail::RFieldBase::EnsureValidFieldName ( std::string_view  fieldName)
static

Check whether a given string is a valid field name.

Definition at line 494 of file RField.cxx.

◆ EntryToColumnElementIndex()

ROOT::Experimental::NTupleSize_t ROOT::Experimental::Detail::RFieldBase::EntryToColumnElementIndex ( NTupleSize_t  globalIndex) const
private

Translate an entry index to a column element index of the principal column and viceversa.

These functions take into account the role and number of repetitions on each level of the field hierarchy as follows:

  • Top level fields: element index == entry index
  • Record fields propagate their principal column index to the principal columns of direct descendant fields
  • Collection and variant fields set the principal column index of their childs to 0

The column element index also depends on the number of repetitions of each field in the hierarchy, e.g., given a field with type std::array<std::array<float, 4>, 2>, this function returns 8 for the inner-most field.

Definition at line 586 of file RField.cxx.

◆ GenerateBulk()

RBulk ROOT::Experimental::Detail::RFieldBase::GenerateBulk ( )
inline

The returned bulk is initially empty; RBulk::ReadBulk will construct the array of values.

Definition at line 576 of file RField.hxx.

◆ GenerateColumnsImpl() [1/2]

◆ GenerateColumnsImpl() [2/2]

◆ GenerateValue() [1/2]

ROOT::Experimental::Detail::RFieldBase::RValue ROOT::Experimental::Detail::RFieldBase::GenerateValue ( )

Generates an object of the field type and allocates new initialized memory according to the type.

Definition at line 554 of file RField.cxx.

◆ GenerateValue() [2/2]

◆ GetAlignment()

◆ GetColumnRepresentations()

◆ GetColumnRepresentative()

const ROOT::Experimental::Detail::RFieldBase::ColumnRepresentation_t & ROOT::Experimental::Detail::RFieldBase::GetColumnRepresentative ( ) const

Returns the fColumnRepresentative pointee or, if unset, the field's default representative.

Definition at line 630 of file RField.cxx.

◆ GetDescription()

std::string ROOT::Experimental::Detail::RFieldBase::GetDescription ( ) const
inline

Get the field's description.

Definition at line 606 of file RField.hxx.

◆ GetFieldVersion()

virtual std::uint32_t ROOT::Experimental::Detail::RFieldBase::GetFieldVersion ( ) const
inlinevirtual

Indicates an evolution of the mapping scheme from C++ type to columns.

Definition at line 629 of file RField.hxx.

◆ GetName()

std::string ROOT::Experimental::Detail::RFieldBase::GetName ( ) const
inline

Definition at line 594 of file RField.hxx.

◆ GetNElements()

NTupleSize_t ROOT::Experimental::Detail::RFieldBase::GetNElements ( ) const
inline

Definition at line 601 of file RField.hxx.

◆ GetNRepetitions()

std::size_t ROOT::Experimental::Detail::RFieldBase::GetNRepetitions ( ) const
inline

Definition at line 600 of file RField.hxx.

◆ GetOnDiskId()

DescriptorId_t ROOT::Experimental::Detail::RFieldBase::GetOnDiskId ( ) const
inline

Definition at line 610 of file RField.hxx.

◆ GetOnDiskTypeVersion()

std::uint32_t ROOT::Experimental::Detail::RFieldBase::GetOnDiskTypeVersion ( ) const
inline

Return the C++ type version stored in the field descriptor; only valid after a call to ConnectPageSource()

Definition at line 633 of file RField.hxx.

◆ GetParent()

RFieldBase * ROOT::Experimental::Detail::RFieldBase::GetParent ( ) const
inline

Definition at line 602 of file RField.hxx.

◆ GetPrincipalColumnOf()

static RColumn * ROOT::Experimental::Detail::RFieldBase::GetPrincipalColumnOf ( const RFieldBase other)
inlinestaticprotected

Fields may need direct access to the principal column of their sub fields, e.g. in RRVecField::ReadBulk.

Definition at line 469 of file RField.hxx.

◆ GetQualifiedFieldName()

std::string ROOT::Experimental::Detail::RFieldBase::GetQualifiedFieldName ( ) const

Returns the field name and parent field names separated by dots ("grandparent.parent.child")

Definition at line 331 of file RField.cxx.

◆ GetState()

EState ROOT::Experimental::Detail::RFieldBase::GetState ( ) const
inline

Definition at line 608 of file RField.hxx.

◆ GetStructure()

ENTupleStructure ROOT::Experimental::Detail::RFieldBase::GetStructure ( ) const
inline

Definition at line 599 of file RField.hxx.

◆ GetSubFields()

std::vector< ROOT::Experimental::Detail::RFieldBase * > ROOT::Experimental::Detail::RFieldBase::GetSubFields ( ) const

Definition at line 598 of file RField.cxx.

◆ GetTraits()

int ROOT::Experimental::Detail::RFieldBase::GetTraits ( ) const
inline

Definition at line 588 of file RField.hxx.

◆ GetType()

std::string ROOT::Experimental::Detail::RFieldBase::GetType ( ) const
inline

Definition at line 597 of file RField.hxx.

◆ GetTypeAlias()

std::string ROOT::Experimental::Detail::RFieldBase::GetTypeAlias ( ) const
inline

Definition at line 598 of file RField.hxx.

◆ GetTypeVersion()

virtual std::uint32_t ROOT::Experimental::Detail::RFieldBase::GetTypeVersion ( ) const
inlinevirtual

Indicates an evolution of the C++ type itself.

Reimplemented in ROOT::Experimental::RClassField.

Definition at line 631 of file RField.hxx.

◆ GetValueSize()

◆ HasDefaultColumnRepresentative()

bool ROOT::Experimental::Detail::RFieldBase::HasDefaultColumnRepresentative ( ) const
inline

Whether or not an explicit column representative was set.

Definition at line 620 of file RField.hxx.

◆ HasReadCallbacks()

bool ROOT::Experimental::Detail::RFieldBase::HasReadCallbacks ( ) const
inline

Definition at line 589 of file RField.hxx.

◆ InvokeReadCallbacks()

void ROOT::Experimental::Detail::RFieldBase::InvokeReadCallbacks ( void *  target)
inlineprivate

Definition at line 302 of file RField.hxx.

◆ IsSimple()

bool ROOT::Experimental::Detail::RFieldBase::IsSimple ( ) const
inline

Definition at line 604 of file RField.hxx.

◆ OnConnectPageSource()

virtual void ROOT::Experimental::Detail::RFieldBase::OnConnectPageSource ( )
inlineprotectedvirtual

Called by ConnectPageSource() only once connected; derived classes may override this as appropriate.

Reimplemented in ROOT::Experimental::RClassField.

Definition at line 485 of file RField.hxx.

◆ operator=() [1/2]

RFieldBase & ROOT::Experimental::Detail::RFieldBase::operator= ( const RFieldBase )
delete

◆ operator=() [2/2]

RFieldBase & ROOT::Experimental::Detail::RFieldBase::operator= ( RFieldBase &&  )
default

◆ Read() [1/2]

void ROOT::Experimental::Detail::RFieldBase::Read ( const RClusterIndex clusterIndex,
void *  to 
)
inlineprotected

Definition at line 427 of file RField.hxx.

◆ Read() [2/2]

void ROOT::Experimental::Detail::RFieldBase::Read ( NTupleSize_t  globalIndex,
void *  to 
)
inlineprotected

Populate a single value with data from the field.

The memory location pointed to by to needs to be of the fitting type. The fast path is conditioned by the field qualifying as simple, i.e. maps as-is to a single column and has no read callback.

Definition at line 414 of file RField.hxx.

◆ ReadBulk()

std::size_t ROOT::Experimental::Detail::RFieldBase::ReadBulk ( const RBulkSpec bulkSpec)
inlineprotected

Returns the number of newly available values, that is the number of bools in bulkSpec.fMaskAvail that flipped from false to true.

As a special return value, kAllSet can be used if all values are read independent from the masks.

Definition at line 448 of file RField.hxx.

◆ ReadBulkImpl()

std::size_t ROOT::Experimental::Detail::RFieldBase::ReadBulkImpl ( const RBulkSpec bulkSpec)
protectedvirtual

General implementation of bulk read.

Loop over the required range and read values that are required and not already present. Derived classes may implement more optimized versions of this method. See ReadBulk() for the return value.

Reimplemented in ROOT::Experimental::RRVecField, and ROOT::Experimental::RField< RNTupleCardinality< SizeT > >.

Definition at line 534 of file RField.cxx.

◆ ReadGlobalImpl()

◆ ReadInClusterImpl()

virtual void ROOT::Experimental::Detail::RFieldBase::ReadInClusterImpl ( const RClusterIndex clusterIndex,
void *  to 
)
inlineprotectedvirtual

◆ RemoveReadCallback()

void ROOT::Experimental::Detail::RFieldBase::RemoveReadCallback ( size_t  idx)
protected

Definition at line 680 of file RField.cxx.

◆ SetColumnRepresentative()

void ROOT::Experimental::Detail::RFieldBase::SetColumnRepresentative ( const ColumnRepresentation_t representative)

Fixes a column representative.

This can only be done before connecting the field to a page sink. Otherwise, or if the provided representation is not in the list of GetColumnRepresentations, an exception is thrown

Definition at line 637 of file RField.cxx.

◆ SetDescription()

void ROOT::Experimental::Detail::RFieldBase::SetDescription ( std::string_view  description)

Definition at line 615 of file RField.cxx.

◆ SetOnDiskId()

void ROOT::Experimental::Detail::RFieldBase::SetOnDiskId ( DescriptorId_t  id)

Definition at line 622 of file RField.cxx.

◆ SplitValue()

std::vector< ROOT::Experimental::Detail::RFieldBase::RValue > ROOT::Experimental::Detail::RFieldBase::SplitValue ( const RValue value) const
virtual

Creates the list of direct child values given a value for this field.

E.g. a single value for the correct variant or all the elements of a collection. The default implementation assumes no sub values and returns an empty vector.

Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::REnumField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRecordField, ROOT::Experimental::RVectorField, ROOT::Experimental::RRVecField, ROOT::Experimental::RArrayField, and ROOT::Experimental::RUniquePtrField.

Definition at line 569 of file RField.cxx.

Friends And Related Symbol Documentation

◆ ROOT::Experimental::Internal::RFieldCallbackInjector

friend struct ROOT::Experimental::Internal::RFieldCallbackInjector
friend

Definition at line 85 of file RField.hxx.

◆ ROOT::Experimental::RCollectionField

Definition at line 84 of file RField.hxx.

Member Data Documentation

◆ fColumnRepresentative

const ColumnRepresentation_t* ROOT::Experimental::Detail::RFieldBase::fColumnRepresentative = nullptr
protected

Points into the static vector GetColumnRepresentations().GetSerializationTypes() when SetColumnRepresentative is called.

Otherwise GetColumnRepresentative returns the default representation.

Definition at line 357 of file RField.hxx.

◆ fColumns

std::vector<std::unique_ptr<RColumn> > ROOT::Experimental::Detail::RFieldBase::fColumns
protected

The columns are connected either to a sink or to a source (not to both); they are owned by the field.

Definition at line 346 of file RField.hxx.

◆ fDescription

std::string ROOT::Experimental::Detail::RFieldBase::fDescription
private

Free text set by the user.

Definition at line 298 of file RField.hxx.

◆ fIsSimple

bool ROOT::Experimental::Detail::RFieldBase::fIsSimple
private

A field qualifies as simple if it is both mappable and has no post-read callback.

Definition at line 292 of file RField.hxx.

◆ fName

std::string ROOT::Experimental::Detail::RFieldBase::fName
private

The field name relative to its parent field.

Definition at line 284 of file RField.hxx.

◆ fNRepetitions

std::size_t ROOT::Experimental::Detail::RFieldBase::fNRepetitions
private

For fixed sized arrays, the array length.

Definition at line 290 of file RField.hxx.

◆ fOnDiskId

DescriptorId_t ROOT::Experimental::Detail::RFieldBase::fOnDiskId = kInvalidDescriptorId
private

When the columns are connected to a page source or page sink, the field represents a field id in the corresponding RNTuple descriptor.

This on-disk ID is set in RPageSink::Create() for writing and by RFieldDescriptor::CreateField() when recreating a field / model from the stored descriptor.

Definition at line 296 of file RField.hxx.

◆ fOnDiskTypeVersion

std::uint32_t ROOT::Experimental::Detail::RFieldBase::fOnDiskTypeVersion = kInvalidTypeVersion
protected

C++ type version cached from the descriptor after a call to ConnectPageSource()

Definition at line 354 of file RField.hxx.

◆ fParent

RFieldBase* ROOT::Experimental::Detail::RFieldBase::fParent
protected

Sub fields point to their mother field.

Definition at line 340 of file RField.hxx.

◆ fPrincipalColumn

RColumn* ROOT::Experimental::Detail::RFieldBase::fPrincipalColumn
protected

Points into fColumns.

All fields that have columns have a distinct main column. For simple fields (float, int, ...), the principal column corresponds to the field type. For collection fields expect std::array, the main column is the offset field. Class fields have no column of their own.

Definition at line 344 of file RField.hxx.

◆ fReadCallbacks

std::vector<ReadCallback_t> ROOT::Experimental::Detail::RFieldBase::fReadCallbacks
protected

List of functions to be called after reading a value.

Definition at line 352 of file RField.hxx.

◆ fState

EState ROOT::Experimental::Detail::RFieldBase::fState = EState::kUnconnected
private

Changed by ConnectTo[Sink,Source], reset by Clone()

Definition at line 300 of file RField.hxx.

◆ fStructure

ENTupleStructure ROOT::Experimental::Detail::RFieldBase::fStructure
private

The role of this field in the data model structure.

Definition at line 288 of file RField.hxx.

◆ fSubFields

std::vector<std::unique_ptr<RFieldBase> > ROOT::Experimental::Detail::RFieldBase::fSubFields
protected

Collections and classes own sub fields.

Definition at line 338 of file RField.hxx.

◆ fTraits

int ROOT::Experimental::Detail::RFieldBase::fTraits = 0
protected

Properties of the type that allow for optimizations of collections of that type.

Definition at line 348 of file RField.hxx.

◆ fType

std::string ROOT::Experimental::Detail::RFieldBase::fType
private

The C++ type captured by this field.

Definition at line 286 of file RField.hxx.

◆ fTypeAlias

std::string ROOT::Experimental::Detail::RFieldBase::fTypeAlias
protected

A typedef or using name that was used when creating the field.

Definition at line 350 of file RField.hxx.

◆ kInvalidTypeVersion

constexpr std::uint32_t ROOT::Experimental::Detail::RFieldBase::kInvalidTypeVersion = -1U
staticconstexpr

Definition at line 89 of file RField.hxx.

◆ kTraitMappable

constexpr int ROOT::Experimental::Detail::RFieldBase::kTraitMappable = 0x04
staticconstexpr

A field of a fundamental type that can be directly mapped via RField<T>::Map(), i.e.

maps as-is to a single column

Definition at line 97 of file RField.hxx.

◆ kTraitTriviallyConstructible

constexpr int ROOT::Experimental::Detail::RFieldBase::kTraitTriviallyConstructible = 0x01
staticconstexpr

No constructor needs to be called, i.e.

any bit pattern in the allocated memory represents a valid type A trivially constructible field has a no-op GenerateValue() implementation

Definition at line 92 of file RField.hxx.

◆ kTraitTriviallyDestructible

constexpr int ROOT::Experimental::Detail::RFieldBase::kTraitTriviallyDestructible = 0x02
staticconstexpr

The type is cleaned up just by freeing its memory. I.e. DestroyValue() is a no-op.

Definition at line 94 of file RField.hxx.

◆ kTraitTrivialType

constexpr int ROOT::Experimental::Detail::RFieldBase::kTraitTrivialType = kTraitTriviallyConstructible | kTraitTriviallyDestructible
staticconstexpr

Shorthand for types that are both trivially constructible and destructible.

Definition at line 99 of file RField.hxx.

Libraries for ROOT::Experimental::Detail::RFieldBase:

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