13#ifndef ROOT_TTreeReaderArray
14#define ROOT_TTreeReaderArray
58 bool suppressErrorsForMissingBranch =
false);
61 StreamerElementArrayInfo &arrInfo);
63 std::unique_ptr<TVirtualCollectionReader>
fImpl;
79 std::byte *
At(std::size_t idx)
const {
return reinterpret_cast<std::byte *
>(
UntypedAt(idx)); }
110 template <
typename ReaderArrayType>
117 using pointer = std::conditional_t<std::is_const<ReaderArrayType>::value,
const T *, T *>;
118 using reference = std::conditional_t<std::is_const<ReaderArrayType>::value,
const T &, T &>;
206 const auto index = std::ptrdiff_t(
fIndex);
207 const auto newIndex = index >=
n ? index -
n : std::numeric_limits<
decltype(
fIndex)>::max();
238 T &
At(std::size_t idx) {
return *
static_cast<T *
>(
UntypedAt(idx)); }
239 const T &
At(std::size_t idx)
const {
return *
static_cast<T *
>(
UntypedAt(idx)); }
251#define R__TTreeReaderArray_TypeString(T) #T
253#undef R__TTreeReaderArray_TypeString
260std::string printValue(TTreeReaderArray<T> *val)
262 return printValue(
static_cast<ROOT::Internal::TTreeReaderValueBase *
>(val));
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
#define R__TTreeReaderArray_TypeString(T)
Base class of TTreeReaderArray.
void CreateProxy() override
Create the proxy object for our branch.
std::unique_ptr< TVirtualCollectionReader > fImpl
bool GetBranchAndLeaf(TBranch *&branch, TLeaf *&myLeaf, TDictionary *&branchActualType, bool suppressErrorsForMissingBranch=false)
Determine the branch / leaf and its type; reset fProxy / fSetupStatus on error.
StreamerElementArrayInfo FillStreamerElementArrayInfo(TStreamerElement *elem)
std::size_t GetSize() const
TTreeReaderArrayBase(TTreeReader *reader, const char *branchname, TDictionary *dict)
void * UntypedAt(std::size_t idx) const
EReadStatus GetReadStatus() const override
bool IsContiguous() const
std::size_t GetValueSize() const
Returns the sizeof of the collection value type. Returns 0 in case the value size could not be retrie...
const char * GetBranchContentDataType(TBranch *branch, TString &contentTypeName, TDictionary *&dict, StreamerElementArrayInfo &arrInfo)
Access a branch's collection content (not the collection itself) through a proxy.
void SetImpl(TBranch *branch, TLeaf *myLeaf)
Create the TVirtualCollectionReader object for our branch.
std::byte * At(std::size_t idx) const
TTreeReaderUntypedArray(TTreeReader &tr, std::string_view branchName, std::string_view innerTypeName)
std::string fArrayElementTypeName
const char * GetDerivedTypeName() const final
friend class ::TTreeReader
Detail::TBranchProxy * GetProxy() const
@ kReadError
Problem reading data.
TTreeReaderValueBase(TTreeReader *reader, const char *branchname, TDictionary *dict, bool opaqueRead=false)
Construct a tree value reader and register it with the reader object.
A TTree is a list of TBranches.
This class defines an abstract interface that must be implemented by all classes that contain diction...
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Describe one element (data member) to be Streamed.
Random access iterator to the elements of a TTreeReaderArray.
Iterator_t()
Default ctor: constructs a past-the-end iterator.
bool operator>(const Iterator_t &other) const
reference operator[](std::size_t index) const
Iterator_t & operator--()
Pre-decrement operator.
bool operator!=(const Iterator_t &other) const
std::ptrdiff_t difference_type
Iterator_t operator++(int)
Post-increment operator.
bool operator>=(const Iterator_t &other) const
reference operator*() const
Iterator_t(const Iterator_t &)=default
Iterator_t & operator++()
Pre-increment operator.
Iterator_t operator--(int)
Post-decrement operator.
Iterator_t & operator-=(std::ptrdiff_t n)
Iterator_t & operator=(Iterator_t &&)=default
std::conditional_t< std::is_const< ReaderArrayType >::value, const T *, T * > pointer
bool operator<(const Iterator_t &other) const
std::ptrdiff_t operator-(const Iterator_t &other) const
TTreeReaderArray * fArray
Iterator_t & operator=(const Iterator_t &)=default
std::conditional_t< std::is_const< ReaderArrayType >::value, const T &, T & > reference
Iterator_t & operator+=(std::ptrdiff_t n)
Iterator_t(Iterator_t &&)=default
bool operator<=(const Iterator_t &other) const
Iterator_t operator-(std::ptrdiff_t n) const
bool operator==(const Iterator_t &other) const
friend auto operator+(std::ptrdiff_t n, const Iterator_t &it) -> decltype(it+n)
Iterator_t operator+(std::ptrdiff_t n) const
std::random_access_iterator_tag iterator_category
pointer operator->() const
Iterator_t(std::size_t index, TTreeReaderArray *array)
Construct iterator.
Iterator_t(std::size_t index, const TTreeReaderArray *array)
Construct iterator from a const TTreeReaderArray.
const char * GetDerivedTypeName() const override
Iterator_t< const TTreeReaderArray< T > > const_iterator
TTreeReaderArray(TTreeReader &tr, const char *branchname)
Create an array reader of branch "branchname" for TTreeReader "tr".
const_iterator cend() const
Iterator_t< TTreeReaderArray< T > > iterator
const_iterator cbegin() const
const T & At(std::size_t idx) const
const_iterator begin() const
const T & operator[](std::size_t idx) const
T & operator[](std::size_t idx)
const_iterator end() const
int fArrayCumulativeLength
std::array< int, 5 > fArrayDims