Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::RNTupleProcessorValuePtr< T > Class Template Reference

template<typename T>
class ROOT::RNTupleProcessorValuePtr< T >

Definition at line 82 of file RNTupleProcessor.hxx.

Public Member Functions

void Bind (std::shared_ptr< T > valuePtr)
 Bind the value to valuePtr.
 
std::shared_ptr< T > GetPtr () const
 Get a shared pointer to the field value managed by the processor's entry.
 
bool HasValue () const
 Check if the pointer currently holds a valid value.
 
const T & operator* () const
 Get a reference to the field value managed by the processor's entry.
 
const T * operator-> () const
 Access the field value managed by the processor's entry.
 

Private Member Functions

 RNTupleProcessorValuePtr (ROOT::Internal::RNTupleProcessorEntry *processorEntry, ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t fieldIdx)
 
void BindRawPtr (T *valuePtr)
 Bind the value to valuePtr.
 
T * GetRawPtr () const
 Get a non-owning pointer to the field value managed by the processor's entry.
 

Private Attributes

ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t fFieldIndex
 
ROOT::Internal::RNTupleProcessorEntry * fProcessorEntry
 

Friends

bool operator== (const RNTupleProcessorValuePtr< T > &lhs, const RNTupleProcessorValuePtr< T > &rhs)
 
class RNTupleProcessor
 

#include <ROOT/RNTupleProcessor.hxx>

Constructor & Destructor Documentation

◆ RNTupleProcessorValuePtr()

template<typename T >
ROOT::RNTupleProcessorValuePtr< T >::RNTupleProcessorValuePtr ( ROOT::Internal::RNTupleProcessorEntry * processorEntry,
ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t fieldIdx )
inlineprivate

Definition at line 89 of file RNTupleProcessor.hxx.

Member Function Documentation

◆ Bind()

template<typename T >
void ROOT::RNTupleProcessorValuePtr< T >::Bind ( std::shared_ptr< T > valuePtr)
inline

Bind the value to valuePtr.

Parameters
[in]valuePtrPointer to bind the value to.
Warning
Use this function with care! Values may not always be valid for every entry during processing, for example when a field is not present in one of the chained processors or when during a join operation, no matching entry in the auxiliary processor can be found. Reading valuePtr as-is therefore comes with the risk of reading invalid data. After binding a pointer to an RNTupleProcessorValuePtr, we strongly recommend only accessing its data through this interface, to ensure that only valid data can be read.

Definition at line 142 of file RNTupleProcessor.hxx.

◆ BindRawPtr()

template<typename T >
void ROOT::RNTupleProcessorValuePtr< T >::BindRawPtr ( T * valuePtr)
inlineprivate

Bind the value to valuePtr.

Parameters
[in]valuePtrPointer to bind the value to.
Warning
Use this function with care! Values may not always be valid for every entry during processing, for example when a field is not present in one of the chained processors or when during a join operation, no matching entry in the auxiliary processor can be found. Reading valuePtr as-is therefore comes with the risk of reading invalid data. After binding a pointer to an RNTupleProcessorValuePtr, we strongly recommend only accessing its data through this interface, to ensure that only valid data can be read.

Definition at line 111 of file RNTupleProcessor.hxx.

◆ GetPtr()

template<typename T >
std::shared_ptr< T > ROOT::RNTupleProcessorValuePtr< T >::GetPtr ( ) const
inline

Get a shared pointer to the field value managed by the processor's entry.

Returns
A std::shared_ptr<T> if the field is valid in the current entry, or a nullptr otherwise.

Definition at line 122 of file RNTupleProcessor.hxx.

◆ GetRawPtr()

template<typename T >
T * ROOT::RNTupleProcessorValuePtr< T >::GetRawPtr ( ) const
inlineprivate

Get a non-owning pointer to the field value managed by the processor's entry.

Returns
A T* if the field is valid in the current entry, or a nullptr otherwise.

Definition at line 99 of file RNTupleProcessor.hxx.

◆ HasValue()

template<typename T >
bool ROOT::RNTupleProcessorValuePtr< T >::HasValue ( ) const
inline

Check if the pointer currently holds a valid value.

Definition at line 116 of file RNTupleProcessor.hxx.

◆ operator*()

template<typename T >
const T & ROOT::RNTupleProcessorValuePtr< T >::operator* ( ) const
inline

Get a reference to the field value managed by the processor's entry.

Throws an exception if the field is invalid in the processor's current entry.

Definition at line 148 of file RNTupleProcessor.hxx.

◆ operator->()

template<typename T >
const T * ROOT::RNTupleProcessorValuePtr< T >::operator-> ( ) const
inline

Access the field value managed by the processor's entry.

Throws an exception if the field is invalid in the processor's current entry.

Definition at line 161 of file RNTupleProcessor.hxx.

Friends And Related Symbol Documentation

◆ operator==

template<typename T >
bool operator== ( const RNTupleProcessorValuePtr< T > & lhs,
const RNTupleProcessorValuePtr< T > & rhs )
friend

Definition at line 170 of file RNTupleProcessor.hxx.

◆ RNTupleProcessor

template<typename T >
friend class RNTupleProcessor
friend

Definition at line 83 of file RNTupleProcessor.hxx.

Member Data Documentation

◆ fFieldIndex

Definition at line 87 of file RNTupleProcessor.hxx.

◆ fProcessorEntry

template<typename T >
ROOT::Internal::RNTupleProcessorEntry* ROOT::RNTupleProcessorValuePtr< T >::fProcessorEntry
private

Definition at line 86 of file RNTupleProcessor.hxx.

  • tree/ntuple/inc/ROOT/RNTupleProcessor.hxx