37 static std::string gEmpty;
76 clone.
fStringPool = std::make_unique<Internal::RStringPool>();
81std::unique_ptr<ROOT::RFieldBase>
85 const auto &typeName = GetTypeAlias().empty() ? GetTypeName() : GetTypeAlias();
86 auto streamerField = std::make_unique<ROOT::RStreamerField>(GetFieldName(), typeName);
89 R__FAIL(
"streamer field " + GetFieldName() +
" has an emulated class but emulation is turned off"));
91 streamerField->SetOnDiskId(fFieldId);
99 auto invalidField = std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(),
"",
101 invalidField->SetOnDiskId(fFieldId);
104 throw RException(
R__FAIL(
"unexpected on-disk field structure value for field \"" + GetFieldName() +
"\""));
109 if (GetTypeName().empty()) {
110 switch (GetStructure()) {
112 std::vector<std::unique_ptr<ROOT::RFieldBase>> memberFields;
113 memberFields.reserve(fLinkIds.size());
114 for (
auto id : fLinkIds) {
116 auto field = memberDesc.
CreateField(ntplDesc, options);
119 memberFields.emplace_back(std::move(field));
121 auto recordField = std::make_unique<ROOT::RRecordField>(GetFieldName(), std::move(memberFields));
122 recordField->SetOnDiskId(fFieldId);
126 if (fLinkIds.size() != 1) {
127 throw RException(
R__FAIL(
"unsupported untyped collection for field \"" + GetFieldName() +
"\""));
133 collectionField->SetOnDiskId(fFieldId);
134 return collectionField;
136 default:
throw RException(
R__FAIL(
"unsupported untyped field structure for field \"" + GetFieldName() +
"\""));
141 const auto &fieldName = GetFieldName();
142 const auto &typeName = GetTypeAlias().empty() ? GetTypeName() : GetTypeAlias();
147 field->SetOnDiskId(fFieldId);
149 for (
auto &subfield : *field) {
150 const auto subfieldId = ntplDesc.
FindFieldId(subfield.GetFieldName(), subfield.GetParent()->GetOnDiskId());
151 subfield.SetOnDiskId(subfieldId);
155 return invalidField.
Clone(fieldName);
162 return std::make_unique<ROOT::RInvalidField>(GetFieldName(), GetTypeName(),
ex.what(),
191 clone.
fValueRange = std::make_unique<RValueRange>(*fValueRange);
200 if (!fCumulativeNElements) {
204 for (
const auto &pi : fPageInfos) {
205 if (firstInPage + pi.GetNElements() > idxInCluster) {
214 const auto N = fCumulativeNElements->size();
218 std::size_t left = 0;
219 std::size_t right =
N - 1;
220 std::size_t midpoint =
N;
221 while (left <= right) {
222 midpoint = (left + right) / 2;
223 if ((*fCumulativeNElements)[midpoint] <= idxInCluster) {
228 if ((midpoint == 0) || ((*fCumulativeNElements)[midpoint - 1] <= idxInCluster))
231 right = midpoint - 1;
235 auto pageInfo = fPageInfos[midpoint];
236 decltype(idxInCluster) firstInPage = (midpoint == 0) ? 0 : (*fCumulativeNElements)[midpoint - 1];
238 R__ASSERT((firstInPage + pageInfo.GetNElements()) > idxInCluster);
245 std::size_t pageSize)
250 const auto nElements =
251 std::accumulate(fPageInfos.begin(), fPageInfos.end(), 0U,
252 [](std::size_t
n,
const auto &pageInfo) { return n + pageInfo.GetNElements(); });
253 const auto nElementsRequired =
static_cast<std::uint64_t
>(columnRange.
GetNElements());
255 if (nElementsRequired == nElements)
257 R__ASSERT((nElementsRequired > nElements) &&
"invalid attempt to shrink RPageRange");
259 std::vector<RPageInfo> pageInfos;
261 const std::uint64_t nElementsPerPage = pageSize / element.
GetSize();
263 for (
auto nRemainingElements = nElementsRequired - nElements; nRemainingElements > 0;) {
265 pageInfo.
SetNElements(std::min(nElementsPerPage, nRemainingElements));
270 pageInfos.emplace_back(pageInfo);
274 pageInfos.insert(pageInfos.end(), std::make_move_iterator(fPageInfos.begin()),
275 std::make_move_iterator(fPageInfos.end()));
276 std::swap(fPageInfos, pageInfos);
277 return nElementsRequired - nElements;
288 std::uint64_t nbytes = 0;
289 for (
const auto &pr : fPageRanges) {
290 for (
const auto &pi : pr.second.GetPageInfos()) {
291 nbytes += pi.GetLocator().GetNBytesOnStorage();
304 for (
const auto &
d : fPageRanges)
338 return fName == other.
fName &&
353 for (
const auto &cd : fClusterDescriptors) {
354 if (!cd.second.ContainsColumn(physicalColumnId))
356 auto columnRange = cd.second.GetColumnRange(physicalColumnId);
357 result = std::max(
result, columnRange.GetFirstElementIndex() + columnRange.GetNElements());
364std::vector<ROOT::Internal::RNTupleClusterBoundaries>
367 std::vector<Internal::RNTupleClusterBoundaries> boundaries;
371 R__ASSERT(clusterDesc.GetNEntries() > 0);
373 clusterDesc.GetFirstEntryIndex(), clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries()});
381 std::string leafName(fieldName);
382 auto posDot = leafName.find_last_of(
'.');
383 if (posDot != std::string::npos) {
384 auto parentName = leafName.substr(0, posDot);
385 leafName = leafName.substr(posDot + 1);
386 parentId = FindFieldId(parentName, parentId);
388 auto itrFieldDesc = fFieldDescriptors.find(parentId);
389 if (itrFieldDesc == fFieldDescriptors.end())
391 for (
const auto linkId : itrFieldDesc->second.GetLinkIds()) {
392 if (fFieldDescriptors.at(linkId).GetFieldName() == leafName)
403 const auto &fieldDescriptor = fFieldDescriptors.at(fieldId);
404 auto prefix = GetQualifiedFieldName(fieldDescriptor.GetParentId());
406 return fieldDescriptor.GetFieldName();
407 return prefix +
"." + fieldDescriptor.GetFieldName();
413 return fVersionMajor == 0 && fVersionMinor == 0 && fVersionPatch < 1;
420 if (FieldTypeNamesMayNeedFixup()) {
429 return FindFieldId(fieldName, GetFieldZeroId());
433 std::uint32_t columnIndex,
434 std::uint16_t representationIndex)
const
436 auto itr = fFieldDescriptors.find(fieldId);
437 if (itr == fFieldDescriptors.cend())
439 if (columnIndex >= itr->second.GetColumnCardinality())
441 const auto idx = representationIndex * itr->second.GetColumnCardinality() + columnIndex;
442 if (itr->second.GetLogicalColumnIds().size() <= idx)
444 return itr->second.GetLogicalColumnIds()[idx];
448 std::uint32_t columnIndex,
449 std::uint16_t representationIndex)
const
451 auto logicalId = FindLogicalColumnId(fieldId, columnIndex, representationIndex);
454 return GetColumnDescriptor(logicalId).GetPhysicalId();
460 if (GetNClusterGroups() == 0)
465 std::size_t cgLeft = 0;
466 std::size_t cgRight = GetNClusterGroups() - 1;
467 while (cgLeft <= cgRight) {
468 const std::size_t cgMidpoint = (cgLeft + cgRight) / 2;
469 const auto &clusterIds = GetClusterGroupDescriptor(fSortedClusterGroupIds[cgMidpoint]).GetClusterIds();
472 const auto &clusterDesc = GetClusterDescriptor(clusterIds.front());
474 if (!clusterDesc.ContainsColumn(physicalColumnId))
477 const auto firstElementInGroup = clusterDesc.GetColumnRange(physicalColumnId).GetFirstElementIndex();
478 if (firstElementInGroup >
index) {
481 cgRight = cgMidpoint - 1;
485 const auto &lastColumnRange = GetClusterDescriptor(clusterIds.back()).GetColumnRange(physicalColumnId);
486 if ((lastColumnRange.GetFirstElementIndex() + lastColumnRange.GetNElements()) <=
index) {
488 cgLeft = cgMidpoint + 1;
494 std::size_t clusterLeft = 0;
495 std::size_t clusterRight = clusterIds.size() - 1;
496 while (clusterLeft <= clusterRight) {
497 const std::size_t clusterMidpoint = (clusterLeft + clusterRight) / 2;
498 const auto clusterId = clusterIds[clusterMidpoint];
499 const auto &columnRange = GetClusterDescriptor(clusterId).GetColumnRange(physicalColumnId);
501 if (columnRange.Contains(
index))
504 if (columnRange.GetFirstElementIndex() >
index) {
506 clusterRight = clusterMidpoint - 1;
510 if (columnRange.GetFirstElementIndex() + columnRange.GetNElements() <=
index) {
511 clusterLeft = clusterMidpoint + 1;
522 if (GetNClusterGroups() == 0)
527 std::size_t cgLeft = 0;
528 std::size_t cgRight = GetNClusterGroups() - 1;
529 while (cgLeft <= cgRight) {
530 const std::size_t cgMidpoint = (cgLeft + cgRight) / 2;
531 const auto &cgDesc = GetClusterGroupDescriptor(fSortedClusterGroupIds[cgMidpoint]);
533 if (cgDesc.GetMinEntry() > entryIdx) {
535 cgRight = cgMidpoint - 1;
539 if (cgDesc.GetMinEntry() + cgDesc.GetEntrySpan() <= entryIdx) {
540 cgLeft = cgMidpoint + 1;
546 const auto &clusterIds = cgDesc.GetClusterIds();
548 std::size_t clusterLeft = 0;
549 std::size_t clusterRight = clusterIds.size() - 1;
550 while (clusterLeft <= clusterRight) {
551 const std::size_t clusterMidpoint = (clusterLeft + clusterRight) / 2;
552 const auto &clusterDesc = GetClusterDescriptor(clusterIds[clusterMidpoint]);
554 if (clusterDesc.GetFirstEntryIndex() > entryIdx) {
556 clusterRight = clusterMidpoint - 1;
560 if (clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries() <= entryIdx) {
561 clusterLeft = clusterMidpoint + 1;
565 return clusterIds[clusterMidpoint];
578 const auto &clusterDesc = GetClusterDescriptor(clusterId);
579 const auto firstEntryInNextCluster = clusterDesc.GetFirstEntryIndex() + clusterDesc.GetNEntries();
580 return FindClusterId(firstEntryInNextCluster);
589 const auto &clusterDesc = GetClusterDescriptor(clusterId);
590 if (clusterDesc.GetFirstEntryIndex() == 0)
592 return FindClusterId(clusterDesc.GetFirstEntryIndex() - 1);
595std::vector<ROOT::DescriptorId_t>
598 std::vector<ROOT::DescriptorId_t> fields;
599 for (
const auto fieldId : fFieldIdsOrder) {
601 fields.emplace_back(fieldId);
608 : fNTuple(ntuple), fColumns(field.GetLogicalColumnIds())
615 std::deque<ROOT::DescriptorId_t> fieldIdQueue{ntuple.
GetFieldZeroId()};
617 while (!fieldIdQueue.empty()) {
618 auto currFieldId = fieldIdQueue.front();
619 fieldIdQueue.pop_front();
625 auto fieldId = field.GetId();
626 fieldIdQueue.push_back(fieldId);
633 std::vector<std::uint64_t>
result;
634 unsigned int base = 0;
635 std::uint64_t flags = 0;
637 if ((
f > 0) && ((
f % 64) == 0))
639 while (
f > base + 64) {
640 result.emplace_back(flags);
648 flags |= std::uint64_t(1) <<
f;
650 result.emplace_back(flags);
655 std::vector<RClusterDescriptor> &clusterDescs)
659 return R__FAIL(
"invalid attempt to add details of unknown cluster group");
660 if (iter->second.HasClusterDetails())
661 return R__FAIL(
"invalid attempt to re-populate cluster group details");
662 if (iter->second.GetNClusters() != clusterDescs.size())
663 return R__FAIL(
"mismatch of number of clusters");
665 std::vector<ROOT::DescriptorId_t> clusterIds;
666 for (
unsigned i = 0; i < clusterDescs.size(); ++i) {
667 clusterIds.emplace_back(clusterDescs[i].GetId());
670 return R__FAIL(
"invalid attempt to re-populate existing cluster");
674 return fClusterDescriptors[a].GetFirstEntryIndex() < fClusterDescriptors[b].GetFirstEntryIndex();
677 cgBuilder.AddSortedClusters(clusterIds);
678 iter->second = cgBuilder.MoveDescriptor().Unwrap();
686 return R__FAIL(
"invalid attempt to drop cluster details of unknown cluster group");
687 if (!iter->second.HasClusterDetails())
688 return R__FAIL(
"invalid attempt to drop details of cluster group summary");
690 for (
auto clusterId : iter->second.GetClusterIds())
692 iter->second = iter->second.CloneSummary();
700 std::unordered_set<ROOT::DescriptorId_t> invalidFields;
703 auto fieldId = colDesc.GetFieldId();
708 fieldId = field.GetParentId();
710 invalidFields.insert(fieldId);
720 "cannot create Model: descriptor contains unknown column types. Use 'SetForwardCompatible(true)' on the "
721 "RCreateModelOptions to create a partial model containing only the fields made up by known columns."));
723 auto fieldZero = std::make_unique<ROOT::RFieldZero>();
731 if (invalidFields.count(topDesc.GetId()) > 0) {
736 auto field = topDesc.CreateField(*
this, createFieldOpts);
743 const auto &invalid =
static_cast<const RInvalidField &
>(*field);
754 model->AddProjectedField(std::move(field), [
this](
const std::string &targetName) -> std::string {
758 model->AddField(std::move(field));
778 shareStringPool =
false;
867 std::uint64_t firstElementIndex,
868 std::uint32_t compressionSettings,
872 return R__FAIL(
"column ID mismatch");
873 if (fCluster.fColumnRanges.count(physicalId) > 0)
874 return R__FAIL(
"column ID conflict");
879 fCluster.fPageRanges[physicalId] = pageRange.
Clone();
880 fCluster.fColumnRanges[physicalId] = columnRange;
887 if (fCluster.fColumnRanges.count(physicalId) > 0)
888 return R__FAIL(
"column ID conflict");
893 fCluster.fColumnRanges[physicalId] = columnRange;
900 for (
auto &[
_, columnRange] : fCluster.fColumnRanges) {
901 if (!columnRange.IsSuppressed())
908 for (
const auto otherColumnLogicalId : fieldDesc.GetLogicalColumnIds()) {
910 if (otherColumnDesc.GetRepresentationIndex() == columnDesc.GetRepresentationIndex())
912 if (otherColumnDesc.GetIndex() != columnDesc.GetIndex())
916 const auto &otherColumnRange = fCluster.GetColumnRange(otherColumnDesc.GetPhysicalId());
917 if (otherColumnRange.IsSuppressed())
920 columnRange.SetFirstElementIndex(otherColumnRange.GetFirstElementIndex());
921 columnRange.SetNElements(otherColumnRange.GetNElements());
926 return R__FAIL(std::string(
"cannot find non-suppressed column for column ID ") +
927 std::to_string(columnRange.GetPhysicalColumnId()) +
928 ", cluster ID: " + std::to_string(fCluster.GetId()));
940 auto fnTraverseSubtree = [&](
ROOT::DescriptorId_t rootFieldId, std::uint64_t nRepetitionsAtThisLevel,
941 const auto &visitField,
const auto &enterSubtree) ->
void {
942 visitField(rootFieldId, nRepetitionsAtThisLevel);
944 const std::uint64_t nRepetitions = std::max(
f.GetNRepetitions(), std::uint64_t{1U}) * nRepetitionsAtThisLevel;
945 enterSubtree(
f.GetId(), nRepetitions, visitField, enterSubtree);
957 topLevelField.GetId(), std::max(topLevelField.GetNRepetitions(), std::uint64_t{1U}),
959 for (const auto &c : desc.GetColumnIterable(fieldId)) {
960 const ROOT::DescriptorId_t physicalId = c.GetPhysicalId();
961 auto &columnRange = fCluster.fColumnRanges[physicalId];
966 if (columnRange.GetPhysicalColumnId() == ROOT::kInvalidDescriptorId) {
967 columnRange.SetPhysicalColumnId(physicalId);
968 columnRange.SetFirstElementIndex(0);
969 columnRange.SetNElements(0);
970 columnRange.SetIsSuppressed(c.IsSuppressedDeferredColumn());
975 if (c.IsDeferredColumn()) {
976 if (c.GetRepresentationIndex() == 0) {
981 columnRange.SetFirstElementIndex(fCluster.GetFirstEntryIndex() * nRepetitions);
982 columnRange.SetNElements(fCluster.GetNEntries() * nRepetitions);
989 const auto &field = desc.GetFieldDescriptor(fieldId);
990 const auto firstReprColumnId = field.GetLogicalColumnIds()[c.GetIndex()];
991 const auto &firstReprColumnRange = fCluster.fColumnRanges[firstReprColumnId];
992 columnRange.SetFirstElementIndex(firstReprColumnRange.GetFirstElementIndex());
993 columnRange.SetNElements(firstReprColumnRange.GetNElements());
995 if (!columnRange.IsSuppressed()) {
996 auto &pageRange = fCluster.fPageRanges[physicalId];
997 pageRange.fPhysicalColumnId = physicalId;
998 const auto element = ROOT::Internal::RColumnElementBase::Generate(c);
999 pageRange.ExtendToFitColumnRange(columnRange, *element, ROOT::Internal::RPage::kPageZeroSize);
1001 } else if (!columnRange.IsSuppressed()) {
1002 fCluster.fPageRanges[physicalId].fPhysicalColumnId = physicalId;
1014 return R__FAIL(
"unset cluster ID");
1015 if (fCluster.fNEntries == 0)
1016 return R__FAIL(
"empty cluster");
1017 for (
auto &pr : fCluster.fPageRanges) {
1018 if (fCluster.fColumnRanges.count(pr.first) == 0) {
1019 return R__FAIL(
"missing column range");
1021 pr.second.fCumulativeNElements.reset();
1022 const auto nPages = pr.second.fPageInfos.size();
1024 pr.second.fCumulativeNElements = std::make_unique<std::vector<NTupleSize_t>>();
1025 pr.second.fCumulativeNElements->reserve(nPages);
1027 for (
const auto &pi : pr.second.fPageInfos) {
1028 sum += pi.GetNElements();
1029 pr.second.fCumulativeNElements->emplace_back(
sum);
1034 std::swap(
result, fCluster);
1056 return R__FAIL(
"unset cluster group ID");
1058 std::swap(
result, fClusterGroup);
1069 std::swap(
result, fExtraTypeInfo);
1077 if (fDescriptor.fFieldDescriptors.count(fieldId) == 0)
1078 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' doesn't exist");
1085 return R__FAIL(
"unset or unsupported RNTuple epoch version");
1094 for (
const auto &[fieldId, fieldDesc] : fDescriptor.fFieldDescriptors) {
1097 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' has an invalid parent id");
1101 const auto columnCardinality = fieldDesc.GetColumnCardinality();
1102 if (columnCardinality == 0)
1107 const auto &logicalColumnIds = fieldDesc.GetLogicalColumnIds();
1108 const auto nColumns = logicalColumnIds.size();
1110 if ((nColumns + 1) == columnCardinality)
1113 const auto &lastColumn = fDescriptor.GetColumnDescriptor(logicalColumnIds.back());
1114 if (lastColumn.GetIndex() + 1 != columnCardinality)
1115 return R__FAIL(
"field with id '" + std::to_string(fieldId) +
"' has incomplete column representations");
1123 EnsureValidDescriptor().ThrowOnError();
1125 for (
const auto &[
id,
_] : fDescriptor.fClusterGroupDescriptors)
1126 fDescriptor.fSortedClusterGroupIds.emplace_back(
id);
1127 std::sort(fDescriptor.fSortedClusterGroupIds.begin(), fDescriptor.fSortedClusterGroupIds.end(),
1129 return fDescriptor.fClusterGroupDescriptors[a].GetMinEntry() <
1130 fDescriptor.fClusterGroupDescriptors[b].GetMinEntry();
1132 fDescriptor.fStringPool->Freeze();
1134 std::swap(
result, fDescriptor);
1139 std::uint16_t versionMinor, std::uint16_t versionPatch)
1142 throw RException(
R__FAIL(
"unsupported RNTuple epoch version: " + std::to_string(versionEpoch)));
1144 fDescriptor.fVersionEpoch = versionEpoch;
1145 fDescriptor.fVersionMajor = versionMajor;
1146 fDescriptor.fVersionMinor = versionMinor;
1147 fDescriptor.fVersionPatch = versionPatch;
1160 fDescriptor.fName = std::string(
name);
1161 fDescriptor.fDescription = std::string(description);
1166 if (flag > 0 && flag % 64 == 0)
1168 fDescriptor.fFeatureFlags.insert(flag);
1174 if (fDesc.fName.empty())
1175 return R__FAIL(
"attribute set name cannot be empty");
1176 if (fDesc.fAnchorLength == 0)
1177 return R__FAIL(
"invalid anchor length");
1179 return R__FAIL(
"invalid locator type");
1181 return std::move(fDesc);
1187 return R__FAIL(
"invalid logical column id");
1189 return R__FAIL(
"invalid physical column id");
1191 return R__FAIL(
"invalid field id, dangling column");
1200 if (fColumn.GetBitsOnStorage() < minBits || fColumn.GetBitsOnStorage() > maxBits)
1201 return R__FAIL(
"invalid column bit width");
1205 std::swap(
result, fColumn);
1213 clone.
InitFrom(source, stringPool);
1220 return R__FAIL(
"invalid field id");
1223 return R__FAIL(
"invalid field structure");
1226 return R__FAIL(
"invalid SoA flag on non-collection field");
1234 if (fField.GetFieldName().empty()) {
1235 return R__FAIL(
"name cannot be empty string \"\"");
1240 std::swap(
result, fField);
1267 const auto id = fieldDesc.
GetId();
1268 if (fDescriptor.fHeaderExtension)
1269 fDescriptor.fHeaderExtension->MarkExtendedField(fieldDesc);
1271 fDescriptor.fFieldZeroId =
id;
1274 fDescriptor.fFieldDescriptors.emplace(
id, std::move(fieldDesc));
1281 if (!(fieldExists = EnsureFieldExists(fieldId)))
1283 if (!(fieldExists = EnsureFieldExists(linkId)))
1284 return R__FAIL(
"child field with id '" + std::to_string(linkId) +
"' doesn't exist in NTuple");
1286 if (linkId == fDescriptor.GetFieldZeroId()) {
1287 return R__FAIL(
"cannot make FieldZero a child field");
1290 auto parentId = fDescriptor.fFieldDescriptors.at(linkId).GetParentId();
1292 return R__FAIL(
"field '" + std::to_string(linkId) +
"' already has a parent ('" + std::to_string(parentId) +
")");
1294 if (fieldId == linkId) {
1295 return R__FAIL(
"cannot make field '" + std::to_string(fieldId) +
"' a child of itself");
1297 fDescriptor.fFieldDescriptors.at(linkId).fParentId = fieldId;
1298 fDescriptor.fFieldDescriptors.at(fieldId).fLinkIds.push_back(linkId);
1306 if (!(fieldExists = EnsureFieldExists(sourceId)))
1308 if (!(fieldExists = EnsureFieldExists(targetId)))
1309 return R__FAIL(
"projected field with id '" + std::to_string(targetId) +
"' doesn't exist in NTuple");
1311 if (targetId == fDescriptor.GetFieldZeroId()) {
1312 return R__FAIL(
"cannot make FieldZero a projected field");
1314 if (sourceId == targetId) {
1315 return R__FAIL(
"cannot make field '" + std::to_string(targetId) +
"' a projection of itself");
1317 if (fDescriptor.fFieldDescriptors.at(sourceId).IsProjectedField()) {
1318 return R__FAIL(
"cannot make field '" + std::to_string(targetId) +
"' a projection of an already projected field");
1321 auto &targetDesc = fDescriptor.fFieldDescriptors.at(targetId);
1322 if (targetDesc.IsProjectedField() && targetDesc.GetProjectionSourceId() != sourceId) {
1323 return R__FAIL(
"field '" + std::to_string(targetId) +
"' has already a projection source ('" +
1324 std::to_string(targetDesc.GetProjectionSourceId()) +
")");
1326 fDescriptor.fFieldDescriptors.at(targetId).fProjectionSourceId = sourceId;
1332 const auto fieldId = columnDesc.GetFieldId();
1333 const auto columnIndex = columnDesc.GetIndex();
1334 const auto representationIndex = columnDesc.GetRepresentationIndex();
1336 auto fieldExists = EnsureFieldExists(fieldId);
1340 auto &fieldDesc = fDescriptor.fFieldDescriptors.find(fieldId)->second;
1342 if (columnDesc.IsAliasColumn()) {
1343 if (columnDesc.GetType() != fDescriptor.GetColumnDescriptor(columnDesc.GetPhysicalId()).GetType())
1344 return R__FAIL(
"alias column type mismatch");
1347 return R__FAIL(
"column index clash");
1349 if (columnIndex > 0) {
1351 return R__FAIL(
"out of bounds column index");
1353 if (representationIndex > 0) {
1355 return R__FAIL(
"out of bounds representation index");
1357 if (columnIndex == 0) {
1358 assert(fieldDesc.fColumnCardinality > 0);
1359 if (fDescriptor.FindLogicalColumnId(fieldId, fieldDesc.fColumnCardinality - 1, representationIndex - 1) ==
1361 return R__FAIL(
"incomplete column representations");
1364 if (columnIndex >= fieldDesc.fColumnCardinality)
1365 return R__FAIL(
"irregular column representations");
1369 fieldDesc.fColumnCardinality = columnIndex + 1;
1372 const auto logicalId = columnDesc.GetLogicalId();
1373 fieldDesc.fLogicalColumnIds.emplace_back(logicalId);
1375 if (!columnDesc.IsAliasColumn())
1376 fDescriptor.fNPhysicalColumns++;
1377 if (fDescriptor.fHeaderExtension)
1378 fDescriptor.fHeaderExtension->MarkExtendedColumn(columnDesc);
1379 fDescriptor.fColumnDescriptors.emplace(logicalId, std::move(columnDesc));
1386 const auto id = clusterGroup.GetId();
1387 if (fDescriptor.fClusterGroupDescriptors.count(
id) > 0)
1388 return R__FAIL(
"cluster group id clash");
1389 fDescriptor.fNEntries = std::max(fDescriptor.fNEntries, clusterGroup.GetMinEntry() + clusterGroup.GetEntrySpan());
1390 fDescriptor.fNClusters += clusterGroup.GetNClusters();
1391 fDescriptor.fClusterGroupDescriptors.emplace(
id, std::move(clusterGroup));
1403 if (!fDescriptor.fHeaderExtension)
1404 fDescriptor.fHeaderExtension = std::make_unique<RNTupleDescriptor::RHeaderExtension>();
1409 if (fDescriptor.GetNLogicalColumns() == 0)
1411 R__ASSERT(fDescriptor.GetNPhysicalColumns() > 0);
1413 for (
ROOT::DescriptorId_t id = fDescriptor.GetNLogicalColumns() - 1;
id >= fDescriptor.GetNPhysicalColumns(); --
id) {
1414 auto c = fDescriptor.fColumnDescriptors[
id].Clone();
1417 fDescriptor.fColumnDescriptors.erase(
id);
1418 for (
auto &link : fDescriptor.fFieldDescriptors[
c.fFieldId].fLogicalColumnIds) {
1419 if (link ==
c.fLogicalColumnId) {
1425 R__ASSERT(fDescriptor.fColumnDescriptors.count(
c.fLogicalColumnId) == 0);
1426 fDescriptor.fColumnDescriptors.emplace(
c.fLogicalColumnId, std::move(
c));
1430 if (
auto &xHeader = fDescriptor.fHeaderExtension) {
1431 for (
auto &columnId : xHeader->fExtendedColumnRepresentations) {
1432 if (columnId >= fDescriptor.GetNPhysicalColumns())
1440 auto clusterId = clusterDesc.GetId();
1441 if (fDescriptor.fClusterDescriptors.count(clusterId) > 0)
1442 return R__FAIL(
"cluster id clash");
1443 fDescriptor.fClusterDescriptors.emplace(clusterId, std::move(clusterDesc));
1451 if (std::find(fDescriptor.fExtraTypeInfoDescriptors.begin(), fDescriptor.fExtraTypeInfoDescriptors.end(),
1452 extraTypeInfoDesc) != fDescriptor.fExtraTypeInfoDescriptors.end()) {
1453 return R__FAIL(
"extra type info duplicates");
1455 fDescriptor.fExtraTypeInfoDescriptors.emplace_back(std::move(extraTypeInfoDesc));
1461 auto it = std::find(fDescriptor.fExtraTypeInfoDescriptors.begin(), fDescriptor.fExtraTypeInfoDescriptors.end(),
1463 if (it != fDescriptor.fExtraTypeInfoDescriptors.end())
1464 *it = std::move(extraTypeInfoDesc);
1466 fDescriptor.fExtraTypeInfoDescriptors.emplace_back(std::move(extraTypeInfoDesc));
1472 auto &attrSets = fDescriptor.fAttributeSets;
1473 if (std::find_if(attrSets.begin(), attrSets.end(), [&
name = attrSetDesc.GetName()](
const auto &desc) {
1474 return desc.GetName() == name;
1475 }) != attrSets.end()) {
1476 return R__FAIL(
"attribute sets with duplicate names");
1478 attrSets.push_back(std::move(attrSetDesc));
1588 if (fieldDesc.
GetTypeName().rfind(
"std::", 0) == 0)
1595 static const std::string gIntTypeNames[] = {
"bool",
"char",
"std::int8_t",
"std::uint8_t",
1596 "std::int16_t",
"std::uint16_t",
"std::int32_t",
"std::uint32_t",
1597 "std::int64_t",
"std::uint64_t"};
1598 return std::find(std::begin(gIntTypeNames), std::end(gIntTypeNames),
1606 return (fieldDesc.
GetTypeName().rfind(
"std::atomic<", 0) == 0);
#define R__FORWARD_ERROR(res)
Short-hand to return an RResult<T> in an error state (i.e. after checking)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
#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 offset
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 id
A helper class for piece-wise construction of an RClusterDescriptor.
RResult< void > MarkSuppressedColumnRange(ROOT::DescriptorId_t physicalId)
Books the given column ID as being suppressed in this cluster.
RResult< void > CommitColumnRange(ROOT::DescriptorId_t physicalId, std::uint64_t firstElementIndex, std::uint32_t compressionSettings, const RClusterDescriptor::RPageRange &pageRange)
RClusterDescriptorBuilder & AddExtendedColumnRanges(const RNTupleDescriptor &desc)
Add column and page ranges for columns created during late model extension missing in this cluster.
RResult< void > CommitSuppressedColumnRanges(const RNTupleDescriptor &desc)
Sets the first element index and number of elements for all the suppressed column ranges.
RResult< RClusterDescriptor > MoveDescriptor()
Move out the full cluster descriptor including page locations.
A helper class for piece-wise construction of an RClusterGroupDescriptor.
RClusterGroupDescriptorBuilder & EntrySpan(std::uint64_t entrySpan)
RClusterGroupDescriptorBuilder & PageListLocator(const RNTupleLocator &pageListLocator)
static RClusterGroupDescriptorBuilder FromSummary(const RClusterGroupDescriptor &clusterGroupDesc)
RClusterGroupDescriptorBuilder & PageListLength(std::uint64_t pageListLength)
RClusterGroupDescriptorBuilder & MinEntry(std::uint64_t minEntry)
RResult< RClusterGroupDescriptor > MoveDescriptor()
RClusterGroupDescriptorBuilder & ClusterGroupId(ROOT::DescriptorId_t clusterGroupId)
RClusterGroupDescriptorBuilder & NClusters(std::uint32_t nClusters)
RResult< RColumnDescriptor > MoveDescriptor()
Attempt to make a column descriptor.
A column element encapsulates the translation between basic C++ types and their column representation...
static std::pair< std::uint16_t, std::uint16_t > GetValidBitRange(ROOT::ENTupleColumnType type)
Most types have a fixed on-disk bit width.
std::size_t GetSize() const
std::size_t GetPackedSize(std::size_t nElements=1U) const
A helper class for piece-wise construction of an RFieldDescriptor.
RResult< RFieldDescriptor > MoveDescriptor()
Attempt to make a field descriptor.
RFieldDescriptorBuilder & NRepetitions(std::uint64_t nRepetitions)
RFieldDescriptorBuilder & Structure(const ROOT::ENTupleStructure &structure)
RFieldDescriptorBuilder & TypeAlias(const std::string &typeAlias)
static RFieldDescriptor CloneDescriptor(const RFieldDescriptor &source, RStringPool &stringPool)
RFieldDescriptorBuilder & TypeVersion(std::uint32_t typeVersion)
RFieldDescriptorBuilder & IsSoACollection(bool val)
RFieldDescriptorBuilder & TypeChecksum(const std::optional< std::uint32_t > typeChecksum)
RFieldDescriptorBuilder & FieldDescription(const std::string &fieldDescription)
RFieldDescriptorBuilder & FieldVersion(std::uint32_t fieldVersion)
RFieldDescriptorBuilder & FieldName(const std::string &fieldName)
RFieldDescriptorBuilder & FieldId(ROOT::DescriptorId_t fieldId)
RFieldDescriptorBuilder & TypeName(const std::string &typeName)
RResult< ROOT::RNTupleAttrSetDescriptor > MoveDescriptor()
Attempt to make an AttributeSet descriptor.
void SetNTuple(std::string_view name, std::string_view description)
void SetSchemaFromExisting(const RNTupleDescriptor &descriptor)
Copies the "schema" part of descriptor into the builder's descriptor.
void SetVersionForWriting()
RResult< void > AddColumn(RColumnDescriptor &&columnDesc)
void AddField(RFieldDescriptor fieldDesc)
RResult< void > AddFieldProjection(ROOT::DescriptorId_t sourceId, ROOT::DescriptorId_t targetId)
void ReplaceExtraTypeInfo(RExtraTypeInfoDescriptor &&extraTypeInfoDesc)
RResult< void > AddExtraTypeInfo(RExtraTypeInfoDescriptor &&extraTypeInfoDesc)
void ShiftAliasColumns(std::uint32_t offset)
Shift column IDs of alias columns by offset
RResult< void > AddAttributeSet(RNTupleAttrSetDescriptor &&attrSetDesc)
void SetVersion(std::uint16_t versionEpoch, std::uint16_t versionMajor, std::uint16_t versionMinor, std::uint16_t versionPatch)
RNTupleDescriptor MoveDescriptor()
void BeginHeaderExtension()
Mark the beginning of the header extension; any fields and columns added after a call to this functio...
RResult< void > AddCluster(RClusterDescriptor &&clusterDesc)
RResult< void > EnsureValidDescriptor() const
Checks whether invariants hold:
RResult< void > AddFieldLink(ROOT::DescriptorId_t fieldId, ROOT::DescriptorId_t linkId)
RResult< void > AddClusterGroup(RClusterGroupDescriptor &&clusterGroup)
RResult< void > EnsureFieldExists(ROOT::DescriptorId_t fieldId) const
void SetFeature(unsigned int flag)
Sets the flag-th bit of the feature flag to 1.
Used for string interning of repeated type names, field names, etc.
const std::string * Intern(std::string_view str)
Searches for str in the pool.
The window of element indexes of a particular column in a particular cluster.
bool IsSuppressed() const
void SetPhysicalColumnId(ROOT::DescriptorId_t id)
ROOT::DescriptorId_t GetPhysicalColumnId() const
void SetIsSuppressed(bool suppressed)
ROOT::NTupleSize_t GetNElements() const
void IncrementNElements(ROOT::NTupleSize_t by)
Metadata for RNTuple clusters.
ROOT::NTupleSize_t fFirstEntryIndex
Clusters can be swapped by adjusting the entry offsets of the cluster and all ranges.
std::unordered_map< ROOT::DescriptorId_t, RColumnRange > fColumnRanges
ROOT::NTupleSize_t fNEntries
ROOT::DescriptorId_t fClusterId
RClusterDescriptor Clone() const
bool operator==(const RClusterDescriptor &other) const
RColumnRangeIterable GetColumnRangeIterable() const
Returns an iterator over pairs { columnId, columnRange }. The iteration order is unspecified.
std::unordered_map< ROOT::DescriptorId_t, RPageRange > fPageRanges
std::uint64_t GetNBytesOnStorage() const
Clusters are bundled in cluster groups.
RNTupleLocator fPageListLocator
The page list that corresponds to the cluster group.
RClusterGroupDescriptor Clone() const
std::vector< ROOT::DescriptorId_t > fClusterIds
The cluster IDs can be empty if the corresponding page list is not loaded.
ROOT::DescriptorId_t GetId() const
std::uint64_t fMinEntry
The minimum first entry number of the clusters in the cluster group.
std::uint32_t fNClusters
Number of clusters is always known even if the cluster IDs are not (yet) populated.
std::uint32_t GetNClusters() const
std::uint64_t fPageListLength
Uncompressed size of the page list.
std::uint64_t GetPageListLength() const
std::uint64_t GetMinEntry() const
std::uint64_t GetEntrySpan() const
RNTupleLocator GetPageListLocator() const
ROOT::DescriptorId_t fClusterGroupId
std::uint64_t fEntrySpan
Number of entries that are (partially for sharded clusters) covered by this cluster group.
bool operator==(const RClusterGroupDescriptor &other) const
RClusterGroupDescriptor CloneSummary() const
Creates a clone without the cluster IDs.
Metadata stored for every column of an RNTuple.
ROOT::DescriptorId_t fPhysicalColumnId
Usually identical to the logical column ID, except for alias columns where it references the shadowed...
bool operator==(const RColumnDescriptor &other) const
ROOT::DescriptorId_t fLogicalColumnId
The actual column identifier, which is the link to the corresponding field.
std::unique_ptr< RValueRange > fValueRange
Optional value range (used e.g. by quantized real fields)
ROOT::DescriptorId_t fFieldId
Every column belongs to one and only one field.
std::int64_t fFirstElementIndex
The absolute value specifies the index for the first stored element for this column.
std::uint32_t fIndex
A field can be serialized into several columns, which are numbered from zero to $n$.
std::uint16_t fBitsOnStorage
The size in bits of elements of this column.
std::uint16_t fRepresentationIndex
A field may use multiple column representations, which are numbered from zero to $m$.
ROOT::ENTupleColumnType fType
The on-disk column type.
RColumnDescriptor Clone() const
Get a copy of the descriptor.
Base class for all ROOT issued exceptions.
A field translates read and write calls from/to underlying columns to/from tree values.
ROOT::ENTupleStructure GetStructure() const
@ kTraitEmulatedField
This field is a user defined type that was missing dictionaries and was reconstructed from the on-dis...
@ kTraitSoACollection
The field represents a collection in SoA layout.
@ kTraitInvalidField
This field is an instance of RInvalidField and can be safely static_cast to it.
@ kTraitTypeChecksum
The TClass checksum is set and valid.
const std::string & GetFieldName() const
const std::string & GetTypeAlias() const
const std::string & GetDescription() const
Get the field's description.
virtual std::uint32_t GetFieldVersion() const
Indicates an evolution of the mapping scheme from C++ type to columns.
virtual std::uint32_t GetTypeChecksum() const
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
std::uint32_t GetTraits() const
std::size_t GetNRepetitions() const
const std::string & GetTypeName() 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.
virtual std::uint32_t GetTypeVersion() const
Indicates an evolution of the C++ type itself.
Metadata stored for every field of an RNTuple.
const std::string & GetTypeAlias() const
std::unique_ptr< ROOT::RFieldBase > CreateField(const RNTupleDescriptor &ntplDesc, const ROOT::RCreateFieldOptions &options={}) const
In general, we create a field simply from the C++ type name.
std::uint32_t fFieldVersion
The version of the C++-type-to-column translation mechanics.
ROOT::DescriptorId_t fFieldId
RFieldDescriptor Clone() const
Get a copy of the descriptor.
ROOT::DescriptorId_t GetId() const
std::uint64_t fNRepetitions
The number of elements per entry for fixed-size arrays.
const std::vector< ROOT::DescriptorId_t > & GetLogicalColumnIds() const
std::uint32_t fColumnCardinality
The number of columns in the column representations of the field.
ROOT::DescriptorId_t fProjectionSourceId
For projected fields, the source field ID.
static const std::string & GetEmptyString()
ROOT::ENTupleStructure GetStructure() const
bool operator==(const RFieldDescriptor &other) const
ROOT::DescriptorId_t fParentId
Establishes sub field relationships, such as classes and collections.
ROOT::DescriptorId_t GetParentId() const
ROOT::ENTupleStructure fStructure
The structural information carried by this field in the data model tree.
std::vector< ROOT::DescriptorId_t > fLinkIds
The pointers in the other direction from parent to children.
const std::string & GetFieldDescription() const
void InitFrom(const RFieldDescriptor &source, Internal::RStringPool &stringPool)
bool fIsSoACollection
Indicates if this is a collection that should be represented in memory by a SoA layout.
std::uint32_t fTypeVersion
The version of the C++ type itself.
const std::string & GetFieldName() const
std::unique_ptr< Internal::RStringPool > fStringPool
Optional string storage for a free-standing field descriptor.
std::vector< ROOT::DescriptorId_t > fLogicalColumnIds
The ordered list of columns attached to this field: first by representation index then by column inde...
const std::string & GetTypeName() const
std::optional< std::uint32_t > fTypeChecksum
For custom classes, we store the ROOT TClass reported checksum to facilitate the use of I/O rules tha...
Used in RFieldBase::Check() to record field creation failures.
@ kGeneric
Generic unrecoverable error.
@ kUnknownStructure
The field could not be created because its descriptor had an unknown structural role.
ECategory GetCategory() const
Metadata stored for every Attribute Set linked to an RNTuple.
std::uint16_t fSchemaVersionMajor
RNTupleLocator fAnchorLocator
std::uint16_t fSchemaVersionMinor
RNTupleAttrSetDescriptor Clone() const
bool operator==(const RNTupleAttrSetDescriptor &other) const
std::uint32_t fAnchorLength
uncompressed size of the linked anchor
Loop over all the clusters of an RNTuple, ordered by first entry number.
Used to loop over all the cluster groups of an RNTuple in order of entry ranges.
Used to loop over a field's associated columns.
std::vector< ROOT::DescriptorId_t > fColumns
The descriptor ids of the columns ordered by field, representation, and column index.
RColumnDescriptorIterable(const RNTupleDescriptor &ntuple, const RFieldDescriptor &fieldDesc)
Used to loop over a field's child fields.
The on-storage metadata of an RNTuple.
std::vector< RNTupleAttrSetDescriptor > fAttributeSets
List of AttributeSets linked to this RNTuple.
const RColumnDescriptor & GetColumnDescriptor(ROOT::DescriptorId_t columnId) const
RFieldDescriptorIterable GetFieldIterable(const RFieldDescriptor &fieldDesc) const
std::set< unsigned int > fFeatureFlags
std::unordered_map< ROOT::DescriptorId_t, RClusterGroupDescriptor > fClusterGroupDescriptors
const RFieldDescriptor & GetFieldDescriptor(ROOT::DescriptorId_t fieldId) const
RNTupleAttrSetDescriptorIterable GetAttrSetIterable() const
std::uint64_t fNPhysicalColumns
Updated by the descriptor builder when columns are added.
ROOT::DescriptorId_t fFieldZeroId
Set by the descriptor builder.
std::uint64_t fNEntries
Updated by the descriptor builder when the cluster groups are added.
RClusterDescriptorIterable GetActiveClusterIterable() const
RClusterGroupDescriptorIterable GetClusterGroupIterable() const
std::size_t GetNActiveClusters() const
RColumnDescriptorIterable GetColumnIterable() const
bool operator==(const RNTupleDescriptor &other) const
std::uint64_t fOnDiskFooterSize
Like fOnDiskHeaderSize, contains both cluster summaries and page locations.
std::uint16_t fVersionMinor
Set by the descriptor builder when deserialized.
ROOT::DescriptorId_t FindClusterId(ROOT::NTupleSize_t entryIdx) const
ROOT::NTupleSize_t R__DEPRECATED(6, 46, "This function is ill-conceived in the descriptor " "as not all cluster descriptors may be present. This interface is no longer publicly exposed.") GetNElements(ROOT ROOT::DescriptorId_t GetFieldZeroId() const
Returns the logical parent of all top-level RNTuple data fields.
std::vector< std::uint64_t > GetFeatureFlags() const
std::unique_ptr< ROOT::RNTupleModel > CreateModel(const RCreateModelOptions &options=RCreateModelOptions()) const
Re-create the C++ model from the stored metadata.
std::string GetTypeNameForComparison(const RFieldDescriptor &fieldDesc) const
Adjust the type name of the passed RFieldDescriptor for comparison with another renormalized type nam...
std::unordered_map< ROOT::DescriptorId_t, RClusterDescriptor > fClusterDescriptors
Potentially a subset of all the available clusters.
std::size_t GetNClusters() const
ROOT::DescriptorId_t FindPhysicalColumnId(ROOT::DescriptorId_t fieldId, std::uint32_t columnIndex, std::uint16_t representationIndex) const
RExtraTypeInfoDescriptorIterable GetExtraTypeInfoIterable() const
std::shared_ptr< Internal::RStringPool > fStringPool
Storage for all the field strings. Shared among descriptor clones.
const RHeaderExtension * GetHeaderExtension() const
Return header extension information; if the descriptor does not have a header extension,...
std::uint64_t fNClusters
Updated by the descriptor builder when the cluster groups are added.
RNTupleDescriptor CloneSchema(bool shareStringPool) const
Creates a descriptor containing only the schema information about this RNTuple, i....
std::uint64_t fOnDiskHeaderXxHash3
Set by the descriptor builder when deserialized.
ROOT::DescriptorId_t FindFieldId(std::string_view fieldName, ROOT::DescriptorId_t parentId) const
std::string fName
The RNTuple name needs to be unique in a given storage location (file)
std::uint64_t fOnDiskHeaderSize
Set by the descriptor builder when deserialized.
RResult< void > DropClusterGroupDetails(ROOT::DescriptorId_t clusterGroupId)
std::uint16_t fVersionMajor
Set by the descriptor builder when deserialized.
std::vector< ROOT::DescriptorId_t > fSortedClusterGroupIds
References cluster groups sorted by entry range and thus allows for binary search.
std::unordered_map< ROOT::DescriptorId_t, RColumnDescriptor > fColumnDescriptors
ROOT::DescriptorId_t FindLogicalColumnId(ROOT::DescriptorId_t fieldId, std::uint32_t columnIndex, std::uint16_t representationIndex) const
std::unordered_map< ROOT::DescriptorId_t, RFieldDescriptor > fFieldDescriptors
RResult< void > AddClusterGroupDetails(ROOT::DescriptorId_t clusterGroupId, std::vector< RClusterDescriptor > &clusterDescs)
Methods to load and drop cluster group details (cluster IDs and page locations)
std::uint16_t fVersionPatch
Set by the descriptor builder when deserialized.
std::string fDescription
Free text from the user.
RFieldDescriptorIterable GetTopLevelFields() const
std::uint16_t fVersionEpoch
Set by the descriptor builder when deserialized.
std::vector< RExtraTypeInfoDescriptor > fExtraTypeInfoDescriptors
RNTupleDescriptor Clone() const
ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindClusterId(ROOT ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindNextClusterId(ROOT ROOT::DescriptorId_t R__DEPRECATED(6, 46, "This function is ill-defined in the descriptor " "as not all cluster descriptors may be present. This interface is no longer exposed.") FindPrevClusterId(ROOT std::string GetQualifiedFieldName(ROOT::DescriptorId_t fieldId) const
Walks up the parents of the field ID and returns a field name of the form a.b.c.d In case of invalid ...
bool FieldTypeNamesMayNeedFixup() const
ROOT v6.34, with spec versions before 1.0.0.1, did not properly renormalize the type name.
std::uint64_t fGeneration
The generation of the descriptor.
std::unique_ptr< RHeaderExtension > fHeaderExtension
Generic information about the physical location of data.
void SetType(ELocatorType type)
void SetNBytesOnStorage(std::uint64_t nBytesOnStorage)
static std::unique_ptr< RNTupleModel > Create()
static std::unique_ptr< RNTupleModel > CreateBare()
Creates a "bare model", i.e. an RNTupleModel with no default entry.
static constexpr std::uint16_t kVersionPatch
static constexpr std::uint16_t kVersionMajor
static constexpr std::uint16_t kVersionEpoch
static constexpr std::uint16_t kVersionMinor
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
static std::unique_ptr< RVectorField > CreateUntyped(std::string_view fieldName, std::unique_ptr< RFieldBase > itemField)
RResult< void > EnsureValidNameForRNTuple(std::string_view name, std::string_view where)
Check whether a given string is a valid name according to the RNTuple specification.
ROOT::RResult< std::unique_ptr< ROOT::RFieldBase > > CallFieldBaseCreate(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
bool IsCustomEnumFieldDesc(const RNTupleDescriptor &desc, const RFieldDescriptor &fieldDesc)
Tells if the field describes a user-defined enum type.
std::vector< ROOT::Internal::RNTupleClusterBoundaries > GetClusterBoundaries(const RNTupleDescriptor &desc)
Return the cluster boundaries for each cluster in this RNTuple.
std::string GetRenormalizedTypeName(const std::string &metaNormalizedName)
Given a type name normalized by ROOT meta, renormalize it for RNTuple. E.g., insert std::prefix.
bool IsStdAtomicFieldDesc(const RFieldDescriptor &fieldDesc)
Tells if the field describes a std::atomic<T> type.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId
Additional information about a page in an in-memory RPageRange.
Information about a single page in the context of a cluster's page range.
void SetLocator(const RNTupleLocator &locator)
std::uint32_t GetNElements() const
void SetNElements(std::uint32_t n)
void SetEmulateUnknownTypes(bool v)
void SetReturnInvalidOnError(bool v)
bool GetReturnInvalidOnError() const
bool GetEmulateUnknownTypes() const
Modifiers passed to CreateModel()
bool GetCreateBare() const
bool GetEmulateUnknownTypes() const
bool GetReconstructProjections() const
bool GetForwardCompatible() const
static uint64_t sum(uint64_t i)