44std::vector<std::string> TokenizeTypeList(std::string templateType) {
45 std::vector<std::string> result;
46 if (templateType.empty())
49 const char *eol = templateType.data() + templateType.length();
50 const char *typeBegin = templateType.data();
51 const char *typeCursor = templateType.data();
52 unsigned int nestingLevel = 0;
53 while (typeCursor != eol) {
54 switch (*typeCursor) {
62 if (nestingLevel == 0) {
63 result.push_back(std::string(typeBegin, typeCursor - typeBegin));
64 typeBegin = typeCursor + 1;
70 result.push_back(std::string(typeBegin, typeCursor - typeBegin));
75std::string Trim(
const std::string &raw) {
76 if (raw.empty())
return "";
78 unsigned start_pos = 0;
79 for (; (start_pos < raw.length()) && (raw[start_pos] ==
' ' || raw[start_pos] ==
'\t'); ++start_pos) { }
81 unsigned end_pos = raw.length() - 1;
82 for (; (end_pos >= start_pos) && (raw[end_pos] ==
' ' || raw[end_pos] ==
'\t'); --end_pos) { }
84 return raw.substr(start_pos, end_pos - start_pos + 1);
88 std::string normalizedType(Trim(typeName));
90 if (normalizedType ==
"Bool_t") normalizedType =
"bool";
91 if (normalizedType ==
"Float_t") normalizedType =
"float";
92 if (normalizedType ==
"Double_t") normalizedType =
"double";
93 if (normalizedType ==
"UChar_t") normalizedType =
"std::uint8_t";
94 if (normalizedType ==
"unsigned char") normalizedType =
"std::uint8_t";
95 if (normalizedType ==
"uint8_t") normalizedType =
"std::uint8_t";
96 if (normalizedType ==
"Int_t") normalizedType =
"std::int32_t";
97 if (normalizedType ==
"int") normalizedType =
"std::int32_t";
98 if (normalizedType ==
"int32_t") normalizedType =
"std::int32_t";
99 if (normalizedType ==
"unsigned") normalizedType =
"std::uint32_t";
100 if (normalizedType ==
"unsigned int") normalizedType =
"std::uint32_t";
101 if (normalizedType ==
"UInt_t") normalizedType =
"std::uint32_t";
102 if (normalizedType ==
"uint32_t") normalizedType =
"std::uint32_t";
103 if (normalizedType ==
"ULong64_t") normalizedType =
"std::uint64_t";
104 if (normalizedType ==
"uint64_t") normalizedType =
"std::uint64_t";
105 if (normalizedType ==
"string") normalizedType =
"std::string";
106 if (normalizedType.substr(0, 7) ==
"vector<") normalizedType =
"std::" + normalizedType;
107 if (normalizedType.substr(0, 6) ==
"array<") normalizedType =
"std::" + normalizedType;
108 if (normalizedType.substr(0, 8) ==
"variant<") normalizedType =
"std::" + normalizedType;
110 return normalizedType;
120 column->Connect(fieldId, &pageStorage);
129 : fName(
name), fType(
type), fStructure(structure), fNRepetitions(nRepetitions), fIsSimple(isSimple),
130 fParent(nullptr), fPrincipalColumn(nullptr)
143 if (normalizedType ==
"ROOT::Experimental::ClusterSize_t")
return new RField<ClusterSize_t>(fieldName);
144 if (normalizedType ==
"bool")
return new RField<bool>(fieldName);
149 if (normalizedType ==
"float")
return new RField<float>(fieldName);
150 if (normalizedType ==
"double")
return new RField<double>(fieldName);
153 if (normalizedType.substr(0, 12) ==
"std::vector<") {
154 std::string itemTypeName = normalizedType.substr(12, normalizedType.length() - 13);
156 return new RFieldVector(fieldName, std::unique_ptr<Detail::RFieldBase>(itemField));
160 if (normalizedType.substr(0, 19) ==
"ROOT::VecOps::RVec<") {
161 std::string itemTypeName = normalizedType.substr(19, normalizedType.length() - 20);
163 return new RFieldVector(fieldName, std::unique_ptr<Detail::RFieldBase>(itemField));
165 if (normalizedType.substr(0, 11) ==
"std::array<") {
166 auto arrayDef = TokenizeTypeList(normalizedType.substr(11, normalizedType.length() - 12));
168 auto arrayLength = std::stoi(arrayDef[1]);
170 return new RFieldArray(fieldName, std::unique_ptr<Detail::RFieldBase>(itemField), arrayLength);
172#if __cplusplus >= 201703L
173 if (normalizedType.substr(0, 13) ==
"std::variant<") {
174 auto innerTypes = TokenizeTypeList(normalizedType.substr(13, normalizedType.length() - 14));
175 std::vector<RFieldBase *> items;
176 for (
unsigned int i = 0; i < innerTypes.size(); ++i) {
177 items.emplace_back(Create(
"variant" + std::to_string(i), innerTypes[i]));
179 return new RFieldVariant(fieldName, items);
188 R__ERROR_HERE(
"NTuple") <<
"Field " << fieldName <<
" has unknown type " << normalizedType;
206 void *where =
malloc(GetValueSize());
208 return GenerateValue(where);
217std::vector<ROOT::Experimental::Detail::RFieldValue>
220 return std::vector<RFieldValue>();
224 std::unique_ptr<ROOT::Experimental::Detail::RFieldBase> child)
226 child->fParent =
this;
227 fSubFields.emplace_back(std::move(child));
231std::vector<const ROOT::Experimental::Detail::RFieldBase *>
234 std::vector<const RFieldBase *> result;
235 for (
const auto &
f : fSubFields) {
236 result.emplace_back(
f.get());
244 for (
auto& column : fColumns) {
274 auto itr = fStack.rbegin();
275 if (!itr->fFieldPtr->fSubFields.empty()) {
276 fStack.emplace_back(
Position(itr->fFieldPtr->fSubFields[0].get(), 0));
280 unsigned int nextIdxInParent = ++(itr->fIdxInParent);
281 while (nextIdxInParent >= itr->fFieldPtr->fParent->fSubFields.size()) {
282 if (fStack.size() == 1) {
283 itr->fFieldPtr = itr->fFieldPtr->fParent;
284 itr->fIdxInParent = -1;
288 itr = fStack.rbegin();
289 nextIdxInParent = ++(itr->fIdxInParent);
291 itr->fFieldPtr = itr->fFieldPtr->fParent->fSubFields[nextIdxInParent].get();
301 for (
auto &
f : fSubFields) {
302 auto clone =
f->Clone(
f->GetName());
303 result->
Attach(std::unique_ptr<RFieldBase>(clone));
311 auto entry =
new REntry();
312 for (
auto&
f : fSubFields) {
313 entry->AddValue(
f->GenerateValue());
330 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
331 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(model, 0)));
332 fPrincipalColumn = fColumns[0].get();
337 visitor.VisitClusterSizeField(*
this);
347 fPrincipalColumn = fColumns[0].get();
352 visitor.VisitUInt8Field(*
this);
361 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
362 Detail::RColumn::Create<bool, EColumnType::kBit>(model, 0)));
363 fPrincipalColumn = fColumns[0].get();
377 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
378 Detail::RColumn::Create<float, EColumnType::kReal32>(model, 0)));
379 fPrincipalColumn = fColumns[0].get();
393 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
394 Detail::RColumn::Create<double, EColumnType::kReal64>(model, 0)));
395 fPrincipalColumn = fColumns[0].get();
410 fPrincipalColumn = fColumns[0].get();
415 visitor.VisitIntField(*
this);
423 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
424 Detail::RColumn::Create<std::uint32_t, EColumnType::kInt32>(model, 0)));
425 fPrincipalColumn = fColumns[0].get();
430 visitor.VisitUInt32Field(*
this);
438 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
439 Detail::RColumn::Create<std::uint64_t, EColumnType::kInt64>(model, 0)));
440 fPrincipalColumn = fColumns[0].get();
445 visitor.VisitUInt64Field(*
this);
454 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
455 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
458 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
459 Detail::RColumn::Create<char, EColumnType::kByte>(modelChars, 1)));
460 fPrincipalColumn = fColumns[0].get();
465 auto typedValue = value.
Get<std::string>();
466 auto length = typedValue->length();
467 Detail::RColumnElement<char, EColumnType::kByte> elemChars(
const_cast<char*
>(typedValue->data()));
468 fColumns[1]->AppendV(elemChars, length);
470 fColumns[0]->Append(fElemIndex);
476 auto typedValue = value->
Get<std::string>();
477 RClusterIndex collectionStart;
479 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nChars);
483 typedValue->resize(nChars);
484 Detail::RColumnElement<char, EColumnType::kByte> elemChars(
const_cast<char*
>(typedValue->data()));
485 fColumns[1]->ReadV(collectionStart, nChars, &elemChars);
496 visitor.VisitStringField(*
this);
507 throw std::runtime_error(
"RField: no I/O support for type " + std::string(className));
510 while (
auto dataMember =
static_cast<TDataMember *
>(next())) {
514 Attach(std::unique_ptr<Detail::RFieldBase>(subField));
526 while (
auto dataMember =
static_cast<TDataMember *
>(next())) {
527 auto memberValue = fSubFields[i]->CaptureValue(value.
Get<
unsigned char>() + dataMember->GetOffset());
528 fSubFields[i]->Append(memberValue);
537 while (
auto dataMember =
static_cast<TDataMember *
>(next())) {
538 auto memberValue = fSubFields[i]->GenerateValue(value->
Get<
unsigned char>() + dataMember->GetOffset());
539 fSubFields[i]->Read(globalIndex, &memberValue);
548 while (
auto dataMember =
static_cast<TDataMember *
>(next())) {
549 auto memberValue = fSubFields[i]->GenerateValue(value->
Get<
unsigned char>() + dataMember->GetOffset());
550 fSubFields[i]->Read(clusterIndex, &memberValue);
577std::vector<ROOT::Experimental::Detail::RFieldValue>
582 std::vector<Detail::RFieldValue> result;
583 while (
auto dataMember =
static_cast<TDataMember *
>(next())) {
584 auto memberValue = fSubFields[i]->CaptureValue(value.
Get<
unsigned char>() + dataMember->GetOffset());
585 result.emplace_back(memberValue);
594 return fClass->GetClassSize();
609 , fItemSize(itemField->GetValueSize()), fNWritten(0)
611 Attach(std::move(itemField));
616 auto newItemField = fSubFields[0]->Clone(fSubFields[0]->GetName());
617 return new RFieldVector(newName, std::unique_ptr<Detail::RFieldBase>(newItemField));
621 auto typedValue = value.
Get<std::vector<char>>();
622 R__ASSERT((typedValue->size() % fItemSize) == 0);
623 auto count = typedValue->size() / fItemSize;
624 for (
unsigned i = 0; i < count; ++i) {
625 auto itemValue = fSubFields[0]->CaptureValue(typedValue->data() + (i * fItemSize));
626 fSubFields[0]->Append(itemValue);
630 fColumns[0]->Append(elemIndex);
635 auto typedValue = value->
Get<std::vector<char>>();
639 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
641 typedValue->resize(nItems * fItemSize);
642 for (
unsigned i = 0; i < nItems; ++i) {
643 auto itemValue = fSubFields[0]->GenerateValue(typedValue->data() + (i * fItemSize));
644 fSubFields[0]->Read(collectionStart + i, &itemValue);
651 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
652 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
653 fPrincipalColumn = fColumns[0].get();
663 auto vec =
static_cast<std::vector<char>*
>(value.
GetRawPtr());
664 R__ASSERT((vec->size() % fItemSize) == 0);
665 auto nItems = vec->size() / fItemSize;
666 for (
unsigned i = 0; i < nItems; ++i) {
667 auto itemValue = fSubFields[0]->CaptureValue(vec->data() + (i * fItemSize));
668 fSubFields[0]->DestroyValue(itemValue,
true );
680std::vector<ROOT::Experimental::Detail::RFieldValue>
683 auto vec =
static_cast<std::vector<char>*
>(value.
GetRawPtr());
684 R__ASSERT((vec->size() % fItemSize) == 0);
685 auto nItems = vec->size() / fItemSize;
686 std::vector<Detail::RFieldValue> result;
687 for (
unsigned i = 0; i < nItems; ++i) {
688 result.emplace_back(fSubFields[0]->CaptureValue(vec->data() + (i * fItemSize)));
715 auto typedValue = value.Get<std::vector<bool>>();
716 auto count = typedValue->size();
717 for (
unsigned i = 0; i < count; ++i) {
718 bool bval = (*typedValue)[i];
720 fSubFields[0]->Append(itemValue);
722 Detail::RColumnElement<ClusterSize_t, EColumnType::kIndex> elemIndex(&fNWritten);
724 fColumns[0]->Append(elemIndex);
729 auto typedValue = value->Get<std::vector<bool>>();
732 RClusterIndex collectionStart;
733 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
735 typedValue->resize(nItems);
736 for (
unsigned i = 0; i < nItems; ++i) {
738 auto itemValue = fSubFields[0]->GenerateValue(&bval);
739 fSubFields[0]->Read(collectionStart + i, &itemValue);
740 (*typedValue)[i] = bval;
747 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
748 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
749 fPrincipalColumn = fColumns[0].get();
752std::vector<ROOT::Experimental::Detail::RFieldValue>
755 const static bool trueValue =
true;
756 const static bool falseValue =
false;
758 auto typedValue = value.Get<std::vector<bool>>();
759 auto count = typedValue->size();
760 std::vector<Detail::RFieldValue> result;
761 for (
unsigned i = 0; i < count; ++i) {
762 if ((*typedValue)[i])
763 result.emplace_back(fSubFields[0]->CaptureValue(
const_cast<bool *
>(&trueValue)));
765 result.emplace_back(fSubFields[0]->CaptureValue(
const_cast<bool *
>(&falseValue)));
773 auto vec =
static_cast<std::vector<bool>*
>(value.GetRawPtr());
781 visitor.VisitVectorBoolField(*
this);
789 std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField, std::size_t arrayLength)
791 fieldName,
"std::array<" + itemField->
GetType() +
"," + std::to_string(arrayLength) +
">",
793 , fItemSize(itemField->GetValueSize()), fArrayLength(arrayLength)
795 Attach(std::move(itemField));
800 auto newItemField = fSubFields[0]->Clone(fSubFields[0]->GetName());
801 return new RFieldArray(newName, std::unique_ptr<Detail::RFieldBase>(newItemField), fArrayLength);
805 auto arrayPtr = value.
Get<
unsigned char>();
806 for (
unsigned i = 0; i < fArrayLength; ++i) {
807 auto itemValue = fSubFields[0]->CaptureValue(arrayPtr + (i * fItemSize));
808 fSubFields[0]->Append(itemValue);
814 auto arrayPtr = value->
Get<
unsigned char>();
815 for (
unsigned i = 0; i < fArrayLength; ++i) {
816 auto itemValue = fSubFields[0]->GenerateValue(arrayPtr + (i * fItemSize));
817 fSubFields[0]->Read(globalIndex * fArrayLength + i, &itemValue);
823 auto arrayPtr = value->
Get<
unsigned char>();
824 for (
unsigned i = 0; i < fArrayLength; ++i) {
825 auto itemValue = fSubFields[0]->GenerateValue(arrayPtr + (i * fItemSize));
837 auto arrayPtr =
reinterpret_cast<unsigned char *
>(where);
838 for (
unsigned i = 0; i < fArrayLength; ++i) {
839 fSubFields[0]->GenerateValue(arrayPtr + (i * fItemSize));
846 auto arrayPtr = value.
Get<
unsigned char>();
847 for (
unsigned i = 0; i < fArrayLength; ++i) {
848 auto itemValue = fSubFields[0]->CaptureValue(arrayPtr + (i * fItemSize));
849 fSubFields[0]->DestroyValue(itemValue,
true );
860std::vector<ROOT::Experimental::Detail::RFieldValue>
863 auto arrayPtr = value.
Get<
unsigned char>();
864 std::vector<Detail::RFieldValue> result;
865 for (
unsigned i = 0; i < fArrayLength; ++i) {
866 auto itemValue = fSubFields[0]->CaptureValue(arrayPtr + (i * fItemSize));
867 result.emplace_back(itemValue);
879#if __cplusplus >= 201703L
880std::string ROOT::Experimental::RFieldVariant::GetTypeList(
const std::vector<Detail::RFieldBase *> &itemFields)
883 for (
size_t i = 0; i < itemFields.size(); ++i) {
884 result += itemFields[i]->GetType() +
",";
891ROOT::Experimental::RFieldVariant::RFieldVariant(
892 std::string_view fieldName,
const std::vector<Detail::RFieldBase *> &itemFields)
896 auto nFields = itemFields.size();
898 fNWritten.resize(nFields, 0);
899 for (
unsigned int i = 0; i < nFields; ++i) {
900 fMaxItemSize = std::max(fMaxItemSize, itemFields[i]->
GetValueSize());
901 fMaxAlignment = std::max(fMaxAlignment, itemFields[i]->
GetAlignment());
902 Attach(std::unique_ptr<Detail::RFieldBase>(itemFields[i]));
904 fTagOffset = (fMaxItemSize < fMaxAlignment) ? fMaxAlignment : fMaxItemSize;
909 auto nFields = fSubFields.size();
910 std::vector<Detail::RFieldBase *> itemFields;
911 for (
unsigned i = 0; i < nFields; ++i) {
912 itemFields.emplace_back(fSubFields[i]->Clone(fSubFields[i]->GetName()));
914 return new RFieldVariant(newName, itemFields);
917std::uint32_t ROOT::Experimental::RFieldVariant::GetTag(
void *variantPtr)
const
919 auto index = *(
reinterpret_cast<char *
>(variantPtr) + fTagOffset);
920 return (index < 0) ? 0 : index + 1;
923void ROOT::Experimental::RFieldVariant::SetTag(
void *variantPtr, std::uint32_t tag)
const
925 auto index =
reinterpret_cast<char *
>(variantPtr) + fTagOffset;
926 *index =
static_cast<char>(tag - 1);
929void ROOT::Experimental::RFieldVariant::AppendImpl(
const Detail::RFieldValue& value)
931 auto tag = GetTag(value.GetRawPtr());
934 auto itemValue = fSubFields[tag - 1]->CaptureValue(value.GetRawPtr());
935 fSubFields[tag - 1]->Append(itemValue);
936 index = fNWritten[tag - 1]++;
939 Detail::RColumnElement<RColumnSwitch, EColumnType::kSwitch> elemSwitch(&varSwitch);
940 fColumns[0]->Append(elemSwitch);
943void ROOT::Experimental::RFieldVariant::ReadGlobalImpl(
NTupleSize_t globalIndex, Detail::RFieldValue *value)
945 RClusterIndex variantIndex;
947 fPrincipalColumn->GetSwitchInfo(globalIndex, &variantIndex, &tag);
950 auto itemValue = fSubFields[tag - 1]->GenerateValue(value->GetRawPtr());
951 fSubFields[tag - 1]->Read(variantIndex, &itemValue);
952 SetTag(value->GetRawPtr(), tag);
955void ROOT::Experimental::RFieldVariant::GenerateColumnsImpl()
958 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
959 Detail::RColumn::Create<RColumnSwitch, EColumnType::kSwitch>(modelSwitch, 0)));
960 fPrincipalColumn = fColumns[0].get();
965 memset(where, 0, GetValueSize());
966 fSubFields[0]->GenerateValue(where);
968 return Detail::RFieldValue(
this,
reinterpret_cast<unsigned char *
>(where));
971void ROOT::Experimental::RFieldVariant::DestroyValue(
const Detail::RFieldValue& value,
bool dtorOnly)
973 auto variantPtr = value.GetRawPtr();
974 auto tag = GetTag(variantPtr);
976 auto itemValue = fSubFields[tag - 1]->CaptureValue(variantPtr);
977 fSubFields[tag - 1]->DestroyValue(itemValue,
true );
985 return Detail::RFieldValue(
true ,
this, where);
988size_t ROOT::Experimental::RFieldVariant::GetValueSize()
const
990 return fMaxItemSize + fMaxAlignment;
993void ROOT::Experimental::RFieldVariant::CommitCluster()
995 std::fill(fNWritten.begin(), fNWritten.end(), 0);
1005 std::shared_ptr<RCollectionNTuple> collectionNTuple,
1006 std::unique_ptr<RNTupleModel> collectionModel)
1008 , fCollectionNTuple(collectionNTuple)
1010 for (
unsigned i = 0; i < collectionModel->GetRootField()->
fSubFields.size(); ++i) {
1011 auto& subField = collectionModel->GetRootField()->fSubFields[i];
1012 Attach(std::move(subField));
1020 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
1021 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
1022 fPrincipalColumn = fColumns[0].get();
1041 *fCollectionNTuple->GetOffsetPtr() = 0;
#define R__ERROR_HERE(GROUP)
static RColumn * Create(const RColumnModel &model, std::uint32_t index)
Iterates over the sub tree of fields in depth-first search order.
void Advance()
Given that the iterator points to a valid field which is not the end iterator, go to the next field i...
virtual void GenerateColumnsImpl()=0
Creates the backing columns corresponsing to the field type and name.
std::vector< std::unique_ptr< RFieldBase > > fSubFields
Collections and classes own sub fields.
RFieldBase(std::string_view name, std::string_view type, 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.
virtual void DestroyValue(const RFieldValue &value, bool dtorOnly=false)
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
void Flush() const
Ensure that all received items are written from page buffers to the storage.
virtual void CommitCluster()
Perform housekeeping tasks for global to cluster-local index translation.
virtual std::vector< RFieldValue > SplitValue(const RFieldValue &value) const
Creates the list of direct child values given a value for this field.
virtual void AppendImpl(const RFieldValue &value)
Operations on values of complex types, e.g.
static RFieldBase * Create(const std::string &fieldName, const std::string &typeName)
Factory method to resurrect a field from the stored on-disk type information.
virtual void AcceptVisitor(RFieldVisitor &visitor) const
std::vector< const RFieldBase * > GetSubFields() const
virtual void ReadGlobalImpl(NTupleSize_t globalIndex, RFieldValue *value)
std::vector< std::unique_ptr< RColumn > > fColumns
The columns are connected either to a sink or to a source (not to both); they are owned by the field.
void Attach(std::unique_ptr< Detail::RFieldBase > child)
Add a new subfield to the list of nested fields.
RFieldValue GenerateValue()
Generates an object of the field type and allocates new initialized memory according to the type.
static void Connect(DescriptorId_t fieldId, RPageStorage &pageStorage, RFieldBase &field)
Abstract base class for classes implementing the visitor design pattern.
virtual void VisitBoolField(const RField< bool > &field)
virtual void VisitArrayField(const RFieldArray &field)
virtual void VisitField(const Detail::RFieldBase &field)=0
virtual void VisitClassField(const RFieldClass &field)
virtual void VisitDoubleField(const RField< double > &field)
virtual void VisitRootField(const RFieldRoot &field)
virtual void VisitVectorField(const RFieldVector &field)
virtual void VisitFloatField(const RField< float > &field)
Common functionality of an ntuple storage for both reading and writing.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
DescriptorId_t GetClusterId() const
ClusterSize_t::ValueType GetIndex() const
Holds the static meta-data of a column in a tree.
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
The generic field for fixed size arrays, which do not need an offset column.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type and name.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
RFieldArray(std::string_view fieldName, std::unique_ptr< Detail::RFieldBase > itemField, std::size_t arrayLength)
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
void AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
void ReadInClusterImpl(const RClusterIndex &clusterIndex, Detail::RFieldValue *value) final
RFieldBase * Clone(std::string_view newName) final
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
A field translates read and write calls from/to underlying columns to/from tree values.
The field for a class with dictionary.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const override
std::size_t fMaxAlignment
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
void ReadInClusterImpl(const RClusterIndex &clusterIndex, Detail::RFieldValue *value) final
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
RFieldClass(std::string_view fieldName, std::string_view className)
size_t GetValueSize() const override
The number of bytes taken by a value of the appropriate type.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
RFieldBase * Clone(std::string_view newName) final
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type and name.
void AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type and name.
RFieldCollection(std::string_view name, std::shared_ptr< RCollectionNTuple > collectionNTuple, std::unique_ptr< RNTupleModel > collectionModel)
void CommitCluster() final
Perform housekeeping tasks for global to cluster-local index translation.
RFieldBase * Clone(std::string_view newName) final
The container field for an ntuple model, which itself has no physical representation.
RFieldBase * Clone(std::string_view newName)
REntry * GenerateEntry()
Generates managed values for the top-level sub fields.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
The generic field for a (nested) std::vector<Type> except for std::vector<bool>
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type and name.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
void CommitCluster() final
Perform housekeeping tasks for global to cluster-local index translation.
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
RFieldBase * Clone(std::string_view newName) final
RFieldVector(std::string_view fieldName, std::unique_ptr< Detail::RFieldBase > itemField)
void AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
Detail::RFieldValue CaptureValue(void *where) override
Creates a value from a memory location with an already constructed object.
Template specializations for concrete C++ types.
Classes with dictionaries that can be inspected by TClass.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfDataMembers(Bool_t load=kTRUE)
Return list containing the TDataMembers of a class.
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.
basic_string_view< char > string_view
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.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Type GetType(const std::string &Name)
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...