55namespace Experimental {
57class RCollectionField;
58class RCollectionNTupleWriter;
63struct RFieldCallbackInjector;
165 std::swap(
fField, other.fField);
166 std::swap(
fObjPtr, other.fObjPtr);
174 template <
typename T>
180 return static_cast<T *
>(
result);
187 template <
typename T>
190 return static_cast<T *
>(
fObjPtr);
323 static const std::size_t
kAllSet = std::size_t(-1);
377 virtual std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const = 0;
383 virtual void DestroyValue(
void *objPtr,
bool dtorOnly =
false)
const;
393 virtual std::size_t
AppendImpl(
const void *from);
443 virtual std::size_t
ReadBulkImpl(
const RBulkSpec &bulkSpec);
464 other.
Read(clusterIndex, to);
481 void Attach(std::unique_ptr<Detail::RFieldBase>
child);
492 Create(
const std::string &fieldName,
const std::string &canonicalType,
const std::string &typeAlias);
496 template <
bool IsConstT>
500 using FieldPtr_t = std::conditional_t<IsConstT, const RFieldBase *, RFieldBase *>;
512 using value_type = std::conditional_t<IsConstT, const RFieldBase, RFieldBase>;
513 using pointer = std::conditional_t<IsConstT, const RFieldBase *, RFieldBase *>;
514 using reference = std::conditional_t<IsConstT, const RFieldBase &, RFieldBase &>;
523 auto itr =
fStack.rbegin();
524 if (!itr->fFieldPtr->fSubFields.empty()) {
525 fStack.emplace_back(
Position(itr->fFieldPtr->fSubFields[0].get(), 0));
529 unsigned int nextIdxInParent = ++(itr->fIdxInParent);
530 while (nextIdxInParent >= itr->fFieldPtr->fParent->fSubFields.size()) {
532 itr->fFieldPtr = itr->fFieldPtr->fParent;
533 itr->fIdxInParent = -1;
538 nextIdxInParent = ++(itr->fIdxInParent);
540 itr->fFieldPtr = itr->fFieldPtr->fParent->fSubFields[nextIdxInParent].get();
557 std::size_t nRepetitions = 0);
565 std::unique_ptr<RFieldBase>
Clone(std::string_view newName)
const;
569 Create(
const std::string &fieldName,
const std::string &typeName);
657 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const override;
693 RClassField(std::string_view fieldName, std::string_view className,
TClass *classp);
700 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
705 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final;
707 std::
size_t AppendImpl(const
void *from) final;
723 void AcceptVisitor(Detail::RFieldVisitor &visitor) const override;
729 REnumField(std::string_view fieldName, std::string_view enumName,
TEnum *enump);
730 REnumField(std::string_view fieldName, std::string_view enumName, std::unique_ptr<RFieldBase> intField);
733 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
743 REnumField(std::string_view fieldName, std::string_view enumName);
780 void *fIterator =
nullptr;
781 void *fElementPtr =
nullptr;
785 auto fnNext_Contig = [&]() {
788 auto &iter =
reinterpret_cast<unsigned char *&
>(fIterator),
p = iter;
817 void *fBegin = &fBeginSmallBuf;
818 void *fEnd = &fEndSmallBuf;
824 std::size_t stride = 0U)
825 : fIFuncs(ifuncs), fStride(stride)
835 std::unique_ptr<TVirtualCollectionProxy>
fProxy;
850 std::unique_ptr<Detail::RFieldBase> itemField);
853 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const override;
855 void GenerateColumnsImpl() final;
858 void GenerateValue(
void *where) const override;
859 void DestroyValue(
void *objPtr,
bool dtorOnly = false) const override;
861 std::
size_t AppendImpl(const
void *from) final;
862 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to) final;
864 void CommitClusterImpl() final { fNWritten = 0; }
872 using Detail::RFieldBase::GenerateValue;
873 std::vector<RValue> SplitValue(
const RValue &
value)
const final;
875 size_t GetAlignment()
const override {
return alignof(std::max_align_t); }
879 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
883 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
891 std::size_t fMaxAlignment = 1;
895 std::size_t GetItemPadding(std::size_t baseOffset, std::size_t itemAlignment)
const;
897 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const override;
902 void GenerateValue(
void *where)
const override;
903 void DestroyValue(
void *objPtr,
bool dtorOnly =
false)
const override;
905 std::size_t AppendImpl(
const void *from)
final;
906 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to)
final;
907 void ReadInClusterImpl(
const RClusterIndex &clusterIndex,
void *to)
final;
909 RRecordField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &&itemFields,
910 const std::vector<std::size_t> &offsets, std::string_view typeName =
"");
912 template <std::
size_t N>
913 RRecordField(std::string_view fieldName, std::array<std::unique_ptr<Detail::RFieldBase>,
N> &&itemFields,
914 const std::array<std::size_t, N> &offsets, std::string_view typeName =
"")
917 fTraits |= kTraitTrivialType;
918 for (
unsigned i = 0; i <
N; ++i) {
919 fOffsets.push_back(offsets[i]);
920 fMaxAlignment = std::max(fMaxAlignment, itemFields[i]->GetAlignment());
921 fSize += GetItemPadding(
fSize, itemFields[i]->GetAlignment()) + itemFields[i]->GetValueSize();
922 fTraits &= itemFields[i]->GetTraits();
923 Attach(std::move(itemFields[i]));
929 RRecordField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &&itemFields);
930 RRecordField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &itemFields);
935 using Detail::RFieldBase::GenerateValue;
936 std::vector<RValue> SplitValue(
const RValue &
value)
const final;
949 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
952 void GenerateColumnsImpl() final;
955 void DestroyValue(
void *objPtr,
bool dtorOnly = false) const final;
956 void GenerateValue(
void *where)
const override {
new (where) std::vector<char>(); }
958 std::size_t AppendImpl(
const void *from)
final;
959 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to)
final;
964 RVectorField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField);
969 using Detail::RFieldBase::GenerateValue;
970 std::vector<RValue> SplitValue(
const RValue &
value)
const final;
971 size_t GetValueSize()
const override {
return sizeof(std::vector<char>); }
972 size_t GetAlignment() const final {
return std::alignment_of<std::vector<char>>(); }
975 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
978 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
987 std::size_t EvalValueSize()
const;
994 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const override;
996 void GenerateColumnsImpl() final;
999 void GenerateValue(
void *where) const override;
1000 void DestroyValue(
void *objPtr,
bool dtorOnly = false) const override;
1002 std::
size_t AppendImpl(const
void *from) override;
1003 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to) override;
1004 std::
size_t ReadBulkImpl(const
RBulkSpec &bulkSpec) final;
1006 void CommitClusterImpl() final { fNWritten = 0; }
1009 RRVecField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField);
1016 using Detail::RFieldBase::GenerateValue;
1017 std::vector<RValue> SplitValue(
const RValue &
value)
const final;
1018 size_t GetValueSize()
const override;
1019 size_t GetAlignment()
const override;
1023 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
1027 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
1038 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
1043 void GenerateValue(
void *where)
const override;
1044 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final;
1046 std::
size_t AppendImpl(const
void *from) final;
1047 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to) final;
1048 void ReadInClusterImpl(const
RClusterIndex &clusterIndex,
void *to) final;
1051 RArrayField(std::
string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField, std::
size_t arrayLength);
1056 using Detail::RFieldBase::GenerateValue;
1058 size_t GetLength()
const {
return fArrayLength; }
1060 size_t GetAlignment() const final {
return fSubFields[0]->GetAlignment(); }
1069 static constexpr std::size_t kWordSize =
sizeof(
Word_t);
1070 static constexpr std::size_t kBitsPerWord = kWordSize * 8;
1076 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final
1078 return std::make_unique<RBitsetField>(newName, fN);
1080 const RColumnRepresentations &GetColumnRepresentations() const final;
1081 void GenerateColumnsImpl() final;
1083 void GenerateValue(
void *where) const final { memset(where, 0, GetValueSize()); }
1084 std::size_t AppendImpl(
const void *from)
final;
1085 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to)
final;
1093 using Detail::RFieldBase::GenerateValue;
1094 size_t GetValueSize() const final {
return kWordSize * ((fN + kBitsPerWord - 1) / kBitsPerWord); }
1099 std::size_t
GetN()
const {
return fN; }
1105 size_t fMaxItemSize = 0;
1106 size_t fMaxAlignment = 1;
1108 size_t fTagOffset = 0;
1111 static std::string GetTypeList(
const std::vector<Detail::RFieldBase *> &itemFields);
1113 std::uint32_t GetTag(
const void *variantPtr)
const;
1114 void SetTag(
void *variantPtr, std::uint32_t tag)
const;
1117 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
1120 void GenerateColumnsImpl() final;
1123 void GenerateValue(
void *where) const override;
1124 void DestroyValue(
void *objPtr,
bool dtorOnly = false) const final;
1126 std::
size_t AppendImpl(const
void *from) final;
1127 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to) final;
1129 void CommitClusterImpl() final;
1138 using Detail::RFieldBase::GenerateValue;
1139 size_t GetValueSize() const final;
1140 size_t GetAlignment() const final {
return fMaxAlignment; }
1146 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
1149 RSetField(std::string_view fieldName, std::string_view typeName, std::unique_ptr<Detail::RFieldBase> itemField);
1154 size_t GetAlignment()
const override {
return std::alignment_of<std::set<std::max_align_t>>(); }
1173 void GenerateColumnsImpl() final;
1176 std::
size_t AppendNull();
1177 std::
size_t AppendValue(const
void *from);
1178 void CommitClusterImpl() final { fNWritten = 0; }
1184 RNullableField(std::string_view fieldName, std::string_view typeName, std::unique_ptr<Detail::RFieldBase> itemField);
1191 bool IsDense()
const {
return GetColumnRepresentative()[0] == EColumnType::kBit; }
1193 void SetDense() { SetColumnRepresentative({EColumnType::kBit}); }
1194 void SetSparse() { SetColumnRepresentative({EColumnType::kSplitIndex32}); }
1201 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
1203 void GenerateValue(
void *where)
const final {
new (where) std::unique_ptr<char>(); }
1204 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final;
1206 std::
size_t AppendImpl(const
void *from) final;
1207 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to) final;
1211 std::unique_ptr<Detail::RFieldBase> itemField);
1216 using Detail::RFieldBase::GenerateValue;
1218 size_t GetValueSize() const final {
return sizeof(std::unique_ptr<char>); }
1219 size_t GetAlignment() const final {
return alignof(std::unique_ptr<char>); }
1223template <
typename T,
typename=
void>
1228 if constexpr (std::is_default_constructible_v<T>) {
1232 new (where) T(
static_cast<TRootIOCtor *
>(
nullptr));
1239 static_assert(std::is_class_v<T>,
"no I/O support for this basic C++ type");
1245 using Detail::RFieldBase::GenerateValue;
1248template <
typename T>
1258template <
typename T,
typename =
void>
1261template <
typename T>
1263 T, typename std::enable_if<std::is_same<typename T::IsCollectionProxy, std::true_type>::value>
::type>
1304template <
typename T,
typename =
void>
1322template <
typename T>
1325 void GenerateValue(
void *where)
const final {
new (where) T(); }
1329 RField(std::string_view
name) : RProxiedCollectionField(
name, TypeName())
1331 static_assert(std::is_class<T>::value,
"collection proxy unsupported for fundamental types");
1337 using Detail::RFieldBase::GenerateValue;
1347 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
1356 static std::
string TypeName() {
return ""; }
1358 std::shared_ptr<RCollectionNTupleWriter> collectionNTuple,
1359 std::unique_ptr<RNTupleModel> collectionModel);
1373 static std::string
GetTypeList(
const std::array<std::unique_ptr<Detail::RFieldBase>, 2> &itemFields);
1376 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const override;
1378 void GenerateValue(
void *where)
const override;
1379 void DestroyValue(
void *objPtr,
bool dtorOnly =
false)
const override;
1381 RPairField(std::string_view fieldName, std::array<std::unique_ptr<Detail::RFieldBase>, 2> &&itemFields,
1382 const std::array<std::size_t, 2> &offsets);
1385 RPairField(std::string_view fieldName, std::array<std::unique_ptr<Detail::RFieldBase>, 2> &itemFields);
1390 using Detail::RFieldBase::GenerateValue;
1397 static std::string
GetTypeList(
const std::vector<std::unique_ptr<Detail::RFieldBase>> &itemFields);
1400 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const override;
1402 void GenerateValue(
void *where)
const override;
1403 void DestroyValue(
void *objPtr,
bool dtorOnly =
false)
const override;
1405 RTupleField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &&itemFields,
1406 const std::vector<std::size_t> &offsets);
1409 RTupleField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &itemFields);
1414 using Detail::RFieldBase::GenerateValue;
1429 const RColumnRepresentations &GetColumnRepresentations() const final;
1431 void GenerateColumnsImpl() final {
throw RException(
R__FAIL(
"Cardinality fields must only be used for reading")); }
1452 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1453 return std::make_unique<RField>(newName);
1457 void GenerateColumnsImpl() final;
1462 static std::string
TypeName() {
return "ROOT::Experimental::ClusterSize_t"; }
1466 fTraits |= kTraitTrivialType;
1479 return fPrincipalColumn->MapV<
ClusterSize_t>(globalIndex, nItems);
1482 return fPrincipalColumn->MapV<
ClusterSize_t>(clusterIndex, nItems);
1485 using Detail::RFieldBase::GenerateValue;
1491 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
1494 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
1499template <
typename SizeT>
1502 std::unique_ptr<ROOT::Experimental::Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final
1504 return std::make_unique<RField<RNTupleCardinality<SizeT>>>(newName);
1515 using Detail::RFieldBase::GenerateValue;
1524 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &
size);
1533 fPrincipalColumn->GetCollectionInfo(clusterIndex, &collectionStart, &
size);
1541 fPrincipalColumn->GetCollectionInfo(bulkSpec.fFirstIndex, &collectionStart, &collectionSize);
1544 typedValues[0] = collectionSize;
1546 auto lastOffset = collectionStart.
GetIndex() + collectionSize;
1548 std::size_t nEntries = 1;
1549 while (nRemainingEntries > 0) {
1551 auto offsets = fPrincipalColumn->MapV<
ClusterSize_t>(bulkSpec.fFirstIndex + nEntries, nItemsUntilPageEnd);
1552 std::size_t nBatch = std::min(nRemainingEntries, nItemsUntilPageEnd);
1553 for (std::size_t i = 0; i < nBatch; ++i) {
1554 typedValues[nEntries + i] = offsets[i] - lastOffset;
1555 lastOffset = offsets[i];
1557 nRemainingEntries -= nBatch;
1560 return RBulkSpec::kAllSet;
1567 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1568 return std::make_unique<RField>(newName);
1571 const RColumnRepresentations &GetColumnRepresentations() const final;
1572 void GenerateColumnsImpl() final;
1574 void GenerateValue(
void *where) const final {
new (where)
bool(
false); }
1581 fTraits |= kTraitTrivialType;
1588 return fPrincipalColumn->Map<
bool>(globalIndex);
1591 return fPrincipalColumn->Map<
bool>(clusterIndex);
1594 return fPrincipalColumn->MapV<
bool>(globalIndex, nItems);
1597 return fPrincipalColumn->MapV<
bool>(clusterIndex, nItems);
1600 using Detail::RFieldBase::GenerateValue;
1609 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1610 return std::make_unique<RField>(newName);
1613 const RColumnRepresentations &GetColumnRepresentations() const final;
1614 void GenerateColumnsImpl() final;
1616 void GenerateValue(
void *where) const final {
new (where)
float(0.0); }
1623 fTraits |= kTraitTrivialType;
1630 return fPrincipalColumn->Map<
float>(globalIndex);
1633 return fPrincipalColumn->Map<
float>(clusterIndex);
1636 return fPrincipalColumn->MapV<
float>(globalIndex, nItems);
1639 return fPrincipalColumn->MapV<
float>(clusterIndex, nItems);
1642 using Detail::RFieldBase::GenerateValue;
1652 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1653 return std::make_unique<RField>(newName);
1656 const RColumnRepresentations &GetColumnRepresentations() const final;
1657 void GenerateColumnsImpl() final;
1659 void GenerateValue(
void *where) const final {
new (where)
double(0.0); }
1666 fTraits |= kTraitTrivialType;
1673 return fPrincipalColumn->Map<
double>(globalIndex);
1676 return fPrincipalColumn->Map<
double>(clusterIndex);
1679 return fPrincipalColumn->MapV<
double>(globalIndex, nItems);
1682 return fPrincipalColumn->MapV<
double>(clusterIndex, nItems);
1685 using Detail::RFieldBase::GenerateValue;
1697 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1698 return std::make_unique<RField>(newName);
1701 const RColumnRepresentations &GetColumnRepresentations() const final;
1702 void GenerateColumnsImpl() final;
1704 void GenerateValue(
void *where) const final {
new (where)
char(0); }
1711 fTraits |= kTraitTrivialType;
1718 return fPrincipalColumn->Map<
char>(globalIndex);
1721 return fPrincipalColumn->Map<
char>(clusterIndex);
1724 return fPrincipalColumn->MapV<
char>(globalIndex, nItems);
1727 return fPrincipalColumn->MapV<
char>(clusterIndex, nItems);
1730 using Detail::RFieldBase::GenerateValue;
1737class RField<std::int8_t> :
public Detail::RFieldBase {
1739 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1740 return std::make_unique<RField>(newName);
1743 const RColumnRepresentations &GetColumnRepresentations() const final;
1744 void GenerateColumnsImpl() final;
1745 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1746 void GenerateValue(
void *where) const final {
new (where) int8_t(0); }
1749 static std::string TypeName() {
return "std::int8_t"; }
1753 fTraits |= kTraitTrivialType;
1759 std::int8_t *
Map(NTupleSize_t globalIndex) {
1760 return fPrincipalColumn->Map<std::int8_t>(globalIndex);
1762 std::int8_t *
Map(
const RClusterIndex &clusterIndex) {
1763 return fPrincipalColumn->Map<std::int8_t>(clusterIndex);
1765 std::int8_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1766 return fPrincipalColumn->MapV<std::int8_t>(globalIndex, nItems);
1768 std::int8_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1769 return fPrincipalColumn->MapV<std::int8_t>(clusterIndex, nItems);
1772 using Detail::RFieldBase::GenerateValue;
1773 size_t GetValueSize() const final {
return sizeof(std::int8_t); }
1774 size_t GetAlignment() const final {
return alignof(std::int8_t); }
1775 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1779class RField<std::uint8_t> :
public Detail::RFieldBase {
1781 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1782 return std::make_unique<RField>(newName);
1785 const RColumnRepresentations &GetColumnRepresentations() const final;
1786 void GenerateColumnsImpl() final;
1787 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1788 void GenerateValue(
void *where) const final {
new (where) uint8_t(0); }
1791 static std::string TypeName() {
return "std::uint8_t"; }
1795 fTraits |= kTraitTrivialType;
1801 std::uint8_t *
Map(NTupleSize_t globalIndex) {
1802 return fPrincipalColumn->Map<std::uint8_t>(globalIndex);
1804 std::uint8_t *
Map(
const RClusterIndex &clusterIndex) {
1805 return fPrincipalColumn->Map<std::uint8_t>(clusterIndex);
1807 std::uint8_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1808 return fPrincipalColumn->MapV<std::uint8_t>(globalIndex, nItems);
1810 std::uint8_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1811 return fPrincipalColumn->MapV<std::uint8_t>(clusterIndex, nItems);
1814 using Detail::RFieldBase::GenerateValue;
1815 size_t GetValueSize() const final {
return sizeof(std::uint8_t); }
1816 size_t GetAlignment() const final {
return alignof(std::uint8_t); }
1817 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1821class RField<std::int16_t> :
public Detail::RFieldBase {
1823 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1824 return std::make_unique<RField>(newName);
1827 const RColumnRepresentations &GetColumnRepresentations() const final;
1828 void GenerateColumnsImpl() final;
1829 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1830 void GenerateValue(
void *where) const final {
new (where) int16_t(0); }
1833 static std::string TypeName() {
return "std::int16_t"; }
1837 fTraits |= kTraitTrivialType;
1843 std::int16_t *
Map(NTupleSize_t globalIndex) {
1844 return fPrincipalColumn->Map<std::int16_t>(globalIndex);
1846 std::int16_t *
Map(
const RClusterIndex &clusterIndex) {
1847 return fPrincipalColumn->Map<std::int16_t>(clusterIndex);
1849 std::int16_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1850 return fPrincipalColumn->MapV<std::int16_t>(globalIndex, nItems);
1852 std::int16_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1853 return fPrincipalColumn->MapV<std::int16_t>(clusterIndex, nItems);
1856 using Detail::RFieldBase::GenerateValue;
1857 size_t GetValueSize() const final {
return sizeof(std::int16_t); }
1858 size_t GetAlignment() const final {
return alignof(std::int16_t); }
1859 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1863class RField<std::uint16_t> :
public Detail::RFieldBase {
1865 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1866 return std::make_unique<RField>(newName);
1869 const RColumnRepresentations &GetColumnRepresentations() const final;
1870 void GenerateColumnsImpl() final;
1871 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1872 void GenerateValue(
void *where) const final {
new (where) int16_t(0); }
1875 static std::string TypeName() {
return "std::uint16_t"; }
1879 fTraits |= kTraitTrivialType;
1885 std::uint16_t *
Map(NTupleSize_t globalIndex) {
1886 return fPrincipalColumn->Map<std::uint16_t>(globalIndex);
1888 std::uint16_t *
Map(
const RClusterIndex &clusterIndex) {
1889 return fPrincipalColumn->Map<std::uint16_t>(clusterIndex);
1891 std::uint16_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1892 return fPrincipalColumn->MapV<std::uint16_t>(globalIndex, nItems);
1894 std::uint16_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1895 return fPrincipalColumn->MapV<std::uint16_t>(clusterIndex, nItems);
1898 using Detail::RFieldBase::GenerateValue;
1899 size_t GetValueSize() const final {
return sizeof(std::uint16_t); }
1900 size_t GetAlignment() const final {
return alignof(std::uint16_t); }
1901 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1905class RField<std::int32_t> :
public Detail::RFieldBase {
1907 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1908 return std::make_unique<RField>(newName);
1911 const RColumnRepresentations &GetColumnRepresentations() const final;
1912 void GenerateColumnsImpl() final;
1913 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1914 void GenerateValue(
void *where) const final {
new (where) int32_t(0); }
1917 static std::string TypeName() {
return "std::int32_t"; }
1921 fTraits |= kTraitTrivialType;
1927 std::int32_t *
Map(NTupleSize_t globalIndex) {
1928 return fPrincipalColumn->Map<std::int32_t>(globalIndex);
1930 std::int32_t *
Map(
const RClusterIndex &clusterIndex) {
1931 return fPrincipalColumn->Map<std::int32_t>(clusterIndex);
1933 std::int32_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1934 return fPrincipalColumn->MapV<std::int32_t>(globalIndex, nItems);
1936 std::int32_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1937 return fPrincipalColumn->MapV<std::int32_t>(clusterIndex, nItems);
1940 using Detail::RFieldBase::GenerateValue;
1941 size_t GetValueSize() const final {
return sizeof(std::int32_t); }
1942 size_t GetAlignment() const final {
return alignof(std::int32_t); }
1943 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1947class RField<std::uint32_t> :
public Detail::RFieldBase {
1949 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1950 return std::make_unique<RField>(newName);
1953 const RColumnRepresentations &GetColumnRepresentations() const final;
1954 void GenerateColumnsImpl() final;
1955 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1956 void GenerateValue(
void *where) const final {
new (where) uint32_t(0); }
1959 static std::string TypeName() {
return "std::uint32_t"; }
1963 fTraits |= kTraitTrivialType;
1969 std::uint32_t *
Map(NTupleSize_t globalIndex) {
1970 return fPrincipalColumn->Map<std::uint32_t>(globalIndex);
1972 std::uint32_t *
Map(
const RClusterIndex clusterIndex) {
1973 return fPrincipalColumn->Map<std::uint32_t>(clusterIndex);
1975 std::uint32_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1976 return fPrincipalColumn->MapV<std::uint32_t>(globalIndex, nItems);
1978 std::uint32_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1979 return fPrincipalColumn->MapV<std::uint32_t>(clusterIndex, nItems);
1982 using Detail::RFieldBase::GenerateValue;
1983 size_t GetValueSize() const final {
return sizeof(std::uint32_t); }
1984 size_t GetAlignment() const final {
return alignof(std::uint32_t); }
1985 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1989class RField<std::uint64_t> :
public Detail::RFieldBase {
1991 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1992 return std::make_unique<RField>(newName);
1995 const RColumnRepresentations &GetColumnRepresentations() const final;
1996 void GenerateColumnsImpl() final;
1997 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1998 void GenerateValue(
void *where) const final {
new (where) uint64_t(0); }
2001 static std::string TypeName() {
return "std::uint64_t"; }
2005 fTraits |= kTraitTrivialType;
2011 std::uint64_t *
Map(NTupleSize_t globalIndex) {
2012 return fPrincipalColumn->Map<std::uint64_t>(globalIndex);
2014 std::uint64_t *
Map(
const RClusterIndex &clusterIndex) {
2015 return fPrincipalColumn->Map<std::uint64_t>(clusterIndex);
2017 std::uint64_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
2018 return fPrincipalColumn->MapV<std::uint64_t>(globalIndex, nItems);
2020 std::uint64_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
2021 return fPrincipalColumn->MapV<std::uint64_t>(clusterIndex, nItems);
2024 using Detail::RFieldBase::GenerateValue;
2025 size_t GetValueSize() const final {
return sizeof(std::uint64_t); }
2026 size_t GetAlignment() const final {
return alignof(std::uint64_t); }
2027 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
2031class RField<std::int64_t> :
public Detail::RFieldBase {
2033 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
2034 return std::make_unique<RField>(newName);
2037 const RColumnRepresentations &GetColumnRepresentations() const final;
2038 void GenerateColumnsImpl() final;
2039 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
2040 void GenerateValue(
void *where) const final {
new (where) int64_t(0); }
2043 static std::string TypeName() {
return "std::int64_t"; }
2047 fTraits |= kTraitTrivialType;
2053 std::int64_t *
Map(NTupleSize_t globalIndex) {
2054 return fPrincipalColumn->Map<std::int64_t>(globalIndex);
2056 std::int64_t *
Map(
const RClusterIndex &clusterIndex) {
2057 return fPrincipalColumn->Map<std::int64_t>(clusterIndex);
2059 std::int64_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
2060 return fPrincipalColumn->MapV<std::int64_t>(globalIndex, nItems);
2062 std::int64_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
2063 return fPrincipalColumn->MapV<std::int64_t>(clusterIndex, nItems);
2066 using Detail::RFieldBase::GenerateValue;
2067 size_t GetValueSize() const final {
return sizeof(std::int64_t); }
2068 size_t GetAlignment() const final {
return alignof(std::int64_t); }
2069 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
2073class RField<std::string> :
public Detail::RFieldBase {
2077 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
2078 return std::make_unique<RField>(newName);
2081 const RColumnRepresentations &GetColumnRepresentations() const final;
2082 void GenerateColumnsImpl() final;
2083 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
2085 void GenerateValue(
void *where) const final {
new (where) std::string(); }
2086 void DestroyValue(
void *objPtr,
bool dtorOnly =
false)
const override;
2088 std::size_t AppendImpl(
const void *from)
final;
2091 void CommitClusterImpl() final { fIndex = 0; }
2094 static std::string TypeName() {
return "std::string"; }
2103 using Detail::RFieldBase::GenerateValue;
2104 size_t GetValueSize() const final {
return sizeof(std::string); }
2105 size_t GetAlignment() const final {
return std::alignment_of<std::string>(); }
2106 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
2110template <
typename ItemT, std::
size_t N>
2111class RField<std::array<ItemT, N>> :
public RArrayField {
2112 using ContainerT =
typename std::array<ItemT, N>;
2115 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2118 static std::string TypeName() {
2121 explicit RField(std::string_view
name) : RArrayField(
name, std::make_unique<
RField<ItemT>>(
"_0"),
N)
2127 using Detail::RFieldBase::GenerateValue;
2130template <
typename ItemT, std::
size_t N>
2139template <
typename ItemT>
2141 using ContainerT =
typename std::set<ItemT>;
2144 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2145 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final
2147 std::destroy_at(
static_cast<ContainerT *
>(objPtr));
2148 Detail::RFieldBase::DestroyValue(objPtr, dtorOnly);
2154 explicit RField(std::string_view
name) : RSetField(
name, TypeName(), std::make_unique<
RField<ItemT>>(
"_0")) {}
2159 using Detail::RFieldBase::GenerateValue;
2160 size_t GetValueSize() const final {
return sizeof(ContainerT); }
2161 size_t GetAlignment() const final {
return std::alignment_of<ContainerT>(); }
2164template <
typename... ItemTs>
2165class RField<std::variant<ItemTs...>> :
public RVariantField {
2166 using ContainerT =
typename std::variant<ItemTs...>;
2168 template <
typename HeadT,
typename... TailTs>
2169 static std::string BuildItemTypes()
2172 if constexpr(
sizeof...(TailTs) > 0)
2173 result +=
"," + BuildItemTypes<TailTs...>();
2177 template <
typename HeadT,
typename... TailTs>
2178 static std::vector<Detail::RFieldBase *> BuildItemFields(
unsigned int index = 0)
2180 std::vector<Detail::RFieldBase *>
result;
2182 if constexpr(
sizeof...(TailTs) > 0) {
2183 auto tailFields = BuildItemFields<TailTs...>(
index + 1);
2184 result.insert(
result.end(), tailFields.begin(), tailFields.end());
2190 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2193 static std::string TypeName() {
return "std::variant<" + BuildItemTypes<ItemTs...>() +
">"; }
2194 explicit RField(std::string_view
name) : RVariantField(
name, BuildItemFields<ItemTs...>()) {}
2199 using Detail::RFieldBase::GenerateValue;
2202template <
typename ItemT>
2203class RField<std::vector<ItemT>> :
public RVectorField {
2204 using ContainerT =
typename std::vector<ItemT>;
2207 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2212 : RVectorField(
name, std::make_unique<
RField<ItemT>>(
"_0"))
2218 using Detail::RFieldBase::GenerateValue;
2219 size_t GetValueSize() const final {
return sizeof(ContainerT); }
2224class RField<std::vector<bool>> :
public Detail::RFieldBase {
2229 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
2230 return std::make_unique<RField>(newName);
2233 const RColumnRepresentations &GetColumnRepresentations() const final;
2234 void GenerateColumnsImpl() final;
2235 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
2237 void GenerateValue(
void *where) const final {
new (where) std::vector<bool>(); }
2238 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final;
2240 std::
size_t AppendImpl(const
void *from) final;
2241 void ReadGlobalImpl(NTupleSize_t globalIndex,
void *to) final;
2243 void CommitClusterImpl() final { fNWritten = 0; }
2246 static std::string TypeName() {
return "std::vector<bool>"; }
2252 using Detail::RFieldBase::GenerateValue;
2253 std::vector<RValue> SplitValue(
const RValue &
value)
const final;
2255 size_t GetValueSize() const final {
return sizeof(std::vector<bool>); }
2256 size_t GetAlignment() const final {
return std::alignment_of<std::vector<bool>>(); }
2257 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
2258 void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *
size)
const {
2259 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
2261 void GetCollectionInfo(
const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *
size)
const
2263 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
2267template <
typename ItemT>
2271 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
2272 auto newItemField = fSubFields[0]->Clone(fSubFields[0]->GetName());
2273 return std::make_unique<RField<ROOT::VecOps::RVec<ItemT>>>(newName, std::move(newItemField));
2279 std::destroy_at(
static_cast<ContainerT *
>(objPtr));
2280 Detail::RFieldBase::DestroyValue(objPtr, dtorOnly);
2285 auto typedValue =
static_cast<const ContainerT *
>(from);
2287 auto count = typedValue->size();
2288 for (
unsigned i = 0; i < count; ++i) {
2289 nbytes += CallAppendOn(*fSubFields[0], &typedValue->data()[i]);
2291 this->fNWritten += count;
2292 fColumns[0]->Append(&this->fNWritten);
2293 return nbytes + fColumns[0]->GetElement()->GetPackedSize();
2297 auto typedValue =
static_cast<ContainerT *
>(to);
2300 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
2301 typedValue->resize(nItems);
2302 for (
unsigned i = 0; i < nItems; ++i) {
2303 CallReadOn(*fSubFields[0], collectionStart + i, &typedValue->data()[i]);
2308 RField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField)
2309 :
RRVecField(fieldName, std::move(itemField))
2323 using Detail::RFieldBase::GenerateValue;
2325 size_t GetAlignment() const final {
return std::alignment_of<ContainerT>(); }
2328template <
typename T1,
typename T2>
2329class RField<std::pair<T1, T2>> :
public RPairField {
2330 using ContainerT =
typename std::pair<T1,T2>;
2332 template <
typename Ty1,
typename Ty2>
2333 static std::array<std::unique_ptr<Detail::RFieldBase>, 2> BuildItemFields()
2335 return {std::make_unique<RField<Ty1>>(
"_0"), std::make_unique<
RField<Ty2>>(
"_1")};
2339 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final
2341 std::array<std::unique_ptr<Detail::RFieldBase>, 2> items{fSubFields[0]->
Clone(fSubFields[0]->GetName()),
2342 fSubFields[1]->Clone(fSubFields[1]->GetName())};
2343 return std::make_unique<RField<std::pair<T1, T2>>>(newName, std::move(items));
2346 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2347 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final
2349 std::destroy_at(
static_cast<ContainerT *
>(objPtr));
2350 Detail::RFieldBase::DestroyValue(objPtr, dtorOnly);
2354 static std::string TypeName() {
2357 explicit RField(std::string_view
name, std::array<std::unique_ptr<Detail::RFieldBase>, 2> &&itemFields)
2358 : RPairField(
name, std::move(itemFields), {offsetof(ContainerT,
first), offsetof(ContainerT, second)})
2360 fMaxAlignment = std::max(
alignof(
T1),
alignof(
T2));
2361 fSize =
sizeof(ContainerT);
2368 using Detail::RFieldBase::GenerateValue;
2371template <
typename... ItemTs>
2372class RField<std::tuple<ItemTs...>> :
public RTupleField {
2373 using ContainerT =
typename std::tuple<ItemTs...>;
2375 template <
typename HeadT,
typename... TailTs>
2376 static std::string BuildItemTypes()
2379 if constexpr (
sizeof...(TailTs) > 0)
2380 result +=
"," + BuildItemTypes<TailTs...>();
2384 template <
typename HeadT,
typename... TailTs>
2385 static void _BuildItemFields(std::vector<std::unique_ptr<Detail::RFieldBase>> &itemFields,
unsigned int index = 0)
2388 if constexpr (
sizeof...(TailTs) > 0)
2389 _BuildItemFields<TailTs...>(itemFields,
index + 1);
2391 template <
typename... Ts>
2392 static std::vector<std::unique_ptr<Detail::RFieldBase>> BuildItemFields()
2394 std::vector<std::unique_ptr<Detail::RFieldBase>>
result;
2395 _BuildItemFields<Ts...>(
result);
2399 template <
unsigned Index,
typename HeadT,
typename... TailTs>
2400 static void _BuildItemOffsets(std::vector<std::size_t> &offsets,
const ContainerT &tuple)
2403 reinterpret_cast<std::uintptr_t
>(&std::get<Index>(tuple)) -
reinterpret_cast<std::uintptr_t
>(&tuple);
2404 offsets.emplace_back(
offset);
2405 if constexpr (
sizeof...(TailTs) > 0)
2406 _BuildItemOffsets<
Index + 1, TailTs...>(offsets, tuple);
2408 template <
typename... Ts>
2409 static std::vector<std::size_t> BuildItemOffsets()
2411 std::vector<std::size_t>
result;
2412 _BuildItemOffsets<0, Ts...>(
result, ContainerT());
2417 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final
2419 std::vector<std::unique_ptr<Detail::RFieldBase>> items;
2420 for (
auto &item : fSubFields)
2421 items.push_back(item->Clone(item->GetName()));
2422 return std::make_unique<
RField<std::tuple<ItemTs...>>>(newName, std::move(items));
2425 void GenerateValue(
void *where)
const final {
new (where) ContainerT(); }
2426 void DestroyValue(
void *objPtr,
bool dtorOnly =
false) const final
2428 std::destroy_at(
static_cast<ContainerT *
>(objPtr));
2429 Detail::RFieldBase::DestroyValue(objPtr, dtorOnly);
2433 static std::string TypeName() {
return "std::tuple<" + BuildItemTypes<ItemTs...>() +
">"; }
2434 explicit RField(std::string_view
name, std::vector<std::unique_ptr<Detail::RFieldBase>> &&itemFields)
2435 : RTupleField(
name, std::move(itemFields), BuildItemOffsets<ItemTs...>())
2437 fMaxAlignment = std::max({
alignof(ItemTs)...});
2438 fSize =
sizeof(ContainerT);
2445 using Detail::RFieldBase::GenerateValue;
2448template <std::
size_t N>
2449class RField<std::bitset<N>> :
public RBitsetField {
2451 static std::string TypeName() {
return "std::bitset<" + std::to_string(
N) +
">"; }
2457 using Detail::RFieldBase::GenerateValue;
2460template <
typename ItemT>
2461class RField<std::unique_ptr<ItemT>> :
public RUniquePtrField {
2464 explicit RField(std::string_view
name) : RUniquePtrField(
name, TypeName(), std::make_unique<
RField<ItemT>>(
"_0")) {}
2469 using Detail::RFieldBase::GenerateValue;
#define R__unlikely(expr)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
ROOT::Experimental::RField< T > RField
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
winID h TVirtualViewer3D TVirtualGLPainter p
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 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 r
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 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 Atom_t Time_t type
Binding & operator=(OUT(*fun)(void))
std::size_t GetPackedSize(std::size_t nElements=1U) const
void ReadV(const NTupleSize_t globalIndex, const ClusterSize_t::ValueType count, void *to)
void Append(const void *from)
RColumnElementBase * GetElement() const
void Read(const NTupleSize_t globalIndex, void *to)
NTupleSize_t GetGlobalIndex(const RClusterIndex &clusterIndex)
NTupleSize_t GetNElements() const
Similar to RValue but manages an array of consecutive values.
std::size_t fNValidValues
The sum of non-zero elements in the fMask.
RClusterIndex fFirstIndex
Index of the first value of the array.
RBulk(const RBulk &)=delete
void * GetValuePtrAt(std::size_t idx) const
void * fValues
Pointer to the start of the array.
std::vector< unsigned char > fAuxData
Reading arrays of complex values may require additional memory, for instance for the elements of arra...
std::unique_ptr< bool[]> fMaskAvail
Masks invalid values in the array.
void Reset(const RClusterIndex &firstIndex, std::size_t size)
Sets a new range for the bulk.
RBulk & operator=(const RBulk &)=delete
void * ReadBulk(const RClusterIndex &firstIndex, const bool *maskReq, std::size_t size)
Reads 'size' values from the associated field, starting from 'firstIndex'.
bool ContainsRange(const RClusterIndex &firstIndex, std::size_t size) const
RFieldBase * fField
The field that created the array of values.
std::size_t fCapacity
The size of the array memory block in number of values.
std::size_t fValueSize
Cached copy of fField->GetValueSize()
std::size_t fSize
The number of available values in the array (provided their mask is set)
Some fields have multiple possible column representations, e.g.
TypesList_t fSerializationTypes
const TypesList_t & GetDeserializationTypes() const
TypesList_t fDeserializationTypes
The union of the serialization types and the deserialization extra types.
const TypesList_t & GetSerializationTypes() const
std::vector< ColumnRepresentation_t > TypesList_t
const ColumnRepresentation_t & GetSerializationDefault() const
The first column list from fSerializationTypes is the default for writing.
Iterates over the sub tree of fields in depth-first search order.
pointer operator->() const
std::conditional_t< IsConstT, const RFieldBase, RFieldBase > value_type
std::conditional_t< IsConstT, const RFieldBase &, RFieldBase & > reference
RSchemaIteratorTemplate()
std::vector< Position > fStack
The stack of nodes visited when walking down the tree of fields.
RSchemaIteratorTemplate(pointer val, int idxInParent)
~RSchemaIteratorTemplate()
bool operator==(const iterator &rh) const
std::conditional_t< IsConstT, const RFieldBase *, RFieldBase * > pointer
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
reference operator*() const
void Advance()
Given that the iterator points to a valid field which is not the end iterator, go to the next field i...
bool operator!=(const iterator &rh) const
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
RFieldBase * GetField() const
void Read(NTupleSize_t globalIndex)
RValue & operator=(RValue &&other)
void Read(const RClusterIndex &clusterIndex)
RValue GetNonOwningCopy()
RValue(const RValue &)=delete
bool fIsOwning
If true, fObjPtr is destroyed in the destructor.
void * fObjPtr
Created by RFieldBase::GenerateValue() or a non-owning pointer from SplitValue() or BindValue()
RFieldBase * fField
The field that created the RValue.
RValue(RFieldBase *field, void *objPtr, bool isOwning)
RValue & operator=(const RValue &)=delete
A field translates read and write calls from/to underlying columns to/from tree values.
virtual std::uint32_t GetFieldVersion() const
Indicates an evolution of the mapping scheme from C++ type to columns.
RFieldBase * GetParent() const
std::string GetDescription() const
Get the field's description.
virtual size_t GetAlignment() const =0
As a rule of thumb, the alignment is equal to the size of the type.
static constexpr std::uint32_t kInvalidTypeVersion
RBulk GenerateBulk()
The returned bulk is initially empty; RBulk::ReadBulk will construct the array of values.
void SetOnDiskId(DescriptorId_t id)
EState fState
Changed by ConnectTo[Sink,Source], reset by Clone()
virtual void GenerateColumnsImpl(const RNTupleDescriptor &desc)=0
Creates the backing columns corresponsing to the field type for reading.
virtual void GenerateColumnsImpl()=0
Creates the backing columns corresponsing to the field type for writing.
virtual void GenerateValue(void *where) const =0
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
std::vector< std::unique_ptr< RFieldBase > > fSubFields
Collections and classes own sub fields.
RConstSchemaIterator cend() const
std::string fTypeAlias
A typedef or using name that was used when creating the field.
RFieldBase * fParent
Sub fields point to their mother field.
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &canonicalType, const std::string &typeAlias)
Factory method to resurrect a field from the stored on-disk type information.
std::string GetTypeAlias() const
static std::size_t CallAppendOn(RFieldBase &other, const void *from)
Allow derived classes to call Append and Read on other (sub) fields.
std::string GetName() const
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 CommitClusterImpl()
std::size_t GetNRepetitions() const
void CommitCluster()
Flushes data from active columns to disk and calls CommitClusterImpl.
std::string fDescription
Free text set by the user.
static RColumn * GetPrincipalColumnOf(const RFieldBase &other)
Fields may need direct access to the principal column of their sub fields, e.g. in RRVecField::ReadBu...
virtual std::uint32_t GetTypeVersion() const
Indicates an evolution of the C++ type itself.
int fTraits
Properties of the type that allow for optimizations of collections of that type.
friend struct ROOT::Experimental::Internal::RFieldCallbackInjector
DescriptorId_t GetOnDiskId() const
static constexpr int kTraitTrivialType
Shorthand for types that are both trivially constructible and destructible.
friend class ROOT::Experimental::RCollectionField
std::uint32_t GetOnDiskTypeVersion() const
Return the C++ type version stored in the field descriptor; only valid after a call to ConnectPageSou...
RSchemaIteratorTemplate< false > RSchemaIterator
void RemoveReadCallback(size_t idx)
RValue GenerateValue()
Generates an object of the field type and allocates new initialized memory according to the type.
virtual std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const =0
Called by Clone(), which additionally copies the on-disk ID.
virtual void ReadGlobalImpl(NTupleSize_t globalIndex, void *to)
virtual size_t GetValueSize() const =0
The number of bytes taken by a value of the appropriate type.
void SetDescription(std::string_view description)
void InvokeReadCallbacks(void *target)
RSchemaIteratorTemplate< true > RConstSchemaIterator
std::string GetType() const
static RResult< void > EnsureValidFieldName(std::string_view fieldName)
Check whether a given string is a valid field name.
RFieldBase(RFieldBase &&)=default
bool fIsSimple
A field qualifies as simple if it is both mappable and has no post-read callback.
virtual void ReadInClusterImpl(const RClusterIndex &clusterIndex, void *to)
std::string fType
The C++ type captured by this field.
std::function< void(void *)> ReadCallback_t
virtual std::vector< RValue > SplitValue(const RValue &value) const
Creates the list of direct child values given a value for this field.
std::string fName
The field name relative to its parent field.
static void CallReadOn(RFieldBase &other, const RClusterIndex &clusterIndex, void *to)
const ColumnRepresentation_t * fColumnRepresentative
Points into the static vector GetColumnRepresentations().GetSerializationTypes() when SetColumnRepres...
size_t AddReadCallback(ReadCallback_t func)
Set a user-defined function to be called after reading a value, giving a chance to inspect and/or mod...
virtual void OnConnectPageSource()
Called by ConnectPageSource() only once connected; derived classes may override this as appropriate.
NTupleSize_t GetNElements() const
static void CallGenerateValueOn(const RFieldBase &other, void *where)
Allow derived classes to call GenerateValue(void *) and DestroyValue on other (sub) fields.
void ConnectPageSource(RPageSource &pageSource)
std::uint32_t fOnDiskTypeVersion
C++ type version cached from the descriptor after a call to ConnectPageSource()
virtual std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec)
General implementation of bulk read.
virtual std::size_t AppendImpl(const void *from)
Operations on values of complex types, e.g.
virtual void DestroyValue(void *objPtr, bool dtorOnly=false) const
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
void Read(NTupleSize_t globalIndex, void *to)
Populate a single value with data from the field.
virtual const RColumnRepresentations & GetColumnRepresentations() const
Implementations in derived classes should return a static RColumnRepresentations object.
std::size_t Append(const void *from)
Write the given value into columns.
std::unique_ptr< RFieldBase > Clone(std::string_view newName) const
Copies the field and its sub fields using a possibly new name and a new, unconnected set of columns.
std::size_t fNRepetitions
For fixed sized arrays, the array length.
RFieldBase(const RFieldBase &)=delete
virtual void AcceptVisitor(RFieldVisitor &visitor) const
DescriptorId_t fOnDiskId
When the columns are connected to a page source or page sink, the field represents a field id in the ...
ENTupleStructure fStructure
The role of this field in the data model structure.
void AutoAdjustColumnTypes(const RNTupleWriteOptions &options)
When connecting a field to a page sink, the field's default column representation is subject to adjus...
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 Read(const RClusterIndex &clusterIndex, void *to)
std::string GetQualifiedFieldName() const
Returns the field name and parent field names separated by dots ("grandparent.parent....
const ColumnRepresentation_t & GetColumnRepresentative() const
Returns the fColumnRepresentative pointee or, if unset, the field's default representative.
static constexpr int kTraitMappable
A field of a fundamental type that can be directly mapped via RField<T>::Map(), i....
EState
During its lifetime, a field undergoes the following possible state transitions:
void Attach(std::unique_ptr< Detail::RFieldBase > child)
Add a new subfield to the list of nested fields.
std::vector< RFieldBase * > GetSubFields() const
bool HasReadCallbacks() const
static void CallReadOn(RFieldBase &other, NTupleSize_t globalIndex, void *to)
RFieldBase & operator=(const RFieldBase &)=delete
void SetColumnRepresentative(const ColumnRepresentation_t &representative)
Fixes a column representative.
ENTupleStructure GetStructure() const
bool HasDefaultColumnRepresentative() const
Whether or not an explicit column representative was set.
void ConnectPageSink(RPageSink &pageSink, NTupleSize_t firstEntry=0)
Fields and their columns live in the void until connected to a physical page storage.
static void CallDestroyValueOn(const RFieldBase &other, void *objPtr, bool dtorOnly=false)
RValue BindValue(void *where)
Creates a value from a memory location with an already constructed object.
RConstSchemaIterator cbegin() const
static constexpr int kTraitTriviallyConstructible
No constructor needs to be called, i.e.
static constexpr int kTraitTriviallyDestructible
The type is cleaned up just by freeing its memory. I.e. DestroyValue() is a no-op.
const ColumnRepresentation_t & EnsureCompatibleColumnTypes(const RNTupleDescriptor &desc) const
Returns the on-disk column types found in the provided descriptor for fOnDiskId.
NTupleSize_t EntryToColumnElementIndex(NTupleSize_t globalIndex) const
Translate an entry index to a column element index of the principal column and viceversa.
std::size_t ReadBulk(const RBulkSpec &bulkSpec)
Returns the number of newly available values, that is the number of bools in bulkSpec....
std::vector< ReadCallback_t > fReadCallbacks
List of functions to be called after reading a value.
std::vector< EColumnType > ColumnRepresentation_t
RColumn * fPrincipalColumn
Points into fColumns.
Abstract base class for classes implementing the visitor design pattern.
Abstract interface to write data into an ntuple.
Abstract interface to read data from an ntuple.
The generic field for fixed size arrays, which do not need an offset column.
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
The generic field an std::bitset<N>.
std::size_t GetN() const
Get the number of bits in the bitset, i.e. the N in std::bitset<N>
RBitsetField(RBitsetField &&other)=default
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
~RBitsetField() override=default
RBitsetField & operator=(RBitsetField &&other)=default
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
RCardinalityField & operator=(RCardinalityField &&other)=default
~RCardinalityField()=default
RCardinalityField(RCardinalityField &&other)=default
RCardinalityField(std::string_view fieldName, std::string_view typeName)
The field for a class with dictionary.
static constexpr const char * kPrefixInherited
Prefix used in the subfield names generated for base classes.
void OnConnectPageSource() final
Called by ConnectPageSource() only once connected; derived classes may override this as appropriate.
size_t GetValueSize() const override
The number of bytes taken by a value of the appropriate type.
void Attach(std::unique_ptr< Detail::RFieldBase > child, RSubFieldInfo info)
void DestroyValue(void *objPtr, bool dtorOnly=false) const final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
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 AcceptVisitor(Detail::RFieldVisitor &visitor) const override
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.
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given a value for this field.
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
void ReadInClusterImpl(const RClusterIndex &clusterIndex, void *to) final
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
std::vector< RSubFieldInfo > fSubFieldsInfo
Additional information kept for each entry in fSubFields
std::size_t fMaxAlignment
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
The collection field is only used for writing; when reading, untyped collections are projected to an ...
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::shared_ptr< RCollectionNTupleWriter > fCollectionNTuple
Save the link to the collection ntuple in order to reset the offset counter when committing the clust...
~RCollectionField() override=default
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
RCollectionField(RCollectionField &&other)=default
The field for an unscoped or scoped enum with dictionary.
~REnumField() override=default
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
REnumField & operator=(REnumField &&other)=default
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
REnumField(REnumField &&other)=default
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
void GenerateValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
Base class for all ROOT issued exceptions.
The container field for an ntuple model, which itself has no physical representation.
void GenerateValue(void *) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const override
Called by Clone(), which additionally copies the on-disk ID.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size)
ClusterSize_t * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
static std::string TypeName()
RField(std::string_view name)
ClusterSize_t * Map(const RClusterIndex &clusterIndex)
~RField() override=default
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
RField(RField &&other)=default
ClusterSize_t * Map(NTupleSize_t globalIndex)
ClusterSize_t * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
const RColumnRepresentations & GetColumnRepresentations() const final
Implementations in derived classes should return a static RColumnRepresentations object.
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size)
Special help for offset fields.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RField & operator=(RField &&other)=default
RField(RField &&other)=default
~RField() override=default
RField(std::string_view name)
RField(std::string_view name)
std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final
General implementation of bulk read.
RField(RField &&other)=default
void ReadInClusterImpl(const RClusterIndex &clusterIndex, void *to) final
Get the number of elements of the collection identified by clusterIndex.
void GenerateValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
Get the number of elements of the collection identified by globalIndex.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< ROOT::Experimental::Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RField & operator=(RField &&other)=default
static std::string TypeName()
RField(std::string_view name)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
typename ROOT::VecOps::RVec< ItemT > ContainerT
static std::string TypeName()
~RField() override=default
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
RField(RField &&other)=default
RField(std::string_view fieldName, std::unique_ptr< Detail::RFieldBase > itemField)
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void DestroyValue(void *objPtr, bool dtorOnly=false) const final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
void GenerateValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
bool * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
RField(std::string_view name)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
bool * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
~RField() override=default
static std::string TypeName()
RField(RField &&other)=default
bool * Map(const RClusterIndex &clusterIndex)
bool * Map(NTupleSize_t globalIndex)
char * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
RField(std::string_view name)
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
char * Map(NTupleSize_t globalIndex)
RField(RField &&other)=default
char * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
static std::string TypeName()
~RField() override=default
char * Map(const RClusterIndex &clusterIndex)
double * Map(const RClusterIndex &clusterIndex)
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
double * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
double * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
RField(std::string_view name)
~RField() override=default
double * Map(NTupleSize_t globalIndex)
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
RField(RField &&other)=default
static std::string TypeName()
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
static std::string TypeName()
RField(RField &&other)=default
float * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
float * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
RField(std::string_view name)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
float * Map(NTupleSize_t globalIndex)
float * Map(const RClusterIndex &clusterIndex)
~RField() override=default
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
Classes with dictionaries that can be inspected by TClass.
RField(std::string_view name)
void GenerateValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
RField & operator=(RField &&other)=default
RField(RField &&other)=default
static std::string TypeName()
~RField() override=default
The on-storage meta-data of an ntuple.
Common user-tunable settings for storing ntuples.
The field for values that may or may not be present in an entry.
RNullableField & operator=(RNullableField &&other)=default
~RNullableField() override=default
RNullableField(RNullableField &&other)=default
std::unique_ptr< RValue > fDefaultItemValue
For a dense nullable field, used to write a default-constructed item for missing ones.
The generic field for std::pair<T1, T2> types.
~RPairField() override=default
static std::string GetTypeList(const std::array< std::unique_ptr< Detail::RFieldBase >, 2 > &itemFields)
RPairField(RPairField &&other)=default
RPairField & operator=(RPairField &&other)=default
pointer operator*() const
bool operator==(const iterator &rh) const
RIterator(const RCollectionIterableOnce &owner)
bool operator!=(const iterator &rh) const
std::forward_iterator_tag iterator_category
const RCollectionIterableOnce & fOwner
RIterator(const RCollectionIterableOnce &owner, void *iter)
std::ptrdiff_t difference_type
Allows for iterating over the elements of a proxied collection.
const RIteratorFuncs & fIFuncs
const std::size_t fStride
~RCollectionIterableOnce()
RCollectionIterableOnce(void *collection, const RIteratorFuncs &ifuncs, TVirtualCollectionProxy *proxy, std::size_t stride=0U)
Construct a RCollectionIterableOnce that iterates over collection.
The field for a class representing a collection of elements via TVirtualCollectionProxy.
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
RCollectionIterableOnce::RIteratorFuncs fIFuncsRead
Two sets of functions to operate on iterators, to be used depending on the access type.
std::unique_ptr< TVirtualCollectionProxy > fProxy
RProxiedCollectionField(RProxiedCollectionField &&other)=default
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
~RProxiedCollectionField() override=default
RCollectionIterableOnce::RIteratorFuncs fIFuncsWrite
size_t GetAlignment() const override
As a rule of thumb, the alignment is equal to the size of the type.
size_t GetValueSize() const override
The number of bytes taken by a value of the appropriate type.
RProxiedCollectionField & operator=(RProxiedCollectionField &&other)=default
The type-erased field for a RVec<Type>
RRVecField(RRVecField &&)=default
~RRVecField() override=default
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
RRVecField(const RRVecField &)=delete
RRVecField & operator=(RRVecField &&)=default
RRVecField & operator=(RRVecField &)=delete
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
The field for an untyped record.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::vector< std::size_t > fOffsets
RRecordField(RRecordField &&other)=default
RRecordField(std::string_view fieldName, std::array< std::unique_ptr< Detail::RFieldBase >, N > &&itemFields, const std::array< std::size_t, N > &offsets, std::string_view typeName="")
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
~RRecordField() override=default
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
The class is used as a return type for operations that can fail; wraps a value of type T or an RError...
The generic field for a std::set<Type>
RSetField(RSetField &&other)=default
RSetField & operator=(RSetField &&other)=default
size_t GetAlignment() const override
As a rule of thumb, the alignment is equal to the size of the type.
~RSetField() override=default
The generic field for std::tuple<Ts...> types.
static std::string GetTypeList(const std::vector< std::unique_ptr< Detail::RFieldBase > > &itemFields)
RTupleField & operator=(RTupleField &&other)=default
~RTupleField() override=default
RTupleField(RTupleField &&other)=default
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void GenerateValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Gener...
The generic field for std::variant types.
std::vector< ClusterSize_t::ValueType > fNWritten
The generic field for a (nested) std::vector<Type> except for std::vector<bool>
~RVectorField() override=default
size_t GetValueSize() const override
The number of bytes taken by a value of the appropriate type.
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
void CommitClusterImpl() final
RVectorField(RVectorField &&other)=default
A "std::vector"-like collection of values implementing handy operation to analyse them.
TClass instances represent classes, structs and namespaces in the ROOT type system.
The TEnum class implements the enum type.
Defines a common interface to inspect/change the contents of an object that represents a collection.
void(* CreateIterators_t)(void *collection, void **begin_arena, void **end_arena, TVirtualCollectionProxy *proxy)
*begin_arena and *end_arena should contain the location of a memory arena of size fgIteratorArenaSize...
void *(* Next_t)(void *iter, const void *end)
iter and end should be pointers to an iterator to be incremented and an iterator that points to the e...
void(* DeleteTwoIterators_t)(void *begin, void *end)
static const Int_t fgIteratorArenaSize
The size of a small buffer that can be allocated on the stack to store iterator-specific information.
RooCmdArg Index(RooCategory &icat)
auto Map(Args &&... args)
Create new collection applying a callable to the elements of the input collection.
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.
constexpr DescriptorId_t kInvalidDescriptorId
std::string GetDemangledTypeName(const std::type_info &t)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Input parameter to ReadBulk() and ReadBulkImpl(). See RBulk class for more information.
bool * fMaskAvail
A bool array of size fCount, indicating the valid values in fValues.
std::vector< unsigned char > * fAuxData
Reference to memory owned by the RBulk class.
const bool * fMaskReq
A bool array of size fCount, indicating the required values in the requested range.
void * fValues
The destination area, which has to be a big enough array of valid objects of the correct type.
RClusterIndex fFirstIndex
Start of the bulk range.
static const std::size_t kAllSet
As a return value of ReadBulk and ReadBulkImpl(), indicates that the full bulk range was read indepen...
std::size_t fCount
Size of the bulk range.
Position(FieldPtr_t fieldPtr, int idxInParent)
std::conditional_t< IsConstT, const RFieldBase *, RFieldBase * > FieldPtr_t
The point here is that we can only tell at run time if a class has an associated collection proxy.
Wrap the integer in a struct in order to avoid template specialization clash with std::uint32_t.
Helper types to present an offset column as array of collection sizes.
TVirtualCollectionProxy::Next_t fNext
TVirtualCollectionProxy::DeleteTwoIterators_t fDeleteTwoIterators
TVirtualCollectionProxy::CreateIterators_t fCreateIterators