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

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

Definition at line 90 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 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_tFindFieldIndex (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.
 
std::unordered_set< FieldIndex_tGetFieldIndices () const
 Get all field indices of this entry.
 
const RNTupleProcessorProvenanceGetFieldProvenance (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::RValueGetValue (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 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< RProcessorValuefProcessorValues
 

#include <ROOT/RNTupleProcessorEntry.hxx>

Member Typedef Documentation

◆ FieldIndex_t

Member Function Documentation

◆ AddField()

ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t ROOT::Experimental::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.

◆ BindRawPtr()

void ROOT::Experimental::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 98 of file RNTupleProcessorEntry.cxx.

◆ Clear()

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

Clear all fields from the entry.

Definition at line 122 of file RNTupleProcessorEntry.hxx.

◆ FindFieldIndex()

std::optional< ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t > ROOT::Experimental::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.
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::Experimental::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.

◆ GetFieldIndices()

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

Get all field indices of this entry.

Definition at line 114 of file RNTupleProcessorEntry.cxx.

◆ GetFieldProvenance()

const RNTupleProcessorProvenance & ROOT::Experimental::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 210 of file RNTupleProcessorEntry.hxx.

◆ GetQualifiedFieldName()

std::string ROOT::Experimental::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 220 of file RNTupleProcessorEntry.hxx.

◆ GetValue()

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

Definition at line 200 of file RNTupleProcessorEntry.hxx.

◆ IsValidField()

bool ROOT::Experimental::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 143 of file RNTupleProcessorEntry.hxx.

◆ ReadValue()

void ROOT::Experimental::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 104 of file RNTupleProcessorEntry.cxx.

◆ SetFieldValidity()

void ROOT::Experimental::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 133 of file RNTupleProcessorEntry.hxx.

◆ UpdateField()

void ROOT::Experimental::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 79 of file RNTupleProcessorEntry.cxx.

Member Data Documentation

◆ fFieldName2Index

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

Definition at line 117 of file RNTupleProcessorEntry.hxx.

◆ fProcessorValues

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

Definition at line 115 of file RNTupleProcessorEntry.hxx.


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