16#ifndef ROOT_RNTupleProcessor
17#define ROOT_RNTupleProcessor
34namespace Experimental {
37struct RNTupleProcessorEntryLoader;
59 std::variant<std::string, TDirectory *>
fStorage;
109 std::unique_ptr<ROOT::RNTupleModel>
fModel;
272 return lh.fCurrentEntryNumber !=
rh.fCurrentEntryNumber;
276 return lh.fCurrentEntryNumber ==
rh.fCurrentEntryNumber;
293 std::unique_ptr<ROOT::RNTupleModel> model =
nullptr,
305 static std::unique_ptr<RNTupleProcessor>
CreateChain(std::vector<RNTupleOpenSpec>
ntuples,
306 std::unique_ptr<ROOT::RNTupleModel> model =
nullptr,
320 std::unique_ptr<ROOT::RNTupleModel> model =
nullptr,
340 static std::unique_ptr<RNTupleProcessor>
342 std::unique_ptr<ROOT::RNTupleModel>
primaryModel =
nullptr,
362 static std::unique_ptr<RNTupleProcessor>
517 bool fJoinTableIsBuilt =
false;
Builds a join table on one or several fields of an RNTuple so it can be joined onto other RNTuples.
Processor specialization for vertically combined (chained) RNTupleProcessors.
void SetEntryPointers(const ROOT::REntry &, std::string_view fieldNamePrefix) final
void PrintStructureImpl(std::ostream &output) const final
Processor-specific implementation for printing its structure, called by PrintStructure().
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
std::vector< ROOT::NTupleSize_t > fInnerNEntries
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided (global) entry number (i.e., considering all RNTuples in th...
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
Processor specialization for horizontally combined (joined) RNTupleProcessors.
std::unique_ptr< RNTupleProcessor > fPrimaryProcessor
std::unique_ptr< Internal::RNTupleJoinTable > fJoinTable
std::unique_ptr< RNTupleProcessor > fAuxiliaryProcessor
std::vector< ROOT::RFieldToken > fJoinFieldTokens
Tokens representing the join fields present in the primary processor.
Specification of the name and location of an RNTuple, used for creating a new RNTupleProcessor.
RNTupleOpenSpec(std::string_view n, const std::string &s)
std::variant< std::string, TDirectory * > fStorage
RNTupleOpenSpec(std::string_view n, TDirectory *s)
std::unique_ptr< ROOT::Internal::RPageSource > CreatePageSource() const
Iterator over the entries of an RNTuple, or vertical concatenation thereof.
RNTupleProcessor & fProcessor
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
friend bool operator==(const iterator &lh, const iterator &rh)
friend bool operator!=(const iterator &lh, const iterator &rh)
ROOT::NTupleSize_t fCurrentEntryNumber
RIterator(RNTupleProcessor &processor, ROOT::NTupleSize_t entryNumber)
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
const std::string & GetProcessorName() const
Get the name of the processor.
static std::unique_ptr< RNTupleProcessor > CreateJoin(RNTupleOpenSpec primaryNTuple, RNTupleOpenSpec auxNTuple, const std::vector< std::string > &joinFields, std::unique_ptr< ROOT::RNTupleModel > primaryModel=nullptr, std::unique_ptr< ROOT::RNTupleModel > auxModel=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
std::unique_ptr< ROOT::REntry > fEntry
virtual ROOT::NTupleSize_t GetNEntries()=0
Get the total number of entries in this processor.
std::size_t fCurrentProcessorNumber
std::unique_ptr< ROOT::RNTupleModel > fModel
ROOT::NTupleSize_t fNEntries
Total number of entries.
friend struct ROOT::Experimental::Internal::RNTupleProcessorEntryLoader
virtual ~RNTupleProcessor()=default
RNTupleProcessor(RNTupleProcessor &&)=delete
virtual void PrintStructureImpl(std::ostream &output) const =0
Processor-specific implementation for printing its structure, called by PrintStructure().
virtual ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber)=0
Load the entry identified by the provided entry number.
const ROOT::RNTupleModel & GetModel() const
Get the model used by the processor.
ROOT::NTupleSize_t GetCurrentEntryNumber() const
Get the entry number that is currently being processed.
ROOT::NTupleSize_t fNEntriesProcessed
std::string fProcessorName
static std::unique_ptr< RNTupleProcessor > CreateChain(std::vector< RNTupleOpenSpec > ntuples, std::unique_ptr< ROOT::RNTupleModel > model=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
virtual void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0)=0
Add the entry mappings for this processor to the provided join table.
std::size_t GetCurrentProcessorNumber() const
Get the number of the inner processor currently being read.
virtual void SetEntryPointers(const ROOT::REntry &entry, std::string_view fieldNamePrefix="")=0
Point the entry's field values of the processor to the pointers from the provided entry.
RNTupleProcessor(std::string_view processorName, std::unique_ptr< ROOT::RNTupleModel > model)
Create a new base RNTupleProcessor.
ROOT::NTupleSize_t fCurrentEntryNumber
void PrintStructure(std::ostream &output=std::cout)
Print a graphical representation of the processor composition.
ROOT::NTupleSize_t GetNEntriesProcessed() const
Get the total number of entries processed so far.
RNTupleProcessor(const RNTupleProcessor &)=delete
RNTupleProcessor & operator=(RNTupleProcessor &&)=delete
static std::unique_ptr< RNTupleProcessor > Create(RNTupleOpenSpec ntuple, std::unique_ptr< ROOT::RNTupleModel > model=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a single RNTuple.
const ROOT::REntry & GetEntry() const
Get a reference to the entry used by the processor.
RNTupleProcessor & operator=(const RNTupleProcessor &)=delete
Processor specialization for processing a single RNTuple.
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
void SetEntryPointers(const ROOT::REntry &entry, std::string_view fieldNamePrefix) final
void PrintStructureImpl(std::ostream &output) const final
Processor-specific implementation for printing its structure, called by PrintStructure().
RNTupleOpenSpec fNTupleSpec
std::unique_ptr< ROOT::Internal::RPageSource > fPageSource
void Connect()
Connect the page source of the underlying RNTuple.
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided (global) entry number (i.e., considering all RNTuples in th...
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.
The RNTupleModel encapulates the schema of an RNTuple.
Describe directory structure in memory.
Namespace for new ROOT classes and functions.
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.