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

Collection of values in an RNTupleProcessor, analogous to REntry, with checks and support for missing values.

Definition at line 89 of file RNTupleProcessorEntry.hxx.

Classes

struct  RProcessorValue
 

Public Types

using FieldIndex_t = std::uint64_t
 

Public Member Functions

FieldIndex_t AddField (const std::string &qualifiedFieldName, std::unique_ptr< ROOT::RFieldBase > field, void *valuePtr, const RNTupleProcessorProvenance &provenance)
 Add a new field to the entry.
 
void Bind (FieldIndex_t fieldIdx, std::shared_ptr< void > valuePtr)
 Bind a new value pointer to a field in the entry.
 
void BindRawPtr (FieldIndex_t fieldIdx, void *valuePtr)
 Bind a new value pointer to a field in the entry.
 
void Clear ()
 Clear all fields from the entry.
 
std::optional< FieldIndex_t > FindFieldIndex (std::string_view canonicalFieldName, std::string_view typeName="") const
 Find the field index of the provided field in the entry.
 
const std::string & FindFieldName (FieldIndex_t fieldIdx) const
 Find the name of a field from its field index.
 
const ROOT::RFieldBase & GetField (FieldIndex_t fieldIdx) const
 Get a field by its index.
 
std::unordered_set< FieldIndex_t > GetFieldIndices () const
 Get all field indices of this entry.
 
FieldIndex_t GetFieldOriginIdx (FieldIndex_t fieldIdx)
 Get a field's origin field index.
 
const RNTupleProcessorProvenance & GetFieldProvenance (FieldIndex_t fieldIdx) const
 Get the processor provenance of a field in the entry.
 
std::string GetQualifiedFieldName (FieldIndex_t fieldIdx) const
 Get the name of a field in the entry, including its parent fields.
 
const ROOT::RFieldBase::RValue & GetValue (FieldIndex_t fieldIdx) const
 
bool IsValidField (FieldIndex_t fieldIdx) const
 Check whether a field is valid for reading.
 
void ReadValue (FieldIndex_t fieldIdx, ROOT::NTupleSize_t entryIdx)
 Read the field value corresponding to the given field index for the provided entry index.
 
void ResetFields (const std::unordered_set< FieldIndex_t > &fieldIdxs)
 Reset the specified fields to a proto field, disconnected from any physical storage.
 
void SetFieldOriginIdx (FieldIndex_t fieldIdx, FieldIndex_t fieldOriginIdx)
 Set a field's origin index.
 
void SetFieldValidity (FieldIndex_t fieldIdx, bool isValid)
 Set the validity of a field, i.e.
 
void UpdateField (FieldIndex_t fieldIdx, std::unique_ptr< ROOT::RFieldBase > field)
 Update a field in the entry, preserving the value pointer.
 

Private Attributes

std::unordered_map< std::string, std::vector< FieldIndex_t > > fFieldName2Index
 
std::vector< RProcessorValue > fProcessorValues
 

#include <ROOT/RNTupleProcessorEntry.hxx>

Member Typedef Documentation

◆ FieldIndex_t

Definition at line 93 of file RNTupleProcessorEntry.hxx.

Member Function Documentation

◆ AddField()

ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t ROOT::Internal::RNTupleProcessorEntry::AddField ( const std::string & qualifiedFieldName,
std::unique_ptr< ROOT::RFieldBase > field,
void * valuePtr,
const RNTupleProcessorProvenance & provenance )

Add a new field to the entry.

Parameters
[in]qualifiedFieldNameName of the field to add, including its parent field if applicable.
[in]fieldReference to the field to add, used to to create its corresponding RValue.
[in]valuePtrPointer to an object corresponding to the field's type to bind to its value. If this is a nullptr, a pointer will be created.
[in]provenanceProcessor provenance of the field.
Returns
The field index of the newly added field.

Definition at line 55 of file RNTupleProcessorEntry.cxx.

◆ Bind()

void ROOT::Internal::RNTupleProcessorEntry::Bind ( FieldIndex_t fieldIdx,
std::shared_ptr< void > valuePtr )

Bind a new value pointer to a field in the entry.

Parameters
[in]fieldIdxThe index of the field in the entry.
[in]valuePtrPointer to the value to bind to the field.

Definition at line 109 of file RNTupleProcessorEntry.cxx.

◆ BindRawPtr()

void ROOT::Internal::RNTupleProcessorEntry::BindRawPtr ( FieldIndex_t fieldIdx,
void * valuePtr )

Bind a new value pointer to a field in the entry.

Parameters
[in]fieldIdxThe index of the field in the entry.
[in]valuePtrPointer to the value to bind to the field.

Definition at line 103 of file RNTupleProcessorEntry.cxx.

◆ Clear()

void ROOT::Internal::RNTupleProcessorEntry::Clear ( )
inline

Clear all fields from the entry.

Definition at line 125 of file RNTupleProcessorEntry.hxx.

◆ FindFieldIndex()

std::optional< ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t > ROOT::Internal::RNTupleProcessorEntry::FindFieldIndex ( std::string_view canonicalFieldName,
std::string_view typeName = "" ) const

Find the field index of the provided field in the entry.

Parameters
[in]canonicalFieldNameThe name of the field in the entry, including its processor name prefixes and parent field names, if applicable.
[in]typeNameType of the field, if relevant. If no type name is provided, the first field corresponding to the provided name is returned.
Returns
A std::optional containing the field index if it was found.

Definition at line 34 of file RNTupleProcessorEntry.cxx.

◆ FindFieldName()

const std::string & ROOT::Internal::RNTupleProcessorEntry::FindFieldName ( FieldIndex_t fieldIdx) const

Find the name of a field from its field index.

Parameters
[in]fieldIdxThe index of the field in the entry.
Warning
This function has linear complexity, only use it for more helpful error messages!

Definition at line 18 of file RNTupleProcessorEntry.cxx.

◆ GetField()

const ROOT::RFieldBase & ROOT::Internal::RNTupleProcessorEntry::GetField ( FieldIndex_t fieldIdx) const

Get a field by its index.

Parameters
[in]fieldIdxIndex of the field.
Returns
A constref to the field.

Definition at line 79 of file RNTupleProcessorEntry.cxx.

◆ GetFieldIndices()

std::unordered_set< ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t > ROOT::Internal::RNTupleProcessorEntry::GetFieldIndices ( ) const

Get all field indices of this entry.

Definition at line 125 of file RNTupleProcessorEntry.cxx.

◆ GetFieldOriginIdx()

FieldIndex_t ROOT::Internal::RNTupleProcessorEntry::GetFieldOriginIdx ( FieldIndex_t fieldIdx)
inline

Get a field's origin field index.

Parameters
[in]fieldIdxThe index of the field in the entry to set.
Returns
The index of the field's origin field.

Definition at line 184 of file RNTupleProcessorEntry.hxx.

◆ GetFieldProvenance()

const RNTupleProcessorProvenance & ROOT::Internal::RNTupleProcessorEntry::GetFieldProvenance ( FieldIndex_t fieldIdx) const
inline

Get the processor provenance of a field in the entry.

Parameters
[in]fieldIdxThe index of the field in the entry.

Definition at line 269 of file RNTupleProcessorEntry.hxx.

◆ GetQualifiedFieldName()

std::string ROOT::Internal::RNTupleProcessorEntry::GetQualifiedFieldName ( FieldIndex_t fieldIdx) const
inline

Get the name of a field in the entry, including its parent fields.

Parameters
[in]fieldIdxThe index of the field in the entry.

Definition at line 279 of file RNTupleProcessorEntry.hxx.

◆ GetValue()

const ROOT::RFieldBase::RValue & ROOT::Internal::RNTupleProcessorEntry::GetValue ( FieldIndex_t fieldIdx) const
inline

Definition at line 259 of file RNTupleProcessorEntry.hxx.

◆ IsValidField()

bool ROOT::Internal::RNTupleProcessorEntry::IsValidField ( FieldIndex_t fieldIdx) const
inline

Check whether a field is valid for reading.

Parameters
[in]fieldIdxThe index of the field in the entry.

Definition at line 158 of file RNTupleProcessorEntry.hxx.

◆ ReadValue()

void ROOT::Internal::RNTupleProcessorEntry::ReadValue ( FieldIndex_t fieldIdx,
ROOT::NTupleSize_t entryIdx )

Read the field value corresponding to the given field index for the provided entry index.

Parameters
[in]fieldIdxThe index of the field in the entry.
[in]entryIdxThe entry number to read.

Definition at line 115 of file RNTupleProcessorEntry.cxx.

◆ ResetFields()

void ROOT::Internal::RNTupleProcessorEntry::ResetFields ( const std::unordered_set< FieldIndex_t > & fieldIdxs)
inline

Reset the specified fields to a proto field, disconnected from any physical storage.

Parameters
[in]fieldIdxFields to reset.

Definition at line 135 of file RNTupleProcessorEntry.hxx.

◆ SetFieldOriginIdx()

void ROOT::Internal::RNTupleProcessorEntry::SetFieldOriginIdx ( FieldIndex_t fieldIdx,
FieldIndex_t fieldOriginIdx )
inline

Set a field's origin index.

Parameters
[in]fieldIdxThe index of the field in the entry to set.
[in]fieldOriginIdxThe index of the field in the entry the field identified by fieldIdx should point to.

Setting the origin index should be used for articifial fields.

Definition at line 172 of file RNTupleProcessorEntry.hxx.

◆ SetFieldValidity()

void ROOT::Internal::RNTupleProcessorEntry::SetFieldValidity ( FieldIndex_t fieldIdx,
bool isValid )
inline

Set the validity of a field, i.e.

whether it is possible to read its value in the current entry.

Parameters
[in]fieldIdxThe index of the field in the entry.
[in]isValidThe new validity of the field.

Definition at line 148 of file RNTupleProcessorEntry.hxx.

◆ UpdateField()

void ROOT::Internal::RNTupleProcessorEntry::UpdateField ( FieldIndex_t fieldIdx,
std::unique_ptr< ROOT::RFieldBase > field )

Update a field in the entry, preserving the value pointer.

Parameters
[in]fieldIdxIndex of the field to update.
[in]fieldThe new field to use in the entry.

Definition at line 85 of file RNTupleProcessorEntry.cxx.

Member Data Documentation

◆ fFieldName2Index

std::unordered_map<std::string, std::vector<FieldIndex_t> > ROOT::Internal::RNTupleProcessorEntry::fFieldName2Index
private

Definition at line 120 of file RNTupleProcessorEntry.hxx.

◆ fProcessorValues

std::vector<RProcessorValue> ROOT::Internal::RNTupleProcessorEntry::fProcessorValues
private

Definition at line 118 of file RNTupleProcessorEntry.hxx.

Libraries for ROOT::Internal::RNTupleProcessorEntry:

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