16#ifndef ROOT7_RNTupleView
17#define ROOT7_RNTupleView
29#include <unordered_map>
32namespace Experimental {
63 std::unique_ptr<ROOT::RFieldBase>
fField;
69 std::unique_ptr<ROOT::RFieldBase>
field;
71 const auto &desc =
pageSource.GetSharedDescriptorGuard().GetRef();
73 if constexpr (std::is_void_v<T>) {
76 field = std::make_unique<ROOT::RField<T>>(
fieldDesc.GetFieldName());
230 const auto &desc =
pageSource.GetSharedDescriptorGuard().GetRef();
287 const auto &desc =
source->GetSharedDescriptorGuard().GetRef();
291 R__FAIL(
"invalid attemt to create collection view on non-collection field " +
fieldDesc.GetFieldName()));
335 template <
typename T>
344 template <
typename T>
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Abstract interface to read data from an ntuple.
const RSharedDescriptorGuard GetSharedDescriptorGuard() const
Takes the read lock for the descriptor.
A view for a collection, that can itself generate new ntuple views for its nested fields.
static RNTupleCollectionView Create(ROOT::DescriptorId_t fieldId, Internal::RPageSource *source)
RNTupleCollectionView & operator=(RNTupleCollectionView &&other)=default
RNTupleCollectionView(RNTupleCollectionView &&other)=default
RNTupleCollectionView GetCollectionView(std::string_view fieldName)
Raises an exception if there is no field with the given name.
RNTupleCollectionView & operator=(const RNTupleCollectionView &other)=delete
Internal::RPageSource * fSource
ROOT::RFieldBase::RValue fValue
RNTupleView< T > GetView(std::string_view fieldName)
Raises an exception if there is no field with the given name.
~RNTupleCollectionView()=default
ROOT::RNTupleLocalRange GetCollectionRange(ROOT::NTupleSize_t globalIndex)
std::uint64_t operator()(RNTupleLocalIndex localIndex)
ROOT::RNTupleLocalRange GetCollectionRange(RNTupleLocalIndex localIndex)
ROOT::RField< RNTupleCardinality< std::uint64_t > > fField
RNTupleDirectAccessView< T > GetDirectAccessView(std::string_view fieldName)
Raises an exception if there is no field with the given name.
RNTupleCollectionView(ROOT::DescriptorId_t fieldId, const std::string &fieldName, Internal::RPageSource *source)
RNTupleCollectionView(const RNTupleCollectionView &other)=delete
ROOT::DescriptorId_t GetFieldId(std::string_view fieldName)
std::uint64_t operator()(ROOT::NTupleSize_t globalIndex)
A view variant that provides direct access to the I/O buffers.
RNTupleDirectAccessView & operator=(const RNTupleDirectAccessView &other)=delete
ROOT::RNTupleGlobalRange GetFieldRange() const
const T & operator()(RNTupleLocalIndex localIndex)
const ROOT::RFieldBase & GetField() const
static ROOT::RField< T > CreateField(ROOT::DescriptorId_t fieldId, Internal::RPageSource &pageSource)
const T & operator()(ROOT::NTupleSize_t globalIndex)
RNTupleDirectAccessView(const RNTupleDirectAccessView &other)=delete
RNTupleDirectAccessView(RNTupleDirectAccessView &&other)=default
RNTupleDirectAccessView & operator=(RNTupleDirectAccessView &&other)=default
ROOT::RNTupleGlobalRange fFieldRange
~RNTupleDirectAccessView()=default
RNTupleDirectAccessView(ROOT::RField< T > field, ROOT::RNTupleGlobalRange range)
An RNTuple that is used to read data from storage.
An RNTupleView provides read-only access to a single field of the ntuple.
RNTupleViewBase(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, std::shared_ptr< T > objPtr)
RNTupleViewBase(const RNTupleViewBase &other)=delete
RNTupleViewBase & operator=(const RNTupleViewBase &other)=delete
const ROOT::RFieldBase & GetField() const
RNTupleViewBase(RNTupleViewBase &&other)=default
void BindRawPtr(T *rawPtr)
ROOT::RNTupleGlobalRange fFieldRange
std::unique_ptr< ROOT::RFieldBase > fField
ROOT::RNTupleGlobalRange GetFieldRange() const
void Bind(std::shared_ptr< T > objPtr)
RNTupleViewBase & operator=(RNTupleViewBase &&other)=default
ROOT::RFieldBase::RBulk CreateBulk()
const ROOT::RFieldBase::RValue & GetValue() const
static std::unique_ptr< ROOT::RFieldBase > CreateField(ROOT::DescriptorId_t fieldId, Internal::RPageSource &pageSource)
RNTupleViewBase(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, T *rawPtr)
~RNTupleViewBase()=default
RNTupleViewBase(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range)
ROOT::RFieldBase::RValue fValue
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range)
RNTupleView(RNTupleView &&other)=default
RNTupleView(const RNTupleView &other)=delete
RNTupleView & operator=(RNTupleView &&other)=default
void operator()(RNTupleLocalIndex localIndex)
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, void *rawPtr)
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, std::shared_ptr< void > objPtr)
RNTupleView & operator=(const RNTupleView &other)=delete
void operator()(ROOT::NTupleSize_t globalIndex)
An RNTupleView for a known type.
RNTupleView & operator=(RNTupleView &&other)=default
const T & operator()(ROOT::NTupleSize_t globalIndex)
RNTupleView & operator=(const RNTupleView &other)=delete
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, std::shared_ptr< T > objPtr)
RNTupleView(RNTupleView &&other)=default
RNTupleView(const RNTupleView &other)=delete
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range, T *rawPtr)
const T & operator()(RNTupleLocalIndex localIndex)
RNTupleView(std::unique_ptr< ROOT::RFieldBase > field, ROOT::RNTupleGlobalRange range)
Base class for all ROOT issued exceptions.
Similar to RValue but manages an array of consecutive values.
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
void Read(ROOT::NTupleSize_t globalIndex)
void EmplaceNew()
Replace the current object pointer by a pointer to a new object constructed by the field.
void Bind(std::shared_ptr< void > objPtr)
void BindRawPtr(void *rawPtr)
A field translates read and write calls from/to underlying columns to/from tree values.
Classes with dictionaries that can be inspected by TClass.
Used to loop over indexes (entries or collections) between start and end.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Used to loop over entries of collections in a single cluster.
ROOT::RNTupleGlobalRange GetFieldRange(const ROOT::RFieldBase &field, const RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
auto MakeAliasedSharedPtr(T *rawPtr)
void CallConnectPageSourceOnField(RFieldBase &, ROOT::Experimental::Internal::RPageSource &)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId