54 fSubFieldsInfo(source.fSubFieldsInfo),
55 fMaxAlignment(source.fMaxAlignment)
73 throw RException(
R__FAIL(
"RField: no I/O support for type " + std::string(className)));
79 if (className ==
"TObject") {
84 R__FAIL(std::string(className) +
" has an associated collection proxy; use RProxiedCollectionField instead"));
90 throw RException(
R__FAIL(std::string(className) +
" cannot be stored natively in RNTuple"));
94 R__FAIL(std::string(className) +
" has streamer mode enforced, not supported as native RNTuple class"));
104 if (baseClass->GetDelta() < 0) {
105 throw RException(
R__FAIL(std::string(
"virtual inheritance is not supported: ") + std::string(className) +
106 " virtually inherits from " + baseClass->GetName()));
108 TClass *
c = baseClass->GetClassPointer();
111 fTraits &= subField->GetTraits();
120 if (!dataMember->IsPersistent()) {
130 if (dataMember->Property() &
kIsArray) {
131 for (
int dim = 0,
n = dataMember->GetArrayDim(); dim <
n; ++dim)
132 typeName +=
"[" + std::to_string(dataMember->GetMaxIndex(dim)) +
"]";
135 std::unique_ptr<RFieldBase> subField;
138 fTraits &= subField->GetTraits();
146 fMaxAlignment = std::max(fMaxAlignment,
child->GetAlignment());
147 fSubFieldsInfo.push_back(info);
154 for (
const auto rule : rules) {
159 auto func = rule->GetReadFunctionPointer();
161 fReadCallbacks.emplace_back([func, classp](
void *
target) {
165 func(
static_cast<char *
>(
target), &oldObj);
166 oldObj.fClass =
nullptr;
171std::unique_ptr<ROOT::Experimental::RFieldBase>
174 return std::unique_ptr<RClassField>(
new RClassField(newName, *
this));
179 std::size_t nbytes = 0;
180 for (
unsigned i = 0; i < fSubFields.size(); i++) {
181 nbytes += CallAppendOn(*fSubFields[i],
static_cast<const unsigned char *
>(from) + fSubFieldsInfo[i].fOffset);
188 for (
unsigned i = 0; i < fSubFields.size(); i++) {
189 CallReadOn(*fSubFields[i], globalIndex,
static_cast<unsigned char *
>(to) + fSubFieldsInfo[i].fOffset);
195 for (
unsigned i = 0; i < fSubFields.size(); i++) {
196 CallReadOn(*fSubFields[i], clusterIndex,
static_cast<unsigned char *
>(to) + fSubFieldsInfo[i].fOffset);
204 const auto ruleset =
fClass->GetSchemaRules();
208 if (rule->GetTarget() ==
nullptr)
211 const auto dataMember = klass->GetDataMember(
target->GetString());
212 if (!dataMember || dataMember->IsPersistent()) {
214 << dataMember->GetName();
221 auto rules = ruleset->FindRules(
fClass->GetName(),
static_cast<Int_t>(GetOnDiskTypeVersion()),
222 static_cast<UInt_t>(GetOnDiskTypeChecksum()));
223 rules.erase(std::remove_if(rules.begin(), rules.end(), referencesNonTransientMembers), rules.end());
224 AddReadCallbacksFromIORules(rules,
fClass);
234 fClass->Destructor(objPtr,
true );
235 RDeleter::operator()(objPtr, dtorOnly);
238std::vector<ROOT::Experimental::RFieldBase::RValue>
241 std::vector<RValue>
result;
242 auto basePtr =
value.GetPtr<
unsigned char>().get();
243 result.reserve(fSubFields.size());
244 for (
unsigned i = 0; i < fSubFields.size(); i++) {
246 fSubFields[i]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(), basePtr + fSubFieldsInfo[i].fOffset)));
253 return fClass->GetClassSize();
258 return fClass->GetClassVersion();
263 return fClass->GetCheckSum();
274 :
REnumField(fieldName, enumName,
TEnum::GetEnum(std::string(enumName).c_str()))
281 if (enump ==
nullptr) {
282 throw RException(
R__FAIL(
"RField: no I/O support for enum type " + std::string(enumName)));
300 default:
throw RException(
R__FAIL(
"Unsupported underlying integral type for enum type " + std::string(enumName)));
307 std::unique_ptr<RFieldBase> intField)
310 Attach(std::move(intField));
314std::unique_ptr<ROOT::Experimental::RFieldBase>
317 auto newIntField = fSubFields[0]->Clone(fSubFields[0]->GetFieldName());
318 return std::unique_ptr<REnumField>(
new REnumField(newName, GetTypeName(), std::move(newIntField)));
321std::vector<ROOT::Experimental::RFieldBase::RValue>
324 std::vector<RValue>
result;
325 result.emplace_back(fSubFields[0]->BindValue(
value.GetPtr<
void>()));
337ROOT::Experimental::RPairField::RPairField::GetTypeList(
const std::array<std::unique_ptr<RFieldBase>, 2> &itemFields)
339 return itemFields[0]->GetTypeName() +
"," + itemFields[1]->GetTypeName();
343 std::array<std::unique_ptr<RFieldBase>, 2> itemFields,
344 const std::array<std::size_t, 2> &offsets)
345 :
ROOT::Experimental::
RRecordField(fieldName,
"std::pair<" + GetTypeList(itemFields) +
">")
353 std::array<std::unique_ptr<RFieldBase>, 2> itemFields)
354 :
ROOT::Experimental::
RRecordField(fieldName,
"std::pair<" + GetTypeList(itemFields) +
">")
364 auto firstElem =
c->GetRealData(
"first");
367 fOffsets.push_back(firstElem->GetThisOffset());
369 auto secondElem =
c->GetRealData(
"second");
372 fOffsets.push_back(secondElem->GetThisOffset());
386 (ifuncs.
fNext !=
nullptr));
391 std::string_view typeName,
TClass *classp)
394 if (classp ==
nullptr)
395 throw RException(
R__FAIL(
"RField: no I/O support for collection proxy type " + std::string(typeName)));
397 throw RException(
R__FAIL(std::string(typeName) +
" has no associated collection proxy"));
402 if (
fProxy->HasPointers())
403 throw RException(
R__FAIL(
"collection proxies whose value type is a pointer are not supported"));
404 if (!
fProxy->GetCollectionClass()->HasDictionary()) {
414 std::string_view typeName,
415 std::unique_ptr<RFieldBase> itemField)
419 Attach(std::move(itemField));
423 std::string_view typeName)
428 throw RException(
R__FAIL(
"custom associative collection proxies not supported"));
430 std::unique_ptr<ROOT::Experimental::RFieldBase> itemField;
432 if (
auto valueClass =
fProxy->GetValueClass()) {
436 switch (
fProxy->GetType()) {
441 case EDataType::kInt_t: itemField = std::make_unique<RField<std::int32_t>>(
"_0");
break;
442 case EDataType::kUInt_t: itemField = std::make_unique<RField<std::uint32_t>>(
"_0");
break;
455 Attach(std::move(itemField));
458std::unique_ptr<ROOT::Experimental::RFieldBase>
461 auto newItemField = fSubFields[0]->Clone(fSubFields[0]->GetFieldName());
462 return std::unique_ptr<RProxiedCollectionField>(
468 std::size_t nbytes = 0;
472 (fCollectionType ==
kSTLvector ? fItemSize : 0U)}) {
473 nbytes += CallAppendOn(*fSubFields[0], ptr);
478 fPrincipalColumn->Append(&fNWritten);
479 return nbytes + fPrincipalColumn->GetElement()->GetPackedSize();
486 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
494 (fCollectionType ==
kSTLvector || obj != to ? fItemSize : 0U)}) {
495 CallReadOn(*fSubFields[0], collectionStart + (i++), elementPtr);
507 return representations;
512 GenerateColumnsImpl<ClusterSize_t>();
517 GenerateColumnsImpl<ClusterSize_t>(desc);
525std::unique_ptr<ROOT::Experimental::RFieldBase::RDeleter>
529 std::size_t itemSize = fCollectionType ==
kSTLvector ? fItemSize : 0U;
530 return std::make_unique<RProxiedCollectionDeleter>(fProxy, GetDeleterOf(*fSubFields[0]), itemSize);
532 return std::make_unique<RProxiedCollectionDeleter>(fProxy);
540 fItemDeleter->operator()(ptr,
true );
543 fProxy->Destructor(objPtr,
true );
544 RDeleter::operator()(objPtr, dtorOnly);
547std::vector<ROOT::Experimental::RFieldBase::RValue>
550 std::vector<RValue>
result;
551 auto valueRawPtr =
value.GetPtr<
void>().get();
554 (fCollectionType ==
kSTLvector ? fItemSize : 0U)}) {
555 result.emplace_back(fSubFields[0]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(), ptr)));
568 std::unique_ptr<RFieldBase> itemField)
571 if (!
dynamic_cast<RPairField *
>(itemField.get()))
574 auto *itemClass =
fProxy->GetValueClass();
577 Attach(std::move(itemField));
583 std::unique_ptr<RFieldBase> itemField)
598 RCallbackStreamerInfo fCallbackStreamerInfo;
602 :
TBufferFile(
mode, bufsiz), fCallbackStreamerInfo(callbackStreamerInfo)
611 std::string_view typeAlias)
624 throw RException(
R__FAIL(
"RStreamerField: no I/O support for type " + std::string(className)));
634std::unique_ptr<ROOT::Experimental::RFieldBase>
637 return std::unique_ptr<RStreamerField>(
new RStreamerField(newName, GetTypeName(), GetTypeAlias()));
644 fClass->Streamer(
const_cast<void *
>(from), buffer);
646 auto nbytes = buffer.Length();
647 fAuxiliaryColumn->AppendV(buffer.Buffer(), buffer.Length());
649 fPrincipalColumn->Append(&fIndex);
650 return nbytes + fPrincipalColumn->GetElement()->GetPackedSize();
657 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nbytes);
660 fAuxiliaryColumn->ReadV(collectionStart, nbytes, buffer.
Buffer());
661 fClass->Streamer(to, buffer);
672 return representations;
677 GenerateColumnsImpl<ClusterSize_t, std::byte>();
682 GenerateColumnsImpl<ClusterSize_t, std::byte>(desc);
692 fClass->Destructor(objPtr,
true );
693 RDeleter::operator()(objPtr, dtorOnly);
708 return std::min(
alignof(std::max_align_t), GetValueSize());
713 return fClass->GetClassSize();
718 return fClass->GetClassVersion();
723 return fClass->GetCheckSum();
736 return dataMember->GetOffset();
759std::unique_ptr<ROOT::Experimental::RFieldBase>
762 return std::unique_ptr<RField<TObject>>(
new RField<TObject>(newName, *
this));
769 auto *obj =
static_cast<const TObject *
>(from);
774 std::size_t nbytes = 0;
775 nbytes += CallAppendOn(*fSubFields[0],
reinterpret_cast<const unsigned char *
>(from) + GetOffsetUniqueID());
777 UInt_t bits = *
reinterpret_cast<const UInt_t *
>(
reinterpret_cast<const unsigned char *
>(from) + GetOffsetBits());
779 nbytes += CallAppendOn(*fSubFields[1], &bits);
788 auto *obj =
static_cast<TObject *
>(to);
793 CallReadOn(*fSubFields[0], globalIndex,
static_cast<unsigned char *
>(to) + GetOffsetUniqueID());
797 CallReadOn(*fSubFields[1], globalIndex, &bits);
799 *
reinterpret_cast<UInt_t *
>(
reinterpret_cast<unsigned char *
>(to) + GetOffsetBits()) = bits;
804 if (GetTypeVersion() != 1) {
805 throw RException(
R__FAIL(
"unsupported on-disk version of TObject: " + std::to_string(GetTypeVersion())));
824std::vector<ROOT::Experimental::RFieldBase::RValue>
827 std::vector<RValue>
result;
828 auto basePtr =
value.GetPtr<
unsigned char>().get();
830 fSubFields[0]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(), basePtr + GetOffsetUniqueID())));
832 fSubFields[1]->BindValue(std::shared_ptr<void>(
value.GetPtr<
void>(), basePtr + GetOffsetBits())));
854ROOT::Experimental::RTupleField::RTupleField::GetTypeList(
const std::vector<std::unique_ptr<RFieldBase>> &itemFields)
857 if (itemFields.empty())
858 throw RException(
R__FAIL(
"the type list for std::tuple must have at least one element"));
859 for (
size_t i = 0; i < itemFields.size(); ++i) {
860 result += itemFields[i]->GetTypeName() +
",";
867 std::vector<std::unique_ptr<RFieldBase>> itemFields,
868 const std::vector<std::size_t> &offsets)
869 :
ROOT::Experimental::
RRecordField(fieldName,
"std::tuple<" + GetTypeList(itemFields) +
">")
876 std::vector<std::unique_ptr<RFieldBase>> itemFields)
877 :
ROOT::Experimental::
RRecordField(fieldName,
"std::tuple<" + GetTypeList(itemFields) +
">")
891 for (
unsigned i = 0; i <
fSubFields.size(); ++i) {
892 std::string memberName(
"_" + std::to_string(i));
893 auto member =
c->GetRealData(memberName.c_str());
896 fOffsets.push_back(member->GetThisOffset());
905constexpr std::size_t GetVariantTagSize()
908 std::variant<char> t;
909 constexpr auto sizeOfT =
sizeof(t);
911 static_assert(sizeOfT == 2 || sizeOfT == 8,
"unsupported std::variant layout");
912 return sizeOfT == 2 ? 1 : 4;
915template <std::
size_t VariantSizeT>
917 using ValueType_t =
typename std::conditional_t<VariantSizeT == 1, std::uint8_t,
918 typename std::conditional_t<VariantSizeT == 4, std::uint32_t, void>>;
926 for (
size_t i = 0; i < itemFields.size(); ++i) {
927 result += itemFields[i]->GetTypeName() +
",";
936 fMaxItemSize(source.fMaxItemSize),
937 fMaxAlignment(source.fMaxAlignment),
938 fTagOffset(source.fTagOffset),
939 fVariantOffset(source.fVariantOffset),
940 fNWritten(source.fNWritten.
size(), 0)
943 Attach(
f->Clone(
f->GetFieldName()));
948 std::vector<std::unique_ptr<RFieldBase>> itemFields)
949 :
ROOT::Experimental::
RFieldBase(fieldName,
"std::variant<" + GetTypeList(itemFields) +
">",
955 auto nFields = itemFields.size();
960 for (
unsigned int i = 0; i < nFields; ++i) {
963 fTraits &= itemFields[i]->GetTraits();
964 Attach(std::move(itemFields[i]));
971 auto dm =
reinterpret_cast<TDataMember *
>(cl->GetListOfDataMembers()->First());
975 const auto tagSize = GetVariantTagSize();
976 const auto padding = tagSize - (
fMaxItemSize % tagSize);
980std::unique_ptr<ROOT::Experimental::RFieldBase>
983 return std::unique_ptr<RVariantField>(
new RVariantField(newName, *
this));
988 using TagType_t = RVariantTag<GetVariantTagSize()>::ValueType_t;
989 auto tag = *
reinterpret_cast<const TagType_t *
>(
reinterpret_cast<const unsigned char *
>(variantPtr) + tagOffset);
990 return (tag == TagType_t(-1)) ? 0 : tag + 1;
995 using TagType_t = RVariantTag<GetVariantTagSize()>::ValueType_t;
996 auto tagPtr =
reinterpret_cast<TagType_t *
>(
reinterpret_cast<unsigned char *
>(variantPtr) + tagOffset);
997 *tagPtr = (tag == 0) ? TagType_t(-1) :
static_cast<TagType_t
>(tag - 1);
1002 auto tag = GetTag(from, fTagOffset);
1003 std::size_t nbytes = 0;
1006 nbytes += CallAppendOn(*fSubFields[tag - 1],
reinterpret_cast<const unsigned char *
>(from) + fVariantOffset);
1007 index = fNWritten[tag - 1]++;
1010 fPrincipalColumn->Append(&varSwitch);
1018 fPrincipalColumn->GetSwitchInfo(globalIndex, &variantIndex, &tag);
1025 void *varPtr =
reinterpret_cast<unsigned char *
>(to) + fVariantOffset;
1026 CallConstructValueOn(*fSubFields[tag - 1], varPtr);
1027 CallReadOn(*fSubFields[tag - 1], variantIndex, varPtr);
1029 SetTag(to, fTagOffset, tag);
1036 return representations;
1041 GenerateColumnsImpl<RColumnSwitch>();
1046 GenerateColumnsImpl<RColumnSwitch>(desc);
1051 memset(where, 0, GetValueSize());
1052 CallConstructValueOn(*fSubFields[0],
reinterpret_cast<unsigned char *
>(where) + fVariantOffset);
1053 SetTag(where, fTagOffset, 1);
1058 auto tag = GetTag(objPtr, fTagOffset);
1060 fItemDeleters[tag - 1]->operator()(
reinterpret_cast<unsigned char *
>(objPtr) + fVariantOffset,
true );
1062 RDeleter::operator()(objPtr, dtorOnly);
1067 std::vector<std::unique_ptr<RDeleter>> itemDeleters;
1068 itemDeleters.reserve(fSubFields.size());
1069 for (
const auto &
f : fSubFields) {
1070 itemDeleters.emplace_back(GetDeleterOf(*
f));
1072 return std::make_unique<RVariantDeleter>(fTagOffset, fVariantOffset, std::move(itemDeleters));
1077 return std::max(fMaxAlignment,
alignof(RVariantTag<GetVariantTagSize()>::ValueType_t));
1083 const auto actualSize = fTagOffset + GetVariantTagSize();
1085 return actualSize + ((padding ==
alignment) ? 0 : padding);
1090 std::fill(fNWritten.begin(), fNWritten.end(), 0);
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#define R__LOG_WARNING(...)
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.
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 Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
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 index
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 child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char mode
Abstract base class for classes implementing the visitor design pattern.
virtual void VisitProxiedCollectionField(const RProxiedCollectionField &field)
virtual void VisitStreamerField(const RStreamerField &field)
virtual void VisitTObjectField(const RField< TObject > &field)
virtual void VisitEnumField(const REnumField &field)
virtual void VisitClassField(const RClassField &field)
static std::string SerializeStreamerInfos(const StreamerInfoMap_t &infos)
void operator()(void *objPtr, bool dtorOnly) final
The field for a class with dictionary.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void ReadInClusterImpl(RClusterIndex clusterIndex, void *to) final
static constexpr const char * kPrefixInherited
Prefix used in the subfield names generated for base classes.
void Attach(std::unique_ptr< RFieldBase > child, RSubFieldInfo info)
void OnConnectPageSource() final
Called by ConnectPageSource() once connected; derived classes may override this as appropriate.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
std::uint32_t GetTypeChecksum() const final
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void AddReadCallbacksFromIORules(const std::span< const TSchemaRule * > rules, TClass *classp=nullptr)
Register post-read callbacks corresponding to a list of ROOT I/O customization rules.
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::uint32_t GetTypeVersion() const final
Indicates an evolution of the C++ type itself.
RClassField(std::string_view fieldName, const RClassField &source)
Used by CloneImpl.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given a value for this field.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
Holds the index and the tag of a kSwitch column.
The field for an unscoped or scoped enum with dictionary.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
REnumField(std::string_view fieldName, std::string_view enumName, TEnum *enump)
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given a value for this field.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
Base class for all ROOT issued exceptions.
Some fields have multiple possible column representations, e.g.
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.
static constexpr int kTraitTriviallyDestructible
The type is cleaned up just by freeing its memory. I.e. the destructor performs a no-op.
void Attach(std::unique_ptr< RFieldBase > child)
Add a new subfield to the list of nested fields.
std::vector< RFieldBase * > GetSubFields()
static constexpr int kTraitTriviallyConstructible
No constructor needs to be called, i.e.
std::string fTypeAlias
A typedef or using name that was used when creating the field.
const std::string & GetTypeName() const
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &canonicalType, const std::string &typeAlias, bool continueOnError=false)
Factory method to resurrect a field from the stored on-disk type information.
int fTraits
Properties of the type that allow for optimizations of collections of that type.
static constexpr int kTraitTypeChecksum
The TClass checksum is set and valid.
std::vector< std::unique_ptr< RFieldBase > > fSubFields
Collections and classes own sub fields.
Classes with dictionaries that can be inspected by TClass.
RField(std::string_view name)
RMapField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
The on-storage meta-data of an ntuple.
Template specializations for C++ std::pair.
RPairField(std::string_view fieldName, std::array< std::unique_ptr< RFieldBase >, 2 > itemFields, const std::array< std::size_t, 2 > &offsets)
Allows for iterating over the elements of a proxied collection.
static RIteratorFuncs GetIteratorFuncs(TVirtualCollectionProxy *proxy, bool readFromDisk)
void operator()(void *objPtr, bool dtorOnly) final
The field for a class representing a collection of elements via TVirtualCollectionProxy.
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::shared_ptr< TVirtualCollectionProxy > fProxy
The collection proxy is needed by the deleters and thus defined as a shared pointer.
RCollectionIterableOnce::RIteratorFuncs fIFuncsRead
Two sets of functions to operate on iterators, to be used depending on the access type.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
RProxiedCollectionField(std::string_view fieldName, std::string_view typeName, TClass *classp)
Constructor used when the value type of the collection is not known in advance, i....
std::unique_ptr< RDeleter > GetDeleter() const final
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponsing to the field type ...
RCollectionIterableOnce::RIteratorFuncs fIFuncsWrite
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 a value for this field.
The field for an untyped record.
std::vector< std::size_t > fOffsets
void AttachItemFields(std::vector< std::unique_ptr< RFieldBase > > itemFields)
RSetField(std::string_view fieldName, std::string_view typeName, std::unique_ptr< RFieldBase > itemField)
void operator()(void *objPtr, bool dtorOnly) final
The field for a class using ROOT standard streaming.
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::uint32_t GetTypeChecksum() const final
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponsing to the field type ...
RStreamerField(std::string_view fieldName, std::string_view className, TClass *classp)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
std::uint32_t GetTypeVersion() const final
Indicates an evolution of the C++ type itself.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
RExtraTypeInfoDescriptor GetExtraTypeInfo() const final
RTupleField(std::string_view fieldName, std::vector< std::unique_ptr< RFieldBase > > itemFields, const std::vector< std::size_t > &offsets)
void operator()(void *objPtr, bool dtorOnly) final
Template specializations for C++ std::variant.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
static void SetTag(void *variantPtr, std::size_t tagOffset, std::uint8_t tag)
static std::string GetTypeList(const std::vector< std::unique_ptr< RFieldBase > > &itemFields)
std::vector< ClusterSize_t::ValueType > fNWritten
size_t fTagOffset
In the std::variant memory layout, at which byte number is the index stored.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void CommitClusterImpl() final
static constexpr std::size_t kMaxVariants
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
static std::uint8_t GetTag(const void *variantPtr, std::size_t tagOffset)
Extracts the index from an std::variant and transforms it into the 1-based index used for the switch ...
RVariantField(std::string_view name, const RVariantField &source)
size_t fVariantOffset
In the std::variant memory layout, the actual union of types may start at an offset > 0.
std::unique_ptr< RDeleter > GetDeleter() const final
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponsing to the field type ...
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
TClass instances represent classes, structs and namespaces in the ROOT type system.
UInt_t GetCheckSum(ECheckSum code=kCurrentCheckSum) const
Call GetCheckSum with validity check.
Bool_t CanSplit() const
Return true if the data member of this TClass can be saved separately.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
Int_t Size() const
Return size of object of this class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Long_t ClassProperty() const
Return the C++ property of this class, eg.
Long_t Property() const override
Returns the properties of the TClass as a bit field stored as a Long_t value.
Version_t GetClassVersion() const
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
All ROOT classes may have RTTI (run time type identification) support added.
Longptr_t GetOffset() const
Get offset from "this".
The TEnum class implements the enum type.
EDataType GetUnderlyingType() const
Get the underlying integer type of the enum: enum E { kOne }; // ==> int enum F: long; // ==> long Re...
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
Mother of all ROOT objects.
@ kIsOnHeap
object is on heap
@ kNotDeleted
object has not been deleted
@ kIsReferenced
if object is referenced by a TRef or TRefArray
RAII helper class that ensures that PushProxy() / PopProxy() are called when entering / leaving a C++...
Defines a common interface to inspect/change the contents of an object that represents a collection.
@ kNeedDelete
The collection contains directly or indirectly (via other collection) some pointers that need explici...
virtual Next_t GetFunctionNext(Bool_t read=kTRUE)=0
Return a pointer to a function that can advance an iterator (see Next_t).
virtual DeleteTwoIterators_t GetFunctionDeleteTwoIterators(Bool_t read=kTRUE)=0
virtual TVirtualCollectionProxy * Generate() const =0
Returns a clean object of the actual class that derives from TVirtualCollectionProxy.
virtual CreateIterators_t GetFunctionCreateIterators(Bool_t read=kTRUE)=0
Return a pointer to a function that can create an iterator pair, where each iterator points to the be...
Wrapper around an object and giving indirect access to its content even if the object is not of a cla...
Abstract Interface class describing Streamer information for one class.
virtual Int_t GetNumber() const =0
std::string GetNormalizedTypeName(const std::string &typeName)
Applies type name normalization rules that lead to the final name used to create a RField,...
ERNTupleSerializationMode GetRNTupleSerializationMode(TClass *cl)
RLogChannel & NTupleLog()
Log channel for RNTuple diagnostics.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
RClusterSize ClusterSize_t
ENTupleStructure
The fields in the ntuple model tree can carry different structural information about the type system.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Wrap the integer in a struct in order to avoid template specialization clash with std::uint64_t.
TVirtualCollectionProxy::Next_t fNext
TVirtualCollectionProxy::DeleteTwoIterators_t fDeleteTwoIterators
TVirtualCollectionProxy::CreateIterators_t fCreateIterators