Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
Example usage (see ntpl012_processor.C for a full example):
An RNTupleProcessor is created by providing one or more RNTupleOpenSpecs, each of which contains the name and storage location of a single RNTuple. The RNTuples are processed in the order in which they were provided.
The RNTupleProcessor constructor also (optionally) accepts an RNTupleModel, which determines which fields should be read. If no model is provided, a default model based on the descriptor of the first specified RNTuple will be used. If a field that was present in the first RNTuple is not found in a subsequent one, an error will be thrown.
The RNTupleProcessor provides an iterator which gives access to the REntry containing the field data for the current entry. Additional bookkeeping information can be obtained through the RNTupleProcessor itself.
Definition at line 67 of file RNTupleProcessor.hxx.
Classes | |
class | RFieldContext |
Manager for a field as part of the RNTupleProcessor. More... | |
class | RIterator |
Iterator over the entries of an RNTuple, or vertical concatenation thereof. More... | |
Public Member Functions | |
RNTupleProcessor (const RNTupleProcessor &)=delete | |
RNTupleProcessor (RNTupleProcessor &&)=delete | |
virtual | ~RNTupleProcessor ()=default |
RIterator | begin () |
RIterator | end () |
std::size_t | GetCurrentNTupleNumber () const |
Get the index to the RNTuple currently being processed, according to the sources specified upon creation. | |
const REntry & | GetEntry () const |
Returns a reference to the entry used by the processor. | |
NTupleSize_t | GetLocalEntryNumber () const |
Get the entry number local to the RNTuple that is currently being processed. | |
NTupleSize_t | GetNEntriesProcessed () const |
Get the total number of entries processed so far. | |
RNTupleProcessor & | operator= (const RNTupleProcessor &)=delete |
RNTupleProcessor & | operator= (RNTupleProcessor &&)=delete |
Static Public Member Functions | |
static std::unique_ptr< RNTupleProcessor > | CreateChain (const std::vector< RNTupleOpenSpec > &ntuples, std::unique_ptr< RNTupleModel > model=nullptr) |
Create a new RNTuple processor chain for vertical concatenation of RNTuples. | |
Protected Member Functions | |
RNTupleProcessor (const std::vector< RNTupleOpenSpec > &ntuples) | |
virtual NTupleSize_t | Advance ()=0 |
Advance the processor to the next available entry. | |
virtual void | ConnectFields ()=0 |
Creates and connects concrete fields to the current page source, based on the proto-fields. | |
virtual NTupleSize_t | ConnectNTuple (const RNTupleOpenSpec &ntuple)=0 |
Connect an RNTuple for processing. | |
Protected Attributes | |
std::size_t | fCurrentNTupleNumber |
std::unique_ptr< REntry > | fEntry |
std::vector< RFieldContext > | fFieldContexts |
NTupleSize_t | fLocalEntryNumber |
NTupleSize_t | fNEntriesProcessed |
std::vector< RNTupleOpenSpec > | fNTuples |
std::unique_ptr< Internal::RPageSource > | fPageSource |
#include <ROOT/RNTupleProcessor.hxx>
|
inlineprotected |
Definition at line 136 of file RNTupleProcessor.hxx.
|
delete |
|
delete |
|
virtualdefault |
|
protectedpure virtual |
Advance the processor to the next available entry.
Checks if the end of the currently connected RNTuple is reached. If this is the case, either the next RNTuple is connected or the iterator has reached the end.
Implemented in ROOT::Experimental::RNTupleChainProcessor.
|
inline |
Definition at line 225 of file RNTupleProcessor.hxx.
|
protectedpure virtual |
Creates and connects concrete fields to the current page source, based on the proto-fields.
Implemented in ROOT::Experimental::RNTupleChainProcessor.
|
protectedpure virtual |
Connect an RNTuple for processing.
[in] | ntuple | The RNTupleOpenSpec describing the RNTuple to connect. |
Creates and attaches new page source for the specified RNTuple, and connects the fields that are known by the processor to it.
Implemented in ROOT::Experimental::RNTupleChainProcessor.
|
static |
Create a new RNTuple processor chain for vertical concatenation of RNTuples.
[in] | ntuples | A list specifying the names and locations of the ntuples to process. |
[in] | model | An RNTupleModel specifying which fields can be read by the processor. If no model is provided, one will be created based on the descriptor of the first ntuple specified. |
Definition at line 21 of file RNTupleProcessor.cxx.
|
inline |
Definition at line 226 of file RNTupleProcessor.hxx.
|
inline |
Get the index to the RNTuple currently being processed, according to the sources specified upon creation.
Definition at line 156 of file RNTupleProcessor.hxx.
|
inline |
Returns a reference to the entry used by the processor.
Definition at line 169 of file RNTupleProcessor.hxx.
|
inline |
Get the entry number local to the RNTuple that is currently being processed.
When only one RNTuple is present in the processor chain, the return value is equal to GetGlobalEntryNumber.
Definition at line 162 of file RNTupleProcessor.hxx.
|
inline |
Get the total number of entries processed so far.
When only one RNTuple is present in the processor chain, the return value is equal to GetLocalEntryNumber.
Definition at line 152 of file RNTupleProcessor.hxx.
|
delete |
|
delete |
|
protected |
Definition at line 108 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 103 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 105 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 109 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 107 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 102 of file RNTupleProcessor.hxx.
|
protected |
Definition at line 104 of file RNTupleProcessor.hxx.