17std::vector<ROOT::RFieldBase::RValue> SplitVector(std::shared_ptr<void> valuePtr,
ROOT::RFieldBase &itemField)
19 auto *
vec =
static_cast<std::vector<char> *
>(valuePtr.get());
23 const auto nItems =
vec->size() / itemSize;
24 std::vector<ROOT::RFieldBase::RValue> result;
25 result.reserve(nItems);
26 for (
unsigned i = 0; i < nItems; ++i) {
27 result.emplace_back(itemField.
BindValue(std::shared_ptr<void>(valuePtr,
vec->data() + (i * itemSize))));
35 std::size_t arrayLength)
44 if (!itemField->GetTypeAlias().empty()) {
45 fTypeAlias =
"std::array<" + itemField->GetTypeAlias() +
"," +
46 Internal::GetNormalizedInteger(static_cast<unsigned long long>(arrayLength)) +
">";
48 Attach(std::move(itemField),
"_0");
54 return std::make_unique<RArrayField>(newName, std::move(newItemField),
fArrayLength);
59 std::size_t nbytes = 0;
64 auto arrayPtr =
static_cast<const unsigned char *
>(from);
77 auto arrayPtr =
static_cast<unsigned char *
>(to);
89 auto arrayPtr =
static_cast<unsigned char *
>(to);
103 return RBulkSpec::kAllSet;
108 static const std::vector<std::string> prefixes = {
"std::array<"};
119 auto arrayPtr =
reinterpret_cast<unsigned char *
>(where);
132 RDeleter::operator()(objPtr, dtorOnly);
139 return std::make_unique<RDeleter>();
144 auto valuePtr = value.
GetPtr<
void>();
145 auto arrayPtr =
static_cast<unsigned char *
>(valuePtr.get());
146 std::vector<RValue> result;
169 if (!itemField->GetTypeAlias().empty())
170 fTypeAlias =
"ROOT::VecOps::RVec<" + itemField->GetTypeAlias() +
">";
171 Attach(std::move(itemField),
"_0");
180 auto grandChildFields =
fSubfields[0]->GetMutableSubfields();
181 if (grandChildFields[0]->
IsSimple()) {
192 return std::make_unique<RRVecField>(newName, std::move(newItemField));
199 std::size_t nbytes = 0;
204 for (std::int32_t i = 0; i < *sizePtr; ++i) {
218 if (nItems >
static_cast<std::size_t
>(std::numeric_limits<std::int32_t>::max())) {
223 const std::size_t oldSize = *sizePtr;
225 if (oldSize == nItems) {
234 const bool owns = (*capacityPtr != -1);
236 const bool needsDestruct = owns && itemDeleter;
240 for (std::size_t i = nItems; i < oldSize; ++i) {
241 itemDeleter->operator()(*beginPtr + (i * itemSize),
true );
246 if (std::int32_t(nItems) > *capacityPtr) {
250 for (std::size_t i = 0u; i < oldSize; ++i) {
251 itemDeleter->operator()(*beginPtr + (i * itemSize),
true );
262 *beginPtr =
static_cast<unsigned char *
>(
malloc(nItems * itemSize));
264 *capacityPtr = nItems;
267 if (needsConstruct) {
268 for (std::size_t i = 0u; i < oldSize; ++i)
275 if (needsConstruct) {
276 for (std::size_t i = oldSize; i < nItems; ++i)
291 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
301 for (std::size_t i = 0; i < nItems; ++i) {
314 bulkSpec.
fAuxData->resize(
sizeof(std::size_t));
317 const auto itemValueSize = *
reinterpret_cast<std::size_t *
>(bulkSpec.
fAuxData->data());
318 unsigned char *itemValueArray = bulkSpec.
fAuxData->data() +
sizeof(std::size_t);
325 *beginPtr = itemValueArray;
326 *sizePtr = collectionSize;
334 std::size_t nValues = 1;
335 std::size_t nItems = collectionSize;
336 while (nRemainingValues > 0) {
340 const std::size_t nBatch = std::min(nRemainingValues, nElementsUntilPageEnd);
341 for (std::size_t i = 0; i < nBatch; ++i) {
342 const auto size = offsets[i] - lastOffset;
344 reinterpret_cast<unsigned char *
>(bulkSpec.
fValues) + (nValues + i) *
fValueSize);
345 *beginPtr = itemValueArray + nItems * itemValueSize;
350 lastOffset = offsets[i];
352 nRemainingValues -= nBatch;
356 bulkSpec.
fAuxData->resize(
sizeof(std::size_t) + nItems * itemValueSize);
358 const auto delta = itemValueArray - (bulkSpec.
fAuxData->data() +
sizeof(std::size_t));
360 auto beginPtrAsUChar =
reinterpret_cast<unsigned char *
>(bulkSpec.
fValues);
361 for (std::size_t i = 0; i < bulkSpec.
fCount; ++i) {
362 *
reinterpret_cast<unsigned char **
>(beginPtrAsUChar) -= delta;
369 return RBulkSpec::kAllSet;
379 return representations;
399 if (fieldDesc.GetTypeName().rfind(
"std::array<", 0) == 0) {
400 auto substitute = std::make_unique<RArrayAsRVecField>(
417 void **beginPtr =
new (where)(
void *)(
nullptr);
418 std::int32_t *sizePtr =
new (
reinterpret_cast<void *
>(beginPtr + 1)) std::int32_t(0);
419 new (sizePtr + 1) std::int32_t(-1);
427 for (std::int32_t i = 0; i < *sizePtr; ++i) {
433 RDeleter::operator()(objPtr, dtorOnly);
447 std::vector<RValue> result;
448 result.reserve(*sizePtr);
449 for (std::int32_t i = 0; i < *sizePtr; ++i) {
474 std::optional<std::string_view> emulatedFromType)
480 if (emulatedFromType && !emulatedFromType->empty())
483 if (!itemField->GetTypeAlias().empty())
484 fTypeAlias =
"std::vector<" + itemField->GetTypeAlias() +
">";
488 Attach(std::move(itemField),
"_0");
496std::unique_ptr<ROOT::RVectorField>
499 return std::unique_ptr<ROOT::RVectorField>(
new RVectorField(fieldName, itemField->Clone(
"_0"),
""));
506 auto emulatedFromType = isUntyped ? std::make_optional(
GetTypeName()) : std::nullopt;
507 return std::unique_ptr<ROOT::RVectorField>(
new RVectorField(newName, std::move(newItemField), emulatedFromType));
512 auto typedValue =
static_cast<const std::vector<char> *
>(from);
517 auto count = typedValue->size() /
fItemSize;
519 std::size_t nbytes = 0;
525 for (
unsigned i = 0; i < count; ++i) {
538 auto typedValue =
static_cast<std::vector<char> *
>(
vec);
542 const auto oldNItems = typedValue->size() / itemSize;
543 const auto availNItems = typedValue->capacity() / itemSize;
544 const bool canRealloc = availNItems < nItems;
545 bool allDeallocated =
false;
547 allDeallocated = canRealloc;
548 for (std::size_t i = allDeallocated ? 0 : nItems; i < oldNItems; ++i) {
549 itemDeleter->operator()(typedValue->data() + (i * itemSize),
true );
552 typedValue->resize(nItems * itemSize);
554 for (std::size_t i = allDeallocated ? 0 : oldNItems; i < nItems; ++i) {
562 auto typedValue =
static_cast<std::vector<char> *
>(to);
566 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
577 for (std::size_t i = 0; i < nItems; ++i) {
589 return representations;
609 if (fieldDesc.GetTypeName().rfind(
"std::array<", 0) == 0) {
610 auto substitute = std::make_unique<RArrayAsVectorField>(
625 auto vecPtr =
static_cast<std::vector<char> *
>(objPtr);
629 auto nItems = vecPtr->size() /
fItemSize;
630 for (std::size_t i = 0; i < nItems; ++i) {
634 std::destroy_at(vecPtr);
635 RDeleter::operator()(objPtr, dtorOnly);
642 return std::make_unique<RVectorDeleter>();
665 auto typedValue =
static_cast<const std::vector<bool> *
>(from);
666 auto count = typedValue->size();
667 for (
unsigned i = 0; i < count; ++i) {
668 bool bval = (*typedValue)[i];
669 CallAppendOn(*fSubfields[0], &bval);
672 fPrincipalColumn->
Append(&fNWritten);
673 return count + fPrincipalColumn->GetElement()->GetPackedSize();
676void ROOT::RField<std::vector<bool>>::ReadGlobalImpl(
ROOT::NTupleSize_t globalIndex,
void *to)
678 auto typedValue =
static_cast<std::vector<bool> *
>(to);
680 if (fOnDiskNRepetitions == 0) {
683 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
684 typedValue->resize(nItems);
685 for (std::size_t i = 0; i < nItems; ++i) {
687 CallReadOn(*fSubfields[0], collectionStart + i, &bval);
688 (*typedValue)[i] = bval;
691 typedValue->resize(fOnDiskNRepetitions);
692 for (std::size_t i = 0; i < fOnDiskNRepetitions; ++i) {
694 CallReadOn(*fSubfields[0], globalIndex * fOnDiskNRepetitions + i, &bval);
695 (*typedValue)[i] = bval;
700void ROOT::RField<std::vector<bool>>::ReadInClusterImpl(ROOT::RNTupleLocalIndex localIndex,
void *to)
702 auto typedValue =
static_cast<std::vector<bool> *
>(to);
704 if (fOnDiskNRepetitions == 0) {
707 fPrincipalColumn->GetCollectionInfo(localIndex, &collectionStart, &nItems);
708 typedValue->resize(nItems);
709 for (std::size_t i = 0; i < nItems; ++i) {
711 CallReadOn(*fSubfields[0], collectionStart + i, &bval);
712 (*typedValue)[i] = bval;
715 typedValue->resize(fOnDiskNRepetitions);
716 for (std::size_t i = 0; i < fOnDiskNRepetitions; ++i) {
718 CallReadOn(*fSubfields[0], localIndex * fOnDiskNRepetitions + i, &bval);
719 (*typedValue)[i] = bval;
724const ROOT::RFieldBase::RColumnRepresentations &ROOT::RField<std::vector<bool>>::GetColumnRepresentations()
const
731 return representations;
734void ROOT::RField<std::vector<bool>>::GenerateColumns()
737 GenerateColumnsImpl<ROOT::Internal::RColumnIndex>();
740void ROOT::RField<std::vector<bool>>::GenerateColumns(
const ROOT::RNTupleDescriptor &desc)
742 if (fOnDiskNRepetitions == 0)
743 GenerateColumnsImpl<ROOT::Internal::RColumnIndex>(desc);
746void ROOT::RField<std::vector<bool>>::ReconcileOnDiskField(
const RNTupleDescriptor &desc)
748 const auto &fieldDesc = desc.GetFieldDescriptor(GetOnDiskId());
750 if (fieldDesc.GetTypeName().rfind(
"std::array<", 0) == 0) {
751 EnsureMatchingOnDiskField(desc, kDiffTypeName | kDiffStructure | kDiffNRepetitions).ThrowOnError();
753 if (fieldDesc.GetNRepetitions() == 0) {
754 throw RException(
R__FAIL(
"fixed-size array --> std::vector<bool>: expected repetition count > 0\n" +
758 throw RException(
R__FAIL(
"fixed-size array --> std::vector<bool>: expected plain on-disk field\n" +
761 fOnDiskNRepetitions = fieldDesc.GetNRepetitions();
763 EnsureMatchingOnDiskCollection(desc).ThrowOnError();
767std::vector<ROOT::RFieldBase::RValue> ROOT::RField<std::vector<bool>>::SplitValue(
const RValue &value)
const
769 const auto &typedValue = value.GetRef<std::vector<bool>>();
770 auto count = typedValue.size();
771 std::vector<RValue> result;
772 result.reserve(count);
773 for (
unsigned i = 0; i < count; ++i) {
775 result.emplace_back(fSubfields[0]->BindValue(std::shared_ptr<bool>(
new bool(
true))));
777 result.emplace_back(fSubfields[0]->BindValue(std::shared_ptr<bool>(
new bool(
false))));
783void ROOT::RField<std::vector<bool>>::AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor)
const
791 std::size_t arrayLength)
797 if (!itemField->GetTypeAlias().empty())
798 fTypeAlias =
"ROOT::VecOps::RVec<" + itemField->GetTypeAlias() +
">";
799 Attach(std::move(itemField),
"_0");
809 return std::make_unique<RArrayAsRVecField>(newName, std::move(newItemField),
fArrayLength);
816 void **beginPtr =
new (where)(
void *)(
nullptr);
817 std::int32_t *sizePtr =
new (
static_cast<void *
>(beginPtr + 1)) std::int32_t(0);
818 new (sizePtr + 1) std::int32_t(-1);
864 if (fieldDesc.GetTypeName().rfind(
"std::array<", 0) != 0) {
877 auto arrayPtr = value.
GetPtr<
unsigned char>().get();
878 std::vector<ROOT::RFieldBase::RValue> result;
895 std::size_t arrayLength)
901 if (!itemField->GetTypeAlias().empty())
902 fTypeAlias =
"std::vector<" + itemField->GetTypeAlias() +
">";
903 Attach(std::move(itemField),
"_0");
911 return std::make_unique<RArrayAsVectorField>(newName, std::move(newItemField),
fArrayLength);
916 throw RException(
R__FAIL(
"RArrayAsVectorField fields must only be used for reading"));
923 return std::make_unique<RVectorField::RVectorDeleter>();
928 auto typedValue =
static_cast<std::vector<char> *
>(to);
945 auto typedValue =
static_cast<std::vector<char> *
>(to);
965 if (fieldDesc.GetTypeName().rfind(
"std::array<", 0) != 0) {
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Abstract base class for classes implementing the visitor design pattern.
virtual void VisitVectorField(const ROOT::RVectorField &field)
virtual void VisitVectorBoolField(const ROOT::RField< std::vector< bool > > &field)
virtual void VisitRVecField(const ROOT::RRVecField &field)
virtual void VisitArrayAsRVecField(const ROOT::RArrayAsRVecField &field)
virtual void VisitArrayAsVectorField(const ROOT::RArrayAsVectorField &field)
virtual void VisitArrayField(const ROOT::RArrayField &field)
The in-memory representation of a 32bit or 64bit on-disk index column.
Abstract interface to read data from an ntuple.
const RSharedDescriptorGuard GetSharedDescriptorGuard() const
Takes the read lock for the descriptor.
std::unique_ptr< RDeleter > fItemDeleter
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
RArrayAsRVecField(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField, std::size_t arrayLength)
Constructor of the field.
std::size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< RDeleter > GetDeleter() const final
Returns an RRVecField::RRVecDeleter.
std::size_t fArrayLength
The size of a child field's item.
std::size_t fItemSize
Sub field deleter or nullptr for simple fields.
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
The size of a value of this field, i.e. an RVec.
std::vector< RFieldBase::RValue > SplitValue(const RFieldBase::RValue &value) const final
Creates the list of direct child values given an existing value for this field.
void ReconcileOnDiskField(const RNTupleDescriptor &desc) final
For non-artificial fields, check compatibility of the in-memory field and the on-disk field.
std::size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
std::size_t fValueSize
The length of the arrays in this field.
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
Returns an RVectorField::RVectorDeleter.
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
std::unique_ptr< RDeleter > fItemDeleter
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::size_t fArrayLength
The size of a child field's item.
void ReconcileOnDiskField(const RNTupleDescriptor &desc) final
For non-artificial fields, check compatibility of the in-memory field and the on-disk field.
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
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 ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
std::vector< RFieldBase::RValue > SplitValue(const RFieldBase::RValue &value) const final
Creates the list of direct child values given an existing value for this field.
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.
std::unique_ptr< RDeleter > fItemDeleter
void operator()(void *objPtr, bool dtorOnly) final
Template specializations for C++ std::array and C-style arrays.
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.
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.
Base class for all ROOT issued exceptions.
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.
std::shared_ptr< T > GetPtr() const
A field translates read and write calls from/to underlying columns to/from tree values.
virtual size_t GetValueSize() const =0
The number of bytes taken by a value of the appropriate type.
void Attach(std::unique_ptr< RFieldBase > child, std::string_view expectedChildName="")
Add a new subfield to the list of nested fields.
ROOT::Internal::RColumn * fPrincipalColumn
All fields that have columns have a distinct main column.
std::vector< std::unique_ptr< RFieldBase > > fSubfields
Collections and classes own subfields.
@ kTraitEmulatedField
This field is a user defined type that was missing dictionaries and was reconstructed from the on-dis...
@ kTraitTriviallyDestructible
The type is cleaned up just by freeing its memory. I.e. the destructor performs a no-op.
@ kTraitTriviallyConstructible
No constructor needs to be called, i.e.
@ kTraitMappable
A field of a fundamental type that can be directly mapped via RField<T>::Map(), i....
static std::unique_ptr< RDeleter > GetDeleterOf(const RFieldBase &other)
static ROOT::Internal::RColumn * GetPrincipalColumnOf(const RFieldBase &other)
Fields may need direct access to the principal column of their subfields, e.g. in RRVecField::ReadBul...
RResult< void > EnsureMatchingOnDiskCollection(const RNTupleDescriptor &desc) const
Convenience wrapper for the common case of calling EnsureMatchinOnDiskField() for collections.
std::size_t Append(const void *from)
Write the given value into columns.
std::string GetQualifiedFieldName() const
Returns the field name and parent field names separated by dots (grandparent.parent....
const std::string & GetFieldName() const
RResult< void > EnsureMatchingOnDiskField(const RNTupleDescriptor &desc, std::uint32_t ignoreBits=0) const
Compares the field to the corresponding on-disk field information in the provided descriptor.
static std::size_t CallAppendOn(RFieldBase &other, const void *from)
Allow derived classes to call Append() and Read() on other (sub)fields.
std::uint32_t fTraits
Properties of the type that allow for optimizations of collections of that type.
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.
std::string fTypeAlias
A typedef or using name that was used when creating the field.
std::uint32_t GetTraits() const
const std::string & GetTypeName() const
void GenerateColumnsImpl(const ColumnRepresentation_t &representation, std::uint16_t representationIndex)
Helpers for generating columns.
RValue BindValue(std::shared_ptr< void > objPtr)
Creates a value from a memory location with an already constructed object.
static void CallReadOn(RFieldBase &other, RNTupleLocalIndex localIndex, void *to)
ROOT::DescriptorId_t GetOnDiskId() const
std::unique_ptr< RFieldBase > Clone(std::string_view newName) const
Copies the field and its subfields using a possibly new name and a new, unconnected set of columns.
static void CallConstructValueOn(const RFieldBase &other, void *where)
Allow derived classes to call ConstructValue(void *) and GetDeleter() on other (sub)fields.
RResult< void > EnsureMatchingTypePrefix(const RNTupleDescriptor &desc, const std::vector< std::string > &prefixes) const
Many fields accept a range of type prefixes for schema evolution, e.g.
virtual std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec)
General implementation of bulk read.
@ kDiffStructure
The in-memory field and the on-disk field differ in their structural roles.
@ kDiffTypeName
The in-memory field and the on-disk field have different type names.
@ kDiffNRepetitions
The in-memory field and the on-disk field have different repetition counts.
Classes with dictionaries that can be inspected by TClass.
The on-storage metadata of an RNTuple.
const RFieldDescriptor & GetFieldDescriptor(ROOT::DescriptorId_t fieldId) const
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
ROOT::NTupleSize_t GetIndexInCluster() const
void operator()(void *objPtr, bool dtorOnly) final
std::unique_ptr< RDeleter > fItemDeleter
std::size_t fItemAlignment
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::size_t fBulkNRepetition
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,...
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.
static unsigned char * ResizeRVec(void *rvec, std::size_t nItems, std::size_t itemSize, const RFieldBase *itemField, RDeleter *itemDeleter)
std::unique_ptr< RDeleter > fItemDeleter
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
RFieldBase * fBulkSubfield
May be a direct PoD subfield or a sub-subfield of a fixed-size array of PoD.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
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
void operator()(void *objPtr, bool dtorOnly) final
std::unique_ptr< RDeleter > fItemDeleter
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 ...
std::unique_ptr< RFieldBase > BeforeConnectPageSource(ROOT::Internal::RPageSource &pageSource) final
Called by ConnectPageSource() before connecting; derived classes may override this as appropriate,...
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
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 > 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.
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
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.
std::unique_ptr< RDeleter > GetDeleter() const final
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
std::tuple< unsigned char **, std::int32_t *, std::int32_t * > GetRVecDataMembers(void *rvecPtr)
Retrieve the addresses of the data members of a generic RVec from a pointer to the beginning of the R...
if(pos!=-1) leafTypeName.Remove(pos)
void DestroyRVecWithChecks(std::size_t alignOfT, unsigned char **beginPtr, std::int32_t *capacityPtr)
std::string GetNormalizedInteger(const std::string &intTemplateArg)
Appends 'll' or 'ull' to the where necessary and strips the suffix if not needed.
std::string GetTypeTraceReport(const RFieldBase &field, const RNTupleDescriptor &desc)
Prints the hierarchy of types with their field names and field IDs for the given in-memory field and ...
std::size_t EvalRVecAlignment(std::size_t alignOfSubfield)
std::size_t EvalRVecValueSize(std::size_t alignOfT, std::size_t sizeOfT, std::size_t alignOfRVecT)
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId
ENTupleStructure
The fields in the RNTuple data model tree can carry different structural information about the type s...
Input parameter to RFieldBase::ReadBulk() and RFieldBase::ReadBulkImpl().
RNTupleLocalIndex fFirstIndex
Start of the bulk range.
void * fValues
The destination area, which has to be an array of valid objects of the correct type large enough to h...
std::size_t fCount
Size of the bulk range.
std::vector< unsigned char > * fAuxData
Reference to memory owned by the RBulkValues class.