34 auto result = std::make_unique<RFieldZero>();
36 result->Attach(
f->Clone(
f->GetFieldName()));
64 visitor.VisitCardinalityField(*
this);
176 visitor.VisitUInt8Field(*
this);
225 visitor.VisitFloatField(*
this);
247 visitor.VisitDoubleField(*
this);
252 fTypeAlias =
"Double32_t";
281 visitor.VisitInt16Field(*
this);
310 visitor.VisitUInt16Field(*
this);
339 visitor.VisitInt32Field(*
this);
368 visitor.VisitUInt32Field(*
this);
397 visitor.VisitUInt64Field(*
this);
426 visitor.VisitInt64Field(*
this);
453 auto typedValue =
static_cast<const std::string *
>(from);
457 fPrincipalColumn->Append(&fIndex);
458 return length + fPrincipalColumn->GetElement()->GetPackedSize();
463 auto typedValue =
static_cast<std::string *
>(to);
477 visitor.VisitStringField(*
this);
484 fMaxAlignment(
source.fMaxAlignment),
488 for (
const auto &
f :
source.GetConstSubfields())
489 Attach(
f->Clone(
f->GetFieldName()));
500 fTraits |= kTraitTrivialType;
502 fMaxAlignment = std::max(fMaxAlignment,
item->GetAlignment());
504 fTraits &=
item->GetTraits();
505 Attach(std::move(
item));
509 fSize += GetItemPadding(
fSize, fMaxAlignment);
512std::unique_ptr<ROOT::RFieldBase>
562 for (
unsigned i = 0; i < fSubfields.size(); ++i) {
563 nbytes += CallAppendOn(*fSubfields[i],
static_cast<const unsigned char *
>(from) + fOffsets[i]);
570 for (
unsigned i = 0; i < fSubfields.size(); ++i) {
571 CallReadOn(*fSubfields[i],
globalIndex,
static_cast<unsigned char *
>(to) + fOffsets[i]);
577 for (
unsigned i = 0; i < fSubfields.size(); ++i) {
578 CallReadOn(*fSubfields[i],
localIndex,
static_cast<unsigned char *
>(to) + fOffsets[i]);
584 for (
unsigned i = 0; i < fSubfields.size(); ++i) {
585 CallConstructValueOn(*fSubfields[i],
static_cast<unsigned char *
>(
where) + fOffsets[i]);
591 for (
unsigned i = 0; i < fItemDeleters.size(); ++i) {
592 fItemDeleters[i]->operator()(
reinterpret_cast<unsigned char *
>(
objPtr) + fOffsets[i],
true );
601 for (
const auto &
f : fSubfields) {
604 return std::make_unique<RRecordDeleter>(std::move(
itemDeleters), fOffsets);
610 std::vector<RValue>
result;
611 result.reserve(fSubfields.size());
612 for (
unsigned i = 0; i < fSubfields.size(); ++i) {
613 result.emplace_back(fSubfields[i]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(),
basePtr + fOffsets[i])));
620 visitor.VisitRecordField(*
this);
654 for (std::size_t
word = 0;
word < (fN + kBitsPerWord - 1) / kBitsPerWord; ++
word) {
655 for (std::size_t
mask = 0; (
mask < kBitsPerWord) && (i < fN); ++
mask, ++i) {
667 for (std::size_t i = 0; i < fN; ++i) {
679 for (std::size_t i = 0; i < fN; ++i) {
690 visitor.VisitBitsetField(*
this);
724 fPrincipalColumn->Append(&fNWritten);
730 auto nbytesItem = CallAppendOn(*fSubfields[0], from);
732 fPrincipalColumn->Append(&fNWritten);
746 visitor.VisitNullableField(*
this);
759 auto newItemField = fSubfields[0]->Clone(fSubfields[0]->GetFieldName());
765 auto typedValue =
static_cast<const std::unique_ptr<char> *
>(from);
775 auto ptr =
static_cast<std::unique_ptr<char> *
>(to);
787 fItemDeleter->operator()(
valuePtr,
false );
795 valuePtr = CallCreateObjectRawPtrOn(*fSubfields[0]);
796 ptr->reset(
reinterpret_cast<char *
>(
valuePtr));
806 fItemDeleter->operator()(
typedPtr->get(),
false );
814 return std::make_unique<RUniquePtrDeleter>(GetDeleterOf(*fSubfields[0]));
819 std::vector<RValue>
result;
820 const auto &ptr =
value.GetRef<std::unique_ptr<char>>();
822 result.emplace_back(fSubfields[0]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(), ptr.get())));
839 return reinterpret_cast<bool *
>(
reinterpret_cast<unsigned char *
>(
optionalPtr) + fSubfields[0]->GetValueSize());
844 return GetEngagementPtr(
const_cast<void *
>(
optionalPtr));
849 auto newItemField = fSubfields[0]->Clone(fSubfields[0]->GetFieldName());
855 if (*GetEngagementPtr(from)) {
856 return AppendValue(from);
867 if (*
engagementPtr && !(fSubfields[0]->GetTraits() & kTraitTriviallyDestructible))
868 fItemDeleter->operator()(to,
true );
871 if (!(*
engagementPtr) && !(fSubfields[0]->GetTraits() & kTraitTriviallyConstructible))
872 CallConstructValueOn(*fSubfields[0], to);
873 CallReadOn(*fSubfields[0],
itemIndex, to);
880 *GetEngagementPtr(
where) =
false;
886 auto engagementPtr =
reinterpret_cast<bool *
>(
reinterpret_cast<unsigned char *
>(
objPtr) + fEngagementPtrOffset);
888 fItemDeleter->operator()(
objPtr,
true );
895 return std::make_unique<ROptionalDeleter>(
896 (fSubfields[0]->GetTraits() & kTraitTriviallyDestructible) ?
nullptr : GetDeleterOf(*fSubfields[0]),
897 fSubfields[0]->GetValueSize());
902 std::vector<RValue>
result;
905 result.emplace_back(fSubfields[0]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(),
valuePtr)));
914 const auto actualSize = fSubfields[0]->GetValueSize() +
sizeof(
bool);
926 return fSubfields[0]->GetAlignment();
944 auto newItemField = fSubfields[0]->Clone(fSubfields[0]->GetFieldName());
950 std::vector<RValue>
result;
951 result.emplace_back(fSubfields[0]->BindValue(
value.GetPtr<
void>()));
957 visitor.VisitAtomicField(*
this);
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Abstract base class for classes implementing the visitor design pattern.
The in-memory representation of a 32bit or 64bit on-disk index column.
RAtomicField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
RBitsetField(std::string_view fieldName, std::size_t N)
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
const RField< RNTupleCardinality< std::uint32_t > > * As32Bit() const
const RField< RNTupleCardinality< std::uint64_t > > * As64Bit() const
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
The list of column representations a field can have.
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.
void Attach(std::unique_ptr< RFieldBase > child)
Add a new subfield to the list of nested fields.
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 ...
std::uint32_t fTraits
Properties of the type that allow for optimizations of collections of that type.
@ kTraitEmulatedField
This field is a user defined type that was missing dictionaries and was reconstructed from the on-dis...
@ kTraitTrivialType
Shorthand for types that are both trivially constructible and destructible.
@ 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.
std::uint32_t GetTraits() const
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
Classes with dictionaries that can be inspected by TClass.
The on-storage metadata of an RNTuple.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Template specializations for C++ std::optional and std::unique_ptr.
RNTupleLocalIndex GetItemIndex(ROOT::NTupleSize_t globalIndex)
Given the index of the nullable field, returns the corresponding global index of the subfield or,...
RNullableField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
std::size_t AppendValue(const void *from)
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
const RFieldBase::RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
void operator()(void *objPtr, bool dtorOnly) final
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
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
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
const bool * GetEngagementPtr(const void *optionalPtr) const
Given a pointer to an std::optional<T> in optionalPtr, extract a pointer to the engagement boolean.
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
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.
ROptionalField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void operator()(void *objPtr, bool dtorOnly) final
The field for an untyped record.
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 fMaxAlignment
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
RRecordField(std::string_view name, const RRecordField &source)
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::unique_ptr< RDeleter > GetDeleter() const final
void AttachItemFields(std::vector< std::unique_ptr< RFieldBase > > itemFields)
std::size_t GetItemPadding(std::size_t baseOffset, std::size_t itemAlignment) const
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::vector< std::size_t > fOffsets
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void operator()(void *objPtr, bool dtorOnly) final
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
RUniquePtrField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
std::unique_ptr< RDeleter > GetDeleter() const final
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::unique_ptr< RFieldBase > CreateEmulatedField(std::string_view fieldName, std::vector< std::unique_ptr< RFieldBase > > itemFields, std::string_view emulatedFromType)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
ENTupleStructure
The fields in the ntuple model tree can carry different structural information about the type system.