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 92 of file RNTupleProcessorEntry.hxx.

Classes

struct  RProcessorValue
 

Public Types

using FieldIndex_t = std::uint64_t
 

Public Member Functions

FieldIndex_t AddField (std::string_view fieldName, 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.
 
std::optional< FieldIndex_tFindFieldIndex (std::string_view fieldName) 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::RFieldBaseGetField (FieldIndex_t fieldIdx) const
 Get a reference to a field in the entry.
 
std::unordered_set< FieldIndex_tGetFieldIndices () const
 Get all field indices of this entry.
 
std::string GetFieldName (FieldIndex_t fieldIdx) const
 Get the name of a field in the entry, including processor name prefixes in the case of auxiliary fields.
 
const RNTupleProcessorProvenanceGetFieldProvenance (FieldIndex_t fieldIdx) const
 Get the processor provenance of a field in the entry.
 
template<typename T >
std::shared_ptr< T > GetPtr (FieldIndex_t fieldIdx) const
 Get a pointer to the value for the field represented by the provided field index.
 
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, ROOT::RFieldBase &field)
 Update a field in the entry, preserving the value pointer.
 

Private Attributes

std::unordered_map< std::string, FieldIndex_tfFieldName2Index
 
std::vector< RProcessorValuefProcessorValues
 

#include <ROOT/RNTupleProcessorEntry.hxx>

Member Typedef Documentation

◆ FieldIndex_t

Member Function Documentation

◆ AddField()

FieldIndex_t ROOT::Experimental::Internal::RNTupleProcessorEntry::AddField ( std::string_view fieldName,
ROOT::RFieldBase & field,
void * valuePtr,
const RNTupleProcessorProvenance & provenance )
inline

Add a new field to the entry.

Parameters
[in]fieldNameName of the field to add.
[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 181 of file RNTupleProcessorEntry.hxx.

◆ BindRawPtr()

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

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 218 of file RNTupleProcessorEntry.hxx.

◆ FindFieldIndex()

std::optional< FieldIndex_t > ROOT::Experimental::Internal::RNTupleProcessorEntry::FindFieldIndex ( std::string_view fieldName) const
inline

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

Parameters
[in]fieldNameThe name of the field in the entry.
Returns
A std::optional containing the field index if it was found.

Definition at line 162 of file RNTupleProcessorEntry.hxx.

◆ FindFieldName()

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

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 141 of file RNTupleProcessorEntry.hxx.

◆ GetField()

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

Get a reference to a field in the entry.

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

Definition at line 261 of file RNTupleProcessorEntry.hxx.

◆ GetFieldIndices()

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

Get all field indices of this entry.

Definition at line 290 of file RNTupleProcessorEntry.hxx.

◆ GetFieldName()

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

Get the name of a field in the entry, including processor name prefixes in the case of auxiliary fields.

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

Definition at line 281 of file RNTupleProcessorEntry.hxx.

◆ 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 271 of file RNTupleProcessorEntry.hxx.

◆ GetPtr()

template<typename T >
std::shared_ptr< T > ROOT::Experimental::Internal::RNTupleProcessorEntry::GetPtr ( FieldIndex_t fieldIdx) const
inline

Get a pointer to the value for the field represented by the provided field index.

Template Parameters
TThe type of the pointer.
Parameters
[in]fieldIdxThe index of the field in the entry.
Returns
A shared pointer of type T with the field's value.

Definition at line 247 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 129 of file RNTupleProcessorEntry.hxx.

◆ ReadValue()

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

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 229 of file RNTupleProcessorEntry.hxx.

◆ 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 119 of file RNTupleProcessorEntry.hxx.

◆ UpdateField()

void ROOT::Experimental::Internal::RNTupleProcessorEntry::UpdateField ( FieldIndex_t fieldIdx,
ROOT::RFieldBase & field )
inline

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 203 of file RNTupleProcessorEntry.hxx.

Member Data Documentation

◆ fFieldName2Index

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

Definition at line 111 of file RNTupleProcessorEntry.hxx.

◆ fProcessorValues

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

Definition at line 110 of file RNTupleProcessorEntry.hxx.

Libraries for ROOT::Experimental::Internal::RNTupleProcessorEntry:

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