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 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 {
22namespace Experimental {
23
24// clang-format off
25/**
26\class ROOT::Experimental::RNTupleGlobalRange
27\ingroup NTuple
28\brief Used to loop over indexes (entries or collections) between start and end
29*/
30// clang-format on
32private:
35
36public:
37 class RIterator {
38 private:
40
41 public:
43 using iterator_category = std::forward_iterator_tag;
48
49 RIterator() = default;
51 ~RIterator() = default;
52
53 iterator operator++(int) /* postfix */
54 {
55 auto r = *this;
56 fIndex++;
57 return r;
58 }
59 iterator &operator++() /* prefix */
60 {
61 ++fIndex;
62 return *this;
63 }
65 pointer operator->() { return &fIndex; }
66 bool operator==(const iterator &rh) const { return fIndex == rh.fIndex; }
67 bool operator!=(const iterator &rh) const { return fIndex != rh.fIndex; }
68 };
69
71 RIterator begin() const { return RIterator(fStart); }
72 RIterator end() const { return RIterator(fEnd); }
73 NTupleSize_t size() const { return fEnd - fStart; }
74 bool IsValid() const { return (fStart != kInvalidNTupleIndex) && (fEnd != kInvalidNTupleIndex); }
75};
76
77// clang-format off
78/**
79\class ROOT::Experimental::RNTupleClusterRange
80\ingroup NTuple
81\brief Used to loop over entries of collections in a single cluster
82*/
83// clang-format on
85private:
89
90public:
91 class RIterator {
92 private:
94
95 public:
97 using iterator_category = std::forward_iterator_tag;
102
103 RIterator() = default;
105 ~RIterator() = default;
106
107 iterator operator++(int) /* postfix */
108 {
109 auto r = *this;
110 fIndex++;
111 return r;
112 }
113 iterator &operator++() /* prefix */
114 {
115 fIndex++;
116 return *this;
117 }
119 pointer operator->() { return &fIndex; }
120 bool operator==(const iterator &rh) const { return fIndex == rh.fIndex; }
121 bool operator!=(const iterator &rh) const { return fIndex != rh.fIndex; }
122 };
123
125 : fClusterId(clusterId), fStart(start), fEnd(end)
126 {
127 }
130 NTupleSize_t size() const { return fEnd - fStart; }
131};
132
133} // namespace Experimental
134} // namespace ROOT
135
136#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
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.
const ClusterSize_t::ValueType fStart
RNTupleClusterRange(DescriptorId_t clusterId, ClusterSize_t::ValueType start, ClusterSize_t::ValueType end)
const ClusterSize_t::ValueType fEnd
Used to loop over indexes (entries or collections) between start and end.
RNTupleGlobalRange(NTupleSize_t start, NTupleSize_t end)
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...