Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RFieldSequenceContainer.hxx
Go to the documentation of this file.
1/// \file ROOT/RField/SequenceContainer.hxx
2/// \author Jakob Blomer <jblomer@cern.ch>
3/// \date 2018-10-09
4
5/*************************************************************************
6 * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. *
7 * All rights reserved. *
8 * *
9 * For the licensing terms see $ROOTSYS/LICENSE. *
10 * For the list of contributors see $ROOTSYS/README/CREDITS. *
11 *************************************************************************/
12
13#ifndef ROOT_RField_SequenceContainer
14#define ROOT_RField_SequenceContainer
15
16#ifndef ROOT_RField
17#error "Please include RField.hxx!"
18#endif
19
20#include <ROOT/RFieldBase.hxx>
21#include <ROOT/RNTupleTypes.hxx>
22#include <ROOT/RVec.hxx>
23
24#include <array>
25#include <memory>
26#include <vector>
27
28namespace ROOT {
29
30namespace Detail {
31class RFieldVisitor;
32} // namespace Detail
33
34namespace Internal {
35std::unique_ptr<RFieldBase> CreateEmulatedVectorField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField,
36 std::string_view emulatedFromType);
37}
38
39////////////////////////////////////////////////////////////////////////////////
40/// Template specializations for C++ std::array and C-style arrays
41////////////////////////////////////////////////////////////////////////////////
42
43/// The generic field for fixed size arrays, which do not need an offset column
44class RArrayField : public RFieldBase {
45private:
46 class RArrayDeleter : public RDeleter {
47 private:
48 std::size_t fItemSize = 0;
49 std::size_t fArrayLength = 0;
50 std::unique_ptr<RDeleter> fItemDeleter;
51
52 public:
53 RArrayDeleter(std::size_t itemSize, std::size_t arrayLength, std::unique_ptr<RDeleter> itemDeleter)
54 : fItemSize(itemSize), fArrayLength(arrayLength), fItemDeleter(std::move(itemDeleter))
55 {
56 }
57 void operator()(void *objPtr, bool dtorOnly) final;
58 };
59
60 std::size_t fItemSize;
61 std::size_t fArrayLength;
62
63protected:
64 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final;
65
66 void ConstructValue(void *where) const final;
67 std::unique_ptr<RDeleter> GetDeleter() const final;
68
69 std::size_t AppendImpl(const void *from) final;
70 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
71 void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final;
72 std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final;
73
74 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
75
76public:
77 RArrayField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField, std::size_t arrayLength);
78 RArrayField(RArrayField &&other) = default;
79 RArrayField &operator=(RArrayField &&other) = default;
80 ~RArrayField() override = default;
81
82 std::vector<RValue> SplitValue(const RValue &value) const final;
83 size_t GetLength() const { return fArrayLength; }
84 size_t GetValueSize() const final { return fItemSize * fArrayLength; }
85 size_t GetAlignment() const final { return fSubfields[0]->GetAlignment(); }
86 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
87};
88
89template <typename ItemT, std::size_t N>
90class RField<std::array<ItemT, N>> : public RArrayField {
91public:
92 static std::string TypeName() { return "std::array<" + RField<ItemT>::TypeName() + "," + std::to_string(N) + ">"; }
93 explicit RField(std::string_view name) : RArrayField(name, std::make_unique<RField<ItemT>>("_0"), N) {}
94 RField(RField &&other) = default;
95 RField &operator=(RField &&other) = default;
96 ~RField() override = default;
97};
98
99template <typename ItemT, std::size_t N>
100class RField<ItemT[N]> final : public RField<std::array<ItemT, N>> {
101public:
102 explicit RField(std::string_view name) : RField<std::array<ItemT, N>>(name) {}
103 RField(RField &&other) = default;
104 RField &operator=(RField &&other) = default;
105 ~RField() final = default;
106};
107
108////////////////////////////////////////////////////////////////////////////////
109/// Template specializations for ROOT's RVec
110////////////////////////////////////////////////////////////////////////////////
111
112/// The type-erased field for a RVec<Type>
113class RRVecField : public RFieldBase {
114 friend class RArrayAsRVecField; // to use the RRVecDeleter and to call ResizeRVec()
115
116 // Ensures that the RVec pointed to by rvec has at least nItems valid elements
117 // Returns the possibly new "begin pointer" of the RVec, i.e. the pointer to the data area.
118 static unsigned char *
119 ResizeRVec(void *rvec, std::size_t nItems, std::size_t itemSize, const RFieldBase *itemField, RDeleter *itemDeleter);
120
121 class RRVecDeleter : public RDeleter {
122 private:
123 std::size_t fItemAlignment;
124 std::size_t fItemSize = 0;
125 std::unique_ptr<RDeleter> fItemDeleter;
126
127 public:
128 explicit RRVecDeleter(std::size_t itemAlignment) : fItemAlignment(itemAlignment) {}
129 RRVecDeleter(std::size_t itemAlignment, std::size_t itemSize, std::unique_ptr<RDeleter> itemDeleter)
130 : fItemAlignment(itemAlignment), fItemSize(itemSize), fItemDeleter(std::move(itemDeleter))
131 {
132 }
133 void operator()(void *objPtr, bool dtorOnly) final;
134 };
135
136 std::unique_ptr<RDeleter> fItemDeleter;
137
138protected:
139 std::size_t fItemSize;
141 std::size_t fValueSize;
142
143 // For bulk read optimzation
144 std::size_t fBulkNRepetition = 1;
145 /// May be a direct PoD subfield or a sub-subfield of a fixed-size array of PoD
147
148 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final;
150 void GenerateColumns() final;
151 void GenerateColumns(const ROOT::RNTupleDescriptor &desc) final;
152
153 void ConstructValue(void *where) const final;
154 std::unique_ptr<RDeleter> GetDeleter() const final;
155
156 std::size_t AppendImpl(const void *from) final;
157 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
158 std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final;
159
161 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
162
163 void CommitClusterImpl() final { fNWritten = 0; }
164
165public:
166 RRVecField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField);
167 RRVecField(RRVecField &&) = default;
169 RRVecField(const RRVecField &) = delete;
171 ~RRVecField() override = default;
172
173 std::vector<RValue> SplitValue(const RValue &value) const final;
174 size_t GetValueSize() const final;
175 size_t GetAlignment() const final;
176 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
177};
178
179template <typename ItemT>
180class RField<ROOT::VecOps::RVec<ItemT>> final : public RRVecField {
181public:
182 RField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField)
183 : RRVecField(fieldName, std::move(itemField))
184 {
185 }
186
187 explicit RField(std::string_view name) : RField(name, std::make_unique<RField<ItemT>>("_0")) {}
188 RField(RField &&other) = default;
189 RField &operator=(RField &&other) = default;
190 ~RField() final = default;
191
192 static std::string TypeName() { return "ROOT::VecOps::RVec<" + RField<ItemT>::TypeName() + ">"; }
193};
194
195////////////////////////////////////////////////////////////////////////////////
196/// Template specializations for C++ std::vector
197////////////////////////////////////////////////////////////////////////////////
198
199/// The generic field for a (nested) `std::vector<Type>` except for `std::vector<bool>`
200/// The field can be constructed as untyped collection through CreateUntyped().
201class RVectorField : public RFieldBase {
202 friend class RArrayAsVectorField; // to get access to the RVectorDeleter
203 friend std::unique_ptr<RFieldBase> Internal::CreateEmulatedVectorField(std::string_view fieldName,
204 std::unique_ptr<RFieldBase> itemField,
205 std::string_view emulatedFromType);
206
207 class RVectorDeleter : public RDeleter {
208 private:
209 std::size_t fItemSize = 0;
210 std::unique_ptr<RDeleter> fItemDeleter;
211
212 public:
213 RVectorDeleter() = default;
214 RVectorDeleter(std::size_t itemSize, std::unique_ptr<RDeleter> itemDeleter)
215 : fItemSize(itemSize), fItemDeleter(std::move(itemDeleter))
216 {
217 }
218 void operator()(void *objPtr, bool dtorOnly) final;
219 };
220
221 std::size_t fItemSize;
223 std::unique_ptr<RDeleter> fItemDeleter;
224
225 // Ensures that the std::vector pointed to by vec has at least nItems valid elements.
226 static void ResizeVector(void *vec, std::size_t nItems, std::size_t itemSize, const RFieldBase &itemField,
227 RDeleter *itemDeleter);
228
229protected:
230 /// Creates a possibly-untyped VectorField.
231 /// If `emulatedFromType` is not nullopt, the field is untyped. If the string is empty, it is a "regular"
232 /// untyped vector field; otherwise, it was created as an emulated field from the given type name.
233 RVectorField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField,
234 std::optional<std::string_view> emulatedFromType);
235
236 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final;
237
239 void GenerateColumns() final;
240 void GenerateColumns(const ROOT::RNTupleDescriptor &desc) final;
241
242 void ConstructValue(void *where) const final { new (where) std::vector<char>(); }
243 std::unique_ptr<RDeleter> GetDeleter() const final;
244
245 std::size_t AppendImpl(const void *from) final;
246 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
247
248 std::unique_ptr<RFieldBase> BeforeConnectPageSource(ROOT::Internal::RPageSource &pageSource) final;
249 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
250
251 void CommitClusterImpl() final { fNWritten = 0; }
252
253public:
254 RVectorField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField);
255 RVectorField(RVectorField &&other) = default;
257 ~RVectorField() override = default;
258
259 static std::unique_ptr<RVectorField>
260 CreateUntyped(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField);
261
262 std::vector<RValue> SplitValue(const RValue &value) const final;
263 size_t GetValueSize() const final { return sizeof(std::vector<char>); }
264 size_t GetAlignment() const final { return std::alignment_of<std::vector<char>>(); }
265 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
266};
267
268template <typename ItemT>
269class RField<std::vector<ItemT>> final : public RVectorField {
270public:
271 static std::string TypeName() { return "std::vector<" + RField<ItemT>::TypeName() + ">"; }
272 explicit RField(std::string_view name) : RVectorField(name, std::make_unique<RField<ItemT>>("_0")) {}
273 RField(RField &&other) = default;
274 RField &operator=(RField &&other) = default;
275 ~RField() final = default;
276};
277
278// `std::vector<bool>` is a template specialization and needs special treatment
279template <>
280class RField<std::vector<bool>> final : public RFieldBase {
281private:
282 ROOT::Internal::RColumnIndex fNWritten{0};
283 /// If schema-evolved from an std::array, fOnDiskNRepetition is > 0 and there will be no
284 /// principal column.
285 std::size_t fOnDiskNRepetitions = 0;
286
287protected:
288 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final
289 {
290 return std::make_unique<RField>(newName);
291 }
292
293 const RColumnRepresentations &GetColumnRepresentations() const final;
294 void GenerateColumns() final;
295 void GenerateColumns(const ROOT::RNTupleDescriptor &desc) final;
296
297 void ConstructValue(void *where) const final { new (where) std::vector<bool>(); }
298 std::unique_ptr<RDeleter> GetDeleter() const final { return std::make_unique<RTypedDeleter<std::vector<bool>>>(); }
299
300 std::size_t AppendImpl(const void *from) final;
301 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
302 void ReadInClusterImpl(ROOT::RNTupleLocalIndex localIndex, void *to) final;
303
304 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
305
306 void CommitClusterImpl() final { fNWritten = 0; }
307
308public:
309 static std::string TypeName() { return "std::vector<bool>"; }
310 explicit RField(std::string_view name);
311 RField(RField &&other) = default;
312 RField &operator=(RField &&other) = default;
313 ~RField() final = default;
314
315 std::vector<RValue> SplitValue(const RValue &value) const final;
316
317 size_t GetValueSize() const final { return sizeof(std::vector<bool>); }
318 size_t GetAlignment() const final { return std::alignment_of<std::vector<bool>>(); }
319 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
320};
321
322////////////////////////////////////////////////////////////////////////////////
323/// Additional classes related to sequence containers
324////////////////////////////////////////////////////////////////////////////////
325
326/**
327\class ROOT::RArrayAsRVecField
328\brief A field for fixed-size arrays that are represented as RVecs in memory.
329\ingroup NTuple
330This class is used only for reading. In particular, it helps exposing
331arbitrarily-nested `std::array` on-disk fields as RVecs for usage in RDataFrame.
332*/
333class RArrayAsRVecField final : public RFieldBase {
334private:
335 std::unique_ptr<RDeleter> fItemDeleter; /// Sub field deleter or nullptr for simple fields
336 std::size_t fItemSize; /// The size of a child field's item
337 std::size_t fArrayLength; /// The length of the arrays in this field
338 std::size_t fValueSize; /// The size of a value of this field, i.e. an RVec
339
340protected:
341 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final;
342
343 void GenerateColumns() final { throw RException(R__FAIL("RArrayAsRVec fields must only be used for reading")); }
345
346 void ConstructValue(void *where) const final;
347 /// Returns an RRVecField::RRVecDeleter
348 std::unique_ptr<RDeleter> GetDeleter() const final;
349
350 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
351 void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final;
352
353 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
354
355public:
356 /**
357 Constructor of the field. The `itemField` argument represents the inner
358 item of the on-disk array, i.e. for an `std::array<float>` it is the `float`
359 field and not the `std::array` itself.
360 */
361 RArrayAsRVecField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField, std::size_t arrayLength);
362 RArrayAsRVecField(const RArrayAsRVecField &other) = delete;
363 RArrayAsRVecField &operator=(const RArrayAsRVecField &other) = delete;
365 RArrayAsRVecField &operator=(RArrayAsRVecField &&other) = default;
366 ~RArrayAsRVecField() final = default;
367
368 std::size_t GetValueSize() const final { return fValueSize; }
369 std::size_t GetAlignment() const final;
370
371 std::vector<RFieldBase::RValue> SplitValue(const RFieldBase::RValue &value) const final;
372 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
373};
374
375/**
376\class ROOT::RArrayAsVectorField
377\brief A field for fixed-size arrays that are represented as std::vector in memory.
378\ingroup NTuple
379This class is used only for reading. In particular, it helps for schema evolution of fixed-size arrays into vectors.
380*/
381class RArrayAsVectorField final : public RFieldBase {
382private:
383 std::unique_ptr<RDeleter> fItemDeleter; /// Sub field deleter or nullptr for simple fields
384 std::size_t fItemSize; /// The size of a child field's item
385 std::size_t fArrayLength; /// The length of the arrays in this field
386
387protected:
388 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName) const final;
389
390 void GenerateColumns() final;
392
393 void ConstructValue(void *where) const final { new (where) std::vector<char>(); }
394 /// Returns an RVectorField::RVectorDeleter
395 std::unique_ptr<RDeleter> GetDeleter() const final;
396
397 void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final;
398 void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final;
399
400 void ReconcileOnDiskField(const RNTupleDescriptor &desc) final;
401
402public:
403 /// The `itemField` argument represents the inner item of the on-disk array,
404 /// i.e. for an `std::array<float>` it is the `float`
405 RArrayAsVectorField(std::string_view fieldName, std::unique_ptr<RFieldBase> itemField, std::size_t arrayLength);
407 RArrayAsVectorField &operator=(const RArrayAsVectorField &other) = delete;
409 RArrayAsVectorField &operator=(RArrayAsVectorField &&other) = default;
410 ~RArrayAsVectorField() final = default;
411
412 size_t GetValueSize() const final { return sizeof(std::vector<char>); }
413 size_t GetAlignment() const final { return std::alignment_of<std::vector<char>>(); }
414
415 std::vector<RFieldBase::RValue> SplitValue(const RFieldBase::RValue &value) const final;
416 void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final;
417};
418
419} // namespace ROOT
420
421#endif
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Definition RError.hxx:299
#define N
char name[80]
Definition TGX11.cxx:148
TRObject operator()(const T1 &t1) const
Abstract base class for classes implementing the visitor design pattern.
The in-memory representation of a 32bit or 64bit on-disk index column.
Abstract interface to read data from an ntuple.
Additional classes related to sequence containers.
std::unique_ptr< RDeleter > fItemDeleter
RArrayAsRVecField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::size_t arrayLength)
Constructor of the field.
std::size_t fArrayLength
The size of a child field's item.
std::size_t fItemSize
Sub field deleter or nullptr for simple fields.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
The size of a value of this field, i.e. an RVec.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
std::size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::size_t fValueSize
The length of the arrays in this field.
A field for fixed-size arrays that are represented as std::vector in memory.
std::unique_ptr< RDeleter > fItemDeleter
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::size_t fArrayLength
The size of a child field's item.
RArrayAsVectorField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::size_t arrayLength)
The itemField argument represents the inner item of the on-disk array, i.e.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
The length of the arrays in this field.
std::size_t fItemSize
Sub field deleter or nullptr for simple fields.
RArrayDeleter(std::size_t itemSize, std::size_t arrayLength, std::unique_ptr< RDeleter > itemDeleter)
std::unique_ptr< RDeleter > fItemDeleter
void operator()(void *objPtr, bool dtorOnly) final
std::unique_ptr< RDeleter > GetDeleter() const final
RArrayField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::size_t arrayLength)
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final
General implementation of bulk read.
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void ReconcileOnDiskField(const RNTupleDescriptor &desc) final
For non-artificial fields, check compatibility of the in-memory field and the on-disk field.
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void ReconcileOnDiskField(const RNTupleDescriptor &desc) final
For non-artificial fields, check compatibility of the in-memory field and the on-disk field.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
Definition RField.hxx:223
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
std::unique_ptr< RDeleter > GetDeleter() const final
Definition RField.hxx:206
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
The list of column representations a field can have.
A functor to release the memory acquired by CreateValue() (memory and constructor).
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
A field translates read and write calls from/to underlying columns to/from tree values.
std::vector< std::unique_ptr< RFieldBase > > fSubfields
Collections and classes own subfields.
virtual const RColumnRepresentations & GetColumnRepresentations() const
Implementations in derived classes should return a static RColumnRepresentations object.
virtual void GenerateColumns()
Implementations in derived classes should create the backing columns corresponding to the field type ...
virtual void CommitClusterImpl()
RFieldBase(std::string_view name, std::string_view type, ROOT::ENTupleStructure structure, bool isSimple, std::size_t nRepetitions=0)
The constructor creates the underlying column objects and connects them to either a sink or a source.
RField(RField &&other)=default
~RField() final=default
RField & operator=(RField &&other)=default
RField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField)
RField & operator=(RField &&other)=default
~RField() final=default
RField & operator=(RField &&other)=default
static std::string TypeName()
Definition RField.hxx:322
RField(std::string_view name)
Definition RField.hxx:323
The on-storage metadata of an RNTuple.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
RRVecDeleter(std::size_t itemAlignment, std::size_t itemSize, std::unique_ptr< RDeleter > itemDeleter)
std::unique_ptr< RDeleter > fItemDeleter
RRVecDeleter(std::size_t itemAlignment)
Template specializations for ROOT's RVec.
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
RRVecField & operator=(RRVecField &&)=default
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
~RRVecField() override=default
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
RRVecField(const RRVecField &)=delete
std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final
General implementation of bulk read.
ROOT::Internal::RColumnIndex fNWritten
RRVecField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField)
void ReconcileOnDiskField(const RNTupleDescriptor &desc) final
For non-artificial fields, check compatibility of the in-memory field and the on-disk field.
std::unique_ptr< RFieldBase > BeforeConnectPageSource(ROOT::Internal::RPageSource &pageSource) final
Called by ConnectPageSource() before connecting; derived classes may override this as appropriate,...
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
static unsigned char * ResizeRVec(void *rvec, std::size_t nItems, std::size_t itemSize, const RFieldBase *itemField, RDeleter *itemDeleter)
std::unique_ptr< RDeleter > fItemDeleter
RFieldBase * fBulkSubfield
May be a direct PoD subfield or a sub-subfield of a fixed-size array of PoD.
RRVecField(RRVecField &&)=default
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::unique_ptr< RDeleter > GetDeleter() const final
RRVecField & operator=(RRVecField &)=delete
RVectorDeleter(std::size_t itemSize, std::unique_ptr< RDeleter > itemDeleter)
Template specializations for C++ std::vector.
static std::unique_ptr< RVectorField > CreateUntyped(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField)
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
RVectorField(RVectorField &&other)=default
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
static void ResizeVector(void *vec, std::size_t nItems, std::size_t itemSize, const RFieldBase &itemField, RDeleter *itemDeleter)
RVectorField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::optional< std::string_view > emulatedFromType)
Creates a possibly-untyped VectorField.
~RVectorField() override=default
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
std::unique_ptr< RDeleter > fItemDeleter
ROOT::Internal::RColumnIndex fNWritten
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
RVectorField & operator=(RVectorField &&other)=default
A "std::vector"-like collection of values implementing handy operation to analyse them.
Definition RVec.hxx:1525
STL class.
STL class.
STL class.
Special implementation of ROOT::RRangeCast for TCollection, including a check that the cast target ty...
Definition TObject.h:395
std::unique_ptr< RFieldBase > CreateEmulatedVectorField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::string_view emulatedFromType)
Definition RField.cxx:598
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Input parameter to RFieldBase::ReadBulk() and RFieldBase::ReadBulkImpl().