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

Processor specialization for processing a single RNTuple.

Definition at line 773 of file RNTupleProcessor.hxx.

Public Member Functions

 RNTupleSingleProcessor (const RNTupleSingleProcessor &)=delete
 
 RNTupleSingleProcessor (RNTupleSingleProcessor &&)=delete
 
 ~RNTupleSingleProcessor () override
 
RIterator begin ()
 
RIterator end ()
 
ROOT::NTupleSize_t GetNEntriesProcessed () const
 Get the total number of entries processed so far.
 
const RNTupleProcessorOptions & GetOptions () const
 Get the options used for this processor.
 
void LoadEntry (const REntryMapping &mapping)
 Load the entry identified by the entry mapping.
 
RNTupleSingleProcessor & operator= (const RNTupleSingleProcessor &)=delete
 
RNTupleSingleProcessor & operator= (RNTupleSingleProcessor &&)=delete
 
void PrintStructure (std::ostream &output=std::cout)
 Print a graphical representation of the processor composition.
 
RNTupleProcessorOptionalPtr< void > RequestField (const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr)
 Request access to a field for reading during processing.
 
template<typename T >
RNTupleProcessorOptionalPtr< T > RequestField (const std::string &fieldName, void *valuePtr=nullptr)
 Request access to a field for reading during processing.
 

Static Public Member Functions

static std::unique_ptr< RNTupleProcessor > Create (RNTupleOpenSpec ntuple, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 Create an RNTupleProcessor for a single RNTuple.
 
static std::unique_ptr< RNTupleProcessor > CreateChain (std::vector< RNTupleOpenSpec > ntuples, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
 
static std::unique_ptr< RNTupleProcessor > CreateChain (std::vector< std::unique_ptr< RNTupleProcessor > > innerProcessors, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 Create an RNTupleProcessor for a chain (i.e., a vertical combination) of other RNTupleProcessors.
 

Protected Member Functions

Internal::RNTupleProcessorEntry & GetEntry ()
 Get a reference to the processor's internal entry.
 
const Internal::RNTupleProcessorEntry & GetEntry () const
 Get a reference to the processor's internal entry.
 
void IncrementEntryMapping (REntryMapping &mapping)
 Increment the local entry mapping by one.
 
bool IsInitialized () const
 Check if the processor already has been initialized.
 

Protected Attributes

std::shared_ptr< Internal::RNTupleProcessorEntry > fEntry = nullptr
 
std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > fFieldIdxs
 
ROOT::NTupleSize_t fNEntries = kInvalidNTupleIndex
 Total number of entries.
 
ROOT::NTupleSize_t fNEntriesProcessed = 0
 
RNTupleProcessorOptions fOptions
 

Private Member Functions

 RNTupleSingleProcessor (RNTupleOpenSpec ntuple, const RNTupleProcessorOptions &opts)
 Construct a new RNTupleProcessor for processing a single RNTuple.
 
void AddAllFieldsToEntry (const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
 Add all known fields (from on-disk information) to the entry.
 
void AddEntriesToJoinTable (Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
 Add the entry mappings for this processor to the provided join table.
 
Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry (const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance()) final
 Add a field to the entry.
 
Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry (std::unique_ptr< ROOT::RFieldBase > field, const std::string &fieldName, void *valuePtr, const Internal::RNTupleProcessorProvenance &provenance) final
 Add a field to the entry.
 
bool CanReadFieldFromDisk (std::string_view fieldName) final
 Check if a field exists on-disk and can be read by the processor.
 
void Connect (const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > &fieldIdxs, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance(), bool updateFields=false) final
 Connect the provided fields indices in the entry to their on-disk fields.
 
std::unique_ptr< ROOT::RFieldBase > ConnectField (std::unique_ptr< ROOT::RFieldBase > field)
 Connect an existing field to the processor's page source.
 
std::unique_ptr< ROOT::RFieldBase > CreateAndConnectField (const std::string &qualifiedFieldName, const std::string &typeName)
 Create a new field and connect it to the processor's page source.
 
void Disconnect () final
 Disconnect the processor from associated physical storage.
 
ROOT::NTupleSize_t GetNEntries () final
 Get the total number of entries in this processor.
 
void Initialize (std::shared_ptr< Internal::RNTupleProcessorEntry > entry=nullptr) final
 Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.
 
void LoadEntryImpl (const REntryMapping &mapping) final
 Load the entry identified by the entry mapping.
 
void PrintStructureImpl (std::ostream &output) const final
 Processor-specific implementation for printing its structure, called by PrintStructure().
 
void SetEntryMapping (ROOT::NTupleSize_t globalEntryNumber, REntryMapping &mapping) final
 Set the local entry mapping (for nested processors), according to a global entry number.
 

Private Attributes

RNTupleOpenSpec fNTupleSpec
 
std::unique_ptr< ROOT::Internal::RPageSource > fPageSource
 

Friends

class RNTupleProcessor
 

#include <ROOT/RNTupleProcessor.hxx>

Inheritance diagram for ROOT::Experimental::RNTupleSingleProcessor:
[legend]

Constructor & Destructor Documentation

◆ RNTupleSingleProcessor() [1/3]

ROOT::Experimental::RNTupleSingleProcessor::RNTupleSingleProcessor ( RNTupleOpenSpec ntuple,
const RNTupleProcessorOptions & opts )
private

Construct a new RNTupleProcessor for processing a single RNTuple.

Parameters
[in]ntupleThe source specification (name and storage location) for the RNTuple to process.
[in]optsOptions for the processor.

Definition at line 118 of file RNTupleProcessor.cxx.

◆ RNTupleSingleProcessor() [2/3]

ROOT::Experimental::RNTupleSingleProcessor::RNTupleSingleProcessor ( const RNTupleSingleProcessor & )
delete

◆ RNTupleSingleProcessor() [3/3]

ROOT::Experimental::RNTupleSingleProcessor::RNTupleSingleProcessor ( RNTupleSingleProcessor && )
delete

◆ ~RNTupleSingleProcessor()

ROOT::Experimental::RNTupleSingleProcessor::~RNTupleSingleProcessor ( )
inlineoverride

Definition at line 890 of file RNTupleProcessor.hxx.

Member Function Documentation

◆ AddAllFieldsToEntry()

void ROOT::Experimental::RNTupleSingleProcessor::AddAllFieldsToEntry ( const Internal::RNTupleProcessorProvenance & provenance,
bool includeSubfields )
finalprivatevirtual

Add all known fields (from on-disk information) to the entry.

See also
RNTupleProcessor::AddAllFieldsToEntry()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 256 of file RNTupleProcessor.cxx.

◆ AddEntriesToJoinTable()

void ROOT::Experimental::RNTupleSingleProcessor::AddEntriesToJoinTable ( Internal::RNTupleJoinTable & joinTable,
ROOT::NTupleSize_t entryOffset = 0 )
finalprivatevirtual

Add the entry mappings for this processor to the provided join table.

See also
ROOT::Experimental::RNTupleProcessor::AddEntriesToJoinTable

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 332 of file RNTupleProcessor.cxx.

◆ AddFieldToEntry() [1/2]

ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t ROOT::Experimental::RNTupleSingleProcessor::AddFieldToEntry ( const std::string & fieldName,
const std::string & typeName,
void * valuePtr = nullptr,
const Internal::RNTupleProcessorProvenance & provenance = Internal::RNTupleProcessorProvenance() )
finalprivatevirtual

Add a field to the entry.

See also
RNTupleProcessor::AddFieldToEntry()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 203 of file RNTupleProcessor.cxx.

◆ AddFieldToEntry() [2/2]

ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t ROOT::Experimental::RNTupleSingleProcessor::AddFieldToEntry ( std::unique_ptr< ROOT::RFieldBase > field,
const std::string & fieldName,
void * valuePtr,
const Internal::RNTupleProcessorProvenance & provenance )
finalprivatevirtual

Add a field to the entry.

See also
RNTupleProcessor::AddFieldToEntry()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 230 of file RNTupleProcessor.cxx.

◆ begin()

RIterator ROOT::Experimental::RNTupleProcessor::begin ( )
inlineinherited

Definition at line 731 of file RNTupleProcessor.hxx.

◆ CanReadFieldFromDisk()

bool ROOT::Experimental::RNTupleSingleProcessor::CanReadFieldFromDisk ( std::string_view fieldName)
finalprivatevirtual

Check if a field exists on-disk and can be read by the processor.

See also
RNTupleProcessor::CanReadFieldFromDisk()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 145 of file RNTupleProcessor.cxx.

◆ Connect()

void ROOT::Experimental::RNTupleSingleProcessor::Connect ( const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > & fieldIdxs,
const Internal::RNTupleProcessorProvenance & provenance = Internal::RNTupleProcessorProvenance(),
bool updateFields = false )
finalprivatevirtual

Connect the provided fields indices in the entry to their on-disk fields.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 306 of file RNTupleProcessor.cxx.

◆ ConnectField()

std::unique_ptr< ROOT::RFieldBase > ROOT::Experimental::RNTupleSingleProcessor::ConnectField ( std::unique_ptr< ROOT::RFieldBase > field)
private

Connect an existing field to the processor's page source.

Parameters
[in]fieldPointer to the field to add
Returns
The same field, but wrapped in a new unique pointer. This is needed, because in order to add the field to the page source it first needs to be attached to its zero field, in order to correctly handle field substitutions. Afterwards, we release the field again from the zero field.

Definition at line 193 of file RNTupleProcessor.cxx.

◆ Create()

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::Create ( RNTupleOpenSpec ntuple,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
staticinherited

Create an RNTupleProcessor for a single RNTuple.

Parameters
[in]ntupleThe name and storage location of the RNTuple to process.
[in]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 46 of file RNTupleProcessor.cxx.

◆ CreateAndConnectField()

std::unique_ptr< ROOT::RFieldBase > ROOT::Experimental::RNTupleSingleProcessor::CreateAndConnectField ( const std::string & qualifiedFieldName,
const std::string & typeName )
private

Create a new field and connect it to the processor's page source.

Parameters
[in]qualifiedFieldNameName of the field to add, prefixed with its parent fields, if applicable.
[in]typeNameType of the field to add.
Returns
The newly created field.
Exceptions
ROOT::RExceptionIn case the requested field cannot be found on disk.

Definition at line 156 of file RNTupleProcessor.cxx.

◆ CreateChain() [1/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateChain ( std::vector< RNTupleOpenSpec > ntuples,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
staticinherited

Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.

Parameters
[in]ntuplesA list specifying the names and locations of the RNTuples to process.
[in]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 52 of file RNTupleProcessor.cxx.

◆ CreateChain() [2/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateChain ( std::vector< std::unique_ptr< RNTupleProcessor > > innerProcessors,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
staticinherited

Create an RNTupleProcessor for a chain (i.e., a vertical combination) of other RNTupleProcessors.

Parameters
[in]innerProcessorsA list with the processors to chain.
[in]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 69 of file RNTupleProcessor.cxx.

◆ Disconnect()

void ROOT::Experimental::RNTupleSingleProcessor::Disconnect ( )
finalprivatevirtual

Disconnect the processor from associated physical storage.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 324 of file RNTupleProcessor.cxx.

◆ end()

RIterator ROOT::Experimental::RNTupleProcessor::end ( )
inlineinherited

Definition at line 732 of file RNTupleProcessor.hxx.

◆ GetEntry() [1/2]

Internal::RNTupleProcessorEntry & ROOT::Experimental::RNTupleProcessor::GetEntry ( )
inlineprotectedinherited

Get a reference to the processor's internal entry.

Definition at line 487 of file RNTupleProcessor.hxx.

◆ GetEntry() [2/2]

const Internal::RNTupleProcessorEntry & ROOT::Experimental::RNTupleProcessor::GetEntry ( ) const
inlineprotectedinherited

Get a reference to the processor's internal entry.

Definition at line 491 of file RNTupleProcessor.hxx.

◆ GetNEntries()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleSingleProcessor::GetNEntries ( )
inlinefinalprivatevirtual

Get the total number of entries in this processor.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 831 of file RNTupleProcessor.hxx.

◆ GetNEntriesProcessed()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::GetNEntriesProcessed ( ) const
inlineinherited

Get the total number of entries processed so far.

Definition at line 582 of file RNTupleProcessor.hxx.

◆ GetOptions()

const RNTupleProcessorOptions & ROOT::Experimental::RNTupleProcessor::GetOptions ( ) const
inlineinherited

Get the options used for this processor.

Definition at line 578 of file RNTupleProcessor.hxx.

◆ IncrementEntryMapping()

void ROOT::Experimental::RNTupleProcessor::IncrementEntryMapping ( REntryMapping & mapping)
inlineprotectedinherited

Increment the local entry mapping by one.

Parameters
[in]mappingEntry mapping to increment

Definition at line 477 of file RNTupleProcessor.hxx.

◆ Initialize()

void ROOT::Experimental::RNTupleSingleProcessor::Initialize ( std::shared_ptr< Internal::RNTupleProcessorEntry > entry = nullptr)
finalprivatevirtual

Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.

At this point, the page source for the underlying RNTuple of the processor will be created and opened.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 127 of file RNTupleProcessor.cxx.

◆ IsInitialized()

bool ROOT::Experimental::RNTupleProcessor::IsInitialized ( ) const
inlineprotectedinherited

Check if the processor already has been initialized.

Definition at line 450 of file RNTupleProcessor.hxx.

◆ LoadEntry()

void ROOT::Experimental::RNTupleProcessor::LoadEntry ( const REntryMapping & mapping)
inlineinherited

Load the entry identified by the entry mapping.

Parameters
[in]mappingMapping to the entry to load

Definition at line 654 of file RNTupleProcessor.hxx.

◆ LoadEntryImpl()

void ROOT::Experimental::RNTupleSingleProcessor::LoadEntryImpl ( const REntryMapping & mapping)
finalprivatevirtual

Load the entry identified by the entry mapping.

See also
ROOT::Experimental::RNTupleProcessor::LoadEntryImpl

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 295 of file RNTupleProcessor.cxx.

◆ operator=() [1/2]

RNTupleSingleProcessor & ROOT::Experimental::RNTupleSingleProcessor::operator= ( const RNTupleSingleProcessor & )
delete

◆ operator=() [2/2]

RNTupleSingleProcessor & ROOT::Experimental::RNTupleSingleProcessor::operator= ( RNTupleSingleProcessor && )
delete

◆ PrintStructure()

void ROOT::Experimental::RNTupleProcessor::PrintStructure ( std::ostream & output = std::cout)
inlineinherited

Print a graphical representation of the processor composition.

Parameters
[in,out]outputStream to print to (default is stdout).

Example:

The structure of a processor representing a join between a single primary RNTuple and a chain of two auxiliary RNTuples will be printed as follows:

+-----------------------------+ +-----------------------------+
| ntuple | | ntuple_aux |
| ntuple.root | | ntuple_aux1.root |
+-----------------------------+ +-----------------------------+
+-----------------------------+
| ntuple_aux |
| ntuple_aux2.root |
+-----------------------------+

Definition at line 674 of file RNTupleProcessor.hxx.

◆ PrintStructureImpl()

void ROOT::Experimental::RNTupleSingleProcessor::PrintStructureImpl ( std::ostream & output) const
finalprivatevirtual

Processor-specific implementation for printing its structure, called by PrintStructure().

See also
ROOT::Experimental::RNTupleProcessor::PrintStructureImpl

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 339 of file RNTupleProcessor.cxx.

◆ RequestField() [1/2]

RNTupleProcessorOptionalPtr< void > ROOT::Experimental::RNTupleProcessor::RequestField ( const std::string & fieldName,
const std::string & typeName,
void * valuePtr = nullptr )
inlineinherited

Request access to a field for reading during processing.

Parameters
[in]fieldNameName of the requested field.
[in]typeNameType of the requested field.
[in]valuePtrPointer to bind to the field's value in the entry. If this is a nullptr, a pointer will be created.
Returns
An void-type RNTupleProcessorOptionalPtr, which provides access to the field's value.
Warning
Provide a valuePtr 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 passing a pointer to RequestField, we strongly recommend only accessing its data through the interface of the returned RNTupleProcessorOptionalPtr, to ensure that only valid data can be read.

Definition at line 643 of file RNTupleProcessor.hxx.

◆ RequestField() [2/2]

template<typename T >
RNTupleProcessorOptionalPtr< T > ROOT::Experimental::RNTupleProcessor::RequestField ( const std::string & fieldName,
void * valuePtr = nullptr )
inlineinherited

Request access to a field for reading during processing.

Template Parameters
TType of the requested field.
Parameters
[in]fieldNameName of the requested field.
[in]valuePtrPointer to bind to the field's value in the entry. If this is a nullptr, a pointer will be created.
Returns
An RNTupleProcessorOptionalPtr of type T, which provides access to the field's value.
Warning
Provide a valuePtr 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 passing a pointer to RequestField, we strongly recommend only accessing its data through the interface of the returned RNTupleProcessorOptionalPtr, to ensure that only valid data can be read.

Definition at line 601 of file RNTupleProcessor.hxx.

◆ SetEntryMapping()

void ROOT::Experimental::RNTupleSingleProcessor::SetEntryMapping ( ROOT::NTupleSize_t globalEntryNumber,
REntryMapping & mapping )
finalprivatevirtual

Set the local entry mapping (for nested processors), according to a global entry number.

See also
ROOT::Experimental::RNTupleProcessor::SetEntryMapping

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 286 of file RNTupleProcessor.cxx.

Friends And Related Symbol Documentation

◆ RNTupleProcessor

friend class RNTupleProcessor
friend

Definition at line 774 of file RNTupleProcessor.hxx.

Member Data Documentation

◆ fEntry

std::shared_ptr<Internal::RNTupleProcessorEntry> ROOT::Experimental::RNTupleProcessor::fEntry = nullptr
protectedinherited

Definition at line 435 of file RNTupleProcessor.hxx.

◆ fFieldIdxs

std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> ROOT::Experimental::RNTupleProcessor::fFieldIdxs
protectedinherited

Definition at line 436 of file RNTupleProcessor.hxx.

◆ fNEntries

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::fNEntries = kInvalidNTupleIndex
protectedinherited

Total number of entries.

Only to be used internally by the processor, not meant to be exposed in the public interface.

Definition at line 440 of file RNTupleProcessor.hxx.

◆ fNEntriesProcessed

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::fNEntriesProcessed = 0
protectedinherited

Definition at line 442 of file RNTupleProcessor.hxx.

◆ fNTupleSpec

RNTupleOpenSpec ROOT::Experimental::RNTupleSingleProcessor::fNTupleSpec
private

Definition at line 777 of file RNTupleProcessor.hxx.

◆ fOptions

RNTupleProcessorOptions ROOT::Experimental::RNTupleProcessor::fOptions
protectedinherited

Definition at line 433 of file RNTupleProcessor.hxx.

◆ fPageSource

std::unique_ptr<ROOT::Internal::RPageSource> ROOT::Experimental::RNTupleSingleProcessor::fPageSource
private

Definition at line 778 of file RNTupleProcessor.hxx.

Libraries for ROOT::Experimental::RNTupleSingleProcessor:

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