16#ifndef ROOT7_RNTupleIndex
17#define ROOT7_RNTupleIndex
23#include <unordered_map>
27namespace Experimental {
113 static std::unique_ptr<RNTupleIndex>
159 template <
typename...
Ts>
163 throw RException(
R__FAIL(
"Number of values must match number of indexed fields."));
167 ([&] {
valuePtrs.push_back(&values); }(), ...);
185 template <
typename...
Ts>
189 throw RException(
R__FAIL(
"Number of values must match number of indexed fields."));
193 ([&] {
valuePtrs.push_back(&values); }(), ...);
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Container for the hashes of the indexed fields.
RIndexValue(const std::vector< NTupleIndexValue_t > &fieldValues)
bool operator==(const RIndexValue &other) const
std::vector< NTupleIndexValue_t > fFieldValues
Builds an index on one or several fields of an RNTuple so it can be joined onto other RNTuples.
std::unique_ptr< RPageSource > fPageSource
The page source belonging to the RNTuple for which to build the index.
RNTupleIndex(const RNTupleIndex &other)=delete
const std::vector< NTupleSize_t > * GetAllEntryNumbers(Ts... values) const
Get all entry numbers for the given index.
RNTupleIndex & operator=(RNTupleIndex &&other)=delete
NTupleSize_t GetFirstEntryNumber(Ts... values) const
Get the entry number containing the given index value.
static std::unique_ptr< RNTupleIndex > Create(const std::vector< std::string > &fieldNames, const RPageSource &pageSource, bool deferBuild=false)
Create an RNTupleIndex from an existing RNTuple.
const std::vector< NTupleSize_t > * GetAllEntryNumbers(const std::vector< void * > &valuePtrs) const
Get all entry numbers for the given index.
NTupleSize_t GetFirstEntryNumber(const std::vector< void * > &valuePtrs) const
Get the first entry number containing the given index value.
RNTupleIndex(const std::vector< std::string > &fieldNames, const RPageSource &pageSource)
Create an a new RNTupleIndex for the RNTuple represented by the provided page source.
void EnsureBuilt() const
Ensure the RNTupleIndex has been built.
std::size_t GetSize() const
Get the number of indexed values.
bool IsBuilt() const
Whether the index has been built (and therefore ready to be used).
bool fIsBuilt
Only built indexes can be queried.
RNTupleIndex & operator=(const RNTupleIndex &other)=delete
std::vector< std::unique_ptr< RFieldBase > > fIndexFields
The fields for which the index is built. Used to compute the hashes for each entry value.
std::uint64_t NTupleIndexValue_t
RNTupleIndex(RNTupleIndex &&other)=delete
void Build()
Build the index.
std::unordered_map< RIndexValue, std::vector< NTupleSize_t >, RIndexValueHash > fIndex
The index itself.
Abstract interface to read data from an ntuple.
Base class for all ROOT issued exceptions.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Hash combinining the individual index value hashes from RIndexValue.
std::size_t operator()(const RIndexValue &indexValue) const