Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Internal::RProjectedFields Class Reference

Container for the projected fields of an RNTupleModel.

Projected fields are fields whose columns are reused from existing fields. Projected fields are not attached to the model's zero field but form a separate hierarchy with their own zero field (which is stored in this class). Only the real source fields are written to: projected fields are stored as metadata (header) information only. Only top-level projected fields are supported because otherwise the layout of types could be altered in unexpected ways. This class owns the hierarchy of projected fields and keeps the mapping between them and their backing source fields.

Definition at line 64 of file RNTupleModel.hxx.

Public Types

using FieldMap_t = std::unordered_map<const ROOT::RFieldBase *, const ROOT::RFieldBase *>
 The map keys are the projected target fields, the map values are the backing source fields Note that sub fields are treated individually and indepently of their parent field.
 

Public Member Functions

 RProjectedFields (const RNTupleModel &model)
 
 RProjectedFields (const RProjectedFields &)=delete
 
 RProjectedFields (RProjectedFields &&)=default
 
 ~RProjectedFields ()=default
 
RResult< void > Add (std::unique_ptr< ROOT::RFieldBase > field, const FieldMap_t &fieldMap)
 Adds a new projected field.
 
std::unique_ptr< RProjectedFieldsClone (const RNTupleModel &newModel) const
 Clones this container and all the projected fields it owns.
 
ROOT::RFieldZeroGetFieldZero ()
 
const ROOT::RFieldBaseGetSourceField (const ROOT::RFieldBase *target) const
 
bool IsEmpty () const
 
RProjectedFieldsoperator= (const RProjectedFields &)=delete
 
RProjectedFieldsoperator= (RProjectedFields &&)=default
 

Private Member Functions

 RProjectedFields (std::unique_ptr< ROOT::RFieldZero > fieldZero)
 
RResult< void > EnsureValidMapping (const ROOT::RFieldBase *target, const FieldMap_t &fieldMap)
 Asserts that the passed field is a valid target of the source field provided in the field map.
 

Private Attributes

FieldMap_t fFieldMap
 Maps the source fields from fModel to the target projected fields attached to fFieldZero.
 
std::unique_ptr< ROOT::RFieldZerofFieldZero
 The projected fields are attached to this zero field.
 
const RNTupleModelfModel
 The model this set of projected fields belongs to.
 

#include <ROOT/RNTupleModel.hxx>

Member Typedef Documentation

◆ FieldMap_t

The map keys are the projected target fields, the map values are the backing source fields Note that sub fields are treated individually and indepently of their parent field.

Definition at line 68 of file RNTupleModel.hxx.

Constructor & Destructor Documentation

◆ RProjectedFields() [1/4]

ROOT::Internal::RProjectedFields::RProjectedFields ( std::unique_ptr< ROOT::RFieldZero > fieldZero)
inlineexplicitprivate

Definition at line 71 of file RNTupleModel.hxx.

◆ RProjectedFields() [2/4]

ROOT::Internal::RProjectedFields::RProjectedFields ( const RNTupleModel & model)
inlineexplicit

Definition at line 84 of file RNTupleModel.hxx.

◆ RProjectedFields() [3/4]

ROOT::Internal::RProjectedFields::RProjectedFields ( const RProjectedFields & )
delete

◆ RProjectedFields() [4/4]

ROOT::Internal::RProjectedFields::RProjectedFields ( RProjectedFields && )
default

◆ ~RProjectedFields()

ROOT::Internal::RProjectedFields::~RProjectedFields ( )
default

Member Function Documentation

◆ Add()

ROOT::RResult< void > ROOT::Internal::RProjectedFields::Add ( std::unique_ptr< ROOT::RFieldBase > field,
const FieldMap_t & fieldMap )

Adds a new projected field.

The field map needs to provide valid source fields of fModel for 'field' and each of its sub fields.

Definition at line 141 of file RNTupleModel.cxx.

◆ Clone()

std::unique_ptr< ROOT::Internal::RProjectedFields > ROOT::Internal::RProjectedFields::Clone ( const RNTupleModel & newModel) const

Clones this container and all the projected fields it owns.

newModel must be a clone of the model that this RProjectedFields was constructed with.

Definition at line 165 of file RNTupleModel.cxx.

◆ EnsureValidMapping()

ROOT::RResult< void > ROOT::Internal::RProjectedFields::EnsureValidMapping ( const ROOT::RFieldBase * target,
const FieldMap_t & fieldMap )
private

Asserts that the passed field is a valid target of the source field provided in the field map.

Checks the field without looking into sub fields.

Definition at line 53 of file RNTupleModel.cxx.

◆ GetFieldZero()

ROOT::RFieldZero & ROOT::Internal::RProjectedFields::GetFieldZero ( )
inline

Definition at line 98 of file RNTupleModel.hxx.

◆ GetSourceField()

const ROOT::RFieldBase * ROOT::Internal::RProjectedFields::GetSourceField ( const ROOT::RFieldBase * target) const

Definition at line 157 of file RNTupleModel.cxx.

◆ IsEmpty()

bool ROOT::Internal::RProjectedFields::IsEmpty ( ) const
inline

Definition at line 103 of file RNTupleModel.hxx.

◆ operator=() [1/2]

RProjectedFields & ROOT::Internal::RProjectedFields::operator= ( const RProjectedFields & )
delete

◆ operator=() [2/2]

RProjectedFields & ROOT::Internal::RProjectedFields::operator= ( RProjectedFields && )
default

Member Data Documentation

◆ fFieldMap

FieldMap_t ROOT::Internal::RProjectedFields::fFieldMap
private

Maps the source fields from fModel to the target projected fields attached to fFieldZero.

Definition at line 75 of file RNTupleModel.hxx.

◆ fFieldZero

std::unique_ptr<ROOT::RFieldZero> ROOT::Internal::RProjectedFields::fFieldZero
private

The projected fields are attached to this zero field.

Definition at line 73 of file RNTupleModel.hxx.

◆ fModel

const RNTupleModel* ROOT::Internal::RProjectedFields::fModel
private

The model this set of projected fields belongs to.

Definition at line 77 of file RNTupleModel.hxx.

Libraries for ROOT::Internal::RProjectedFields:

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