Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleRange.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleRange.hxx
2/// \ingroup NTuple
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2018-10-05
5
6/*************************************************************************
7 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
8 * All rights reserved. *
9 * *
10 * For the licensing terms see $ROOTSYS/LICENSE. *
11 * For the list of contributors see $ROOTSYS/README/CREDITS. *
12 *************************************************************************/
13
14#ifndef ROOT_RNTupleRange
15#define ROOT_RNTupleRange
16
17#include <ROOT/RNTupleUtil.hxx>
18
19namespace ROOT {
20
21// clang-format off
22/**
23\class ROOT::RNTupleGlobalRange
24\ingroup NTuple
25\brief Used to loop over indexes (entries or collections) between start and end
26*/
27// clang-format on
29private:
32
33public:
34 class RIterator {
35 private:
37
38 public:
40 using iterator_category = std::forward_iterator_tag;
45
46 RIterator() = default;
48 ~RIterator() = default;
49
50 iterator operator++(int) /* postfix */
51 {
52 auto r = *this;
53 fIndex++;
54 return r;
55 }
56 iterator &operator++() /* prefix */
57 {
58 ++fIndex;
59 return *this;
60 }
62 pointer operator->() { return &fIndex; }
63 bool operator==(const iterator &rh) const { return fIndex == rh.fIndex; }
64 bool operator!=(const iterator &rh) const { return fIndex != rh.fIndex; }
65 };
66
68 RIterator begin() const { return RIterator(fStart); }
69 RIterator end() const { return RIterator(fEnd); }
70 ROOT::NTupleSize_t size() const { return fEnd - fStart; }
72};
73
74// clang-format off
75/**
76\class ROOT::RNTupleLocalRange
77\ingroup NTuple
78\brief Used to loop over entries of collections in a single cluster
79*/
80// clang-format on
82private:
86
87public:
88 class RIterator {
89 private:
91
92 public:
94 using iterator_category = std::forward_iterator_tag;
99
100 RIterator() = default;
102 ~RIterator() = default;
103
104 iterator operator++(int) /* postfix */
105 {
106 auto r = *this;
107 fLocalIndex++;
108 return r;
109 }
110 iterator &operator++() /* prefix */
111 {
112 fLocalIndex++;
113 return *this;
114 }
117 bool operator==(const iterator &rh) const { return fLocalIndex == rh.fLocalIndex; }
118 bool operator!=(const iterator &rh) const { return fLocalIndex != rh.fLocalIndex; }
119 };
120
127 ROOT::NTupleSize_t size() const { return fEnd - fStart; }
128};
129
130} // namespace ROOT
131
132#endif
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
bool operator==(const iterator &rh) const
RIterator(ROOT::NTupleSize_t index)
std::forward_iterator_tag iterator_category
bool operator!=(const iterator &rh) const
Used to loop over indexes (entries or collections) between start and end.
ROOT::NTupleSize_t size() const
ROOT::NTupleSize_t fStart
ROOT::NTupleSize_t fEnd
RNTupleGlobalRange(ROOT::NTupleSize_t start, ROOT::NTupleSize_t end)
RIterator begin() const
RIterator end() const
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
std::forward_iterator_tag iterator_category
RIterator(RNTupleLocalIndex localIndex)
bool operator==(const iterator &rh) const
bool operator!=(const iterator &rh) const
Used to loop over entries of collections in a single cluster.
const ROOT::NTupleSize_t fStart
const ROOT::DescriptorId_t fClusterId
ROOT::NTupleSize_t size() const
RNTupleLocalRange(ROOT::DescriptorId_t clusterId, ROOT::NTupleSize_t start, ROOT::NTupleSize_t end)
RIterator end() const
RIterator begin() const
const ROOT::NTupleSize_t fEnd
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.
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.