Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
RNTupleRange.hxx
Go to the documentation of this file.
1/// \file ROOT/RNTupleRange.hxx
2/// \ingroup NTuple ROOT7
3/// \author Jakob Blomer <jblomer@cern.ch>
4/// \date 2018-10-05
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT7_RNTupleRange
17#define ROOT7_RNTupleRange
18
19#include <ROOT/RNTupleUtil.hxx>
20
21namespace ROOT {
22
23// clang-format off
24/**
25\class ROOT::RNTupleGlobalRange
26\ingroup NTuple
27\brief Used to loop over indexes (entries or collections) between start and end
28*/
29// clang-format on
31private:
34
35public:
36 class RIterator {
37 private:
39
40 public:
42 using iterator_category = std::forward_iterator_tag;
47
48 RIterator() = default;
50 ~RIterator() = default;
51
52 iterator operator++(int) /* postfix */
53 {
54 auto r = *this;
55 fIndex++;
56 return r;
57 }
58 iterator &operator++() /* prefix */
59 {
60 ++fIndex;
61 return *this;
62 }
64 pointer operator->() { return &fIndex; }
65 bool operator==(const iterator &rh) const { return fIndex == rh.fIndex; }
66 bool operator!=(const iterator &rh) const { return fIndex != rh.fIndex; }
67 };
68
70 RIterator begin() const { return RIterator(fStart); }
71 RIterator end() const { return RIterator(fEnd); }
72 ROOT::NTupleSize_t size() const { return fEnd - fStart; }
74};
75
76// clang-format off
77/**
78\class ROOT::RNTupleLocalRange
79\ingroup NTuple
80\brief Used to loop over entries of collections in a single cluster
81*/
82// clang-format on
84private:
88
89public:
90 class RIterator {
91 private:
93
94 public:
96 using iterator_category = std::forward_iterator_tag;
101
102 RIterator() = default;
104 ~RIterator() = default;
105
106 iterator operator++(int) /* postfix */
107 {
108 auto r = *this;
109 fLocalIndex++;
110 return r;
111 }
112 iterator &operator++() /* prefix */
113 {
114 fLocalIndex++;
115 return *this;
116 }
119 bool operator==(const iterator &rh) const { return fLocalIndex == rh.fLocalIndex; }
120 bool operator!=(const iterator &rh) const { return fLocalIndex != rh.fLocalIndex; }
121 };
122
129 ROOT::NTupleSize_t size() const { return fEnd - fStart; }
130};
131
132namespace Experimental {
133// TODO(gparolini): remove before branching ROOT v6.36
134using RNTupleGlobalRange [[deprecated("ROOT::Experimental::RNTupleGlobalRange moved to ROOT::RNTupleGlobalRange")]] =
136using RNTupleClusterRange [[deprecated("ROOT::Experimental::RNTupleClusterRange moved to ROOT::RNTupleLocalRange")]] =
138} // namespace Experimental
139
140} // namespace ROOT
141
142#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.