39#if __cplusplus >= 201703L
48namespace Experimental {
50class RCollectionField;
51class RCollectionNTupleWriter;
113 virtual std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const = 0;
165 std::size_t nRepetitions = 0);
173 std::unique_ptr<RFieldBase>
Clone(std::string_view newName)
const;
233 void Attach(std::unique_ptr<Detail::RFieldBase> child);
260 RSchemaIterator
begin();
261 RSchemaIterator
end();
273 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const;
310 RClassField(std::string_view fieldName, std::string_view className,
TClass *classp);
314 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
320 RClassField(std::string_view fieldName, std::string_view className);
344 std::size_t
GetItemPadding(std::size_t baseOffset, std::size_t itemAlignment)
const;
347 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
353 RRecordField(std::string_view fieldName, std::vector<std::unique_ptr<Detail::RFieldBase>> &itemFields);
377 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
382 RVectorField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField);
394 size_t GetValueSize()
const override {
return sizeof(std::vector<char>); }
395 size_t GetAlignment() const final {
return std::alignment_of<std::vector<char>>(); }
397 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
414 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final;
420 RArrayField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField, std::size_t arrayLength);
438#if __cplusplus >= 201703L
440class RVariantField :
public Detail::RFieldBase {
442 size_t fMaxItemSize = 0;
443 size_t fMaxAlignment = 1;
445 size_t fTagOffset = 0;
446 std::vector<ClusterSize_t::ValueType> fNWritten;
448 static std::string GetTypeList(
const std::vector<Detail::RFieldBase *> &itemFields);
450 std::uint32_t GetTag(
void *variantPtr)
const;
451 void SetTag(
void *variantPtr, std::uint32_t tag)
const;
454 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
455 std::size_t AppendImpl(
const Detail::RFieldValue& value)
final;
456 void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value)
final;
460 RVariantField(std::string_view fieldName,
const std::vector<Detail::RFieldBase *> &itemFields);
461 RVariantField(RVariantField &&other) =
default;
462 RVariantField&
operator =(RVariantField &&other) =
default;
463 ~RVariantField() =
default;
465 void GenerateColumnsImpl() final;
466 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
468 Detail::
RFieldValue GenerateValue(
void *where) override;
469 void DestroyValue(const Detail::
RFieldValue &value,
bool dtorOnly = false) final;
470 Detail::
RFieldValue CaptureValue(
void *where) final;
471 size_t GetValueSize() const final;
472 size_t GetAlignment() const final {
return fMaxAlignment; }
473 void CommitCluster() final;
479template <
typename T,
typename=
void>
484 static_assert(std::is_class<T>::value,
"no I/O support for this basic C++ type");
490 using Detail::RFieldBase::GenerateValue;
491 template <
typename... ArgsT>
506 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final;
510 std::shared_ptr<RCollectionNTupleWriter> collectionNTuple,
511 std::unique_ptr<RNTupleModel> collectionModel);
516 void GenerateColumnsImpl() final;
530 void CommitCluster() final;
540 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
541 return std::make_unique<RField>(newName);
545 static std::string
TypeName() {
return "ROOT::Experimental::ClusterSize_t"; }
562 return fPrincipalColumn->MapV<
ClusterSize_t>(globalIndex, nItems);
565 return fPrincipalColumn->MapV<
ClusterSize_t>(clusterIndex, nItems);
568 using Detail::RFieldBase::GenerateValue;
569 template <
typename... ArgsT>
574 this,
static_cast<ClusterSize_t*
>(where), std::forward<ArgsT>(args)...);
585 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
588 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
597 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
598 return std::make_unique<RField>(newName);
609 void GenerateColumnsImpl() final;
613 return fPrincipalColumn->Map<
bool>(globalIndex);
616 return fPrincipalColumn->Map<
bool>(clusterIndex);
619 return fPrincipalColumn->MapV<
bool>(globalIndex, nItems);
622 return fPrincipalColumn->MapV<
bool>(clusterIndex, nItems);
625 using Detail::RFieldBase::GenerateValue;
626 template <
typename... ArgsT>
631 this,
static_cast<bool*
>(where), std::forward<ArgsT>(args)...);
645 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
646 return std::make_unique<RField>(newName);
657 void GenerateColumnsImpl() final;
661 return fPrincipalColumn->Map<
float>(globalIndex);
664 return fPrincipalColumn->Map<
float>(clusterIndex);
667 return fPrincipalColumn->MapV<
float>(globalIndex, nItems);
670 return fPrincipalColumn->MapV<
float>(clusterIndex, nItems);
673 using Detail::RFieldBase::GenerateValue;
674 template <
typename... ArgsT>
679 this,
static_cast<float*
>(where), std::forward<ArgsT>(args)...);
694 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
695 return std::make_unique<RField>(newName);
706 void GenerateColumnsImpl() final;
710 return fPrincipalColumn->Map<
double>(globalIndex);
713 return fPrincipalColumn->Map<
double>(clusterIndex);
716 return fPrincipalColumn->MapV<
double>(globalIndex, nItems);
719 return fPrincipalColumn->MapV<
double>(clusterIndex, nItems);
722 using Detail::RFieldBase::GenerateValue;
723 template <
typename... ArgsT>
728 this,
static_cast<double*
>(where), std::forward<ArgsT>(args)...);
742 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
743 return std::make_unique<RField>(newName);
754 void GenerateColumnsImpl() final;
758 return fPrincipalColumn->Map<
char>(globalIndex);
761 return fPrincipalColumn->Map<
char>(clusterIndex);
764 return fPrincipalColumn->MapV<
char>(globalIndex, nItems);
767 return fPrincipalColumn->MapV<
char>(clusterIndex, nItems);
770 using Detail::RFieldBase::GenerateValue;
771 template <
typename... ArgsT>
776 this,
static_cast<char*
>(where), std::forward<ArgsT>(args)...);
788class RField<std::int8_t> :
public Detail::RFieldBase {
790 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
791 return std::make_unique<RField>(newName);
795 static std::string TypeName() {
return "std::int8_t"; }
802 void GenerateColumnsImpl() final;
803 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
805 std::int8_t *Map(NTupleSize_t globalIndex) {
806 return fPrincipalColumn->Map<std::int8_t>(globalIndex);
808 std::int8_t *
Map(
const RClusterIndex &clusterIndex) {
809 return fPrincipalColumn->Map<std::int8_t>(clusterIndex);
811 std::int8_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
812 return fPrincipalColumn->MapV<std::int8_t>(globalIndex, nItems);
814 std::int8_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
815 return fPrincipalColumn->MapV<std::int8_t>(clusterIndex, nItems);
818 using Detail::RFieldBase::GenerateValue;
819 template <
typename... ArgsT>
822 return Detail::RFieldValue(
823 Detail::RColumnElement<std::int8_t>(
static_cast<std::int8_t*
>(where)),
824 this,
static_cast<std::int8_t*
>(where), std::forward<ArgsT>(args)...);
827 Detail::RFieldValue CaptureValue(
void *where)
final {
828 return Detail::RFieldValue(
true ,
829 Detail::RColumnElement<std::int8_t>(
static_cast<std::int8_t*
>(where)),
this, where);
831 size_t GetValueSize() const final {
return sizeof(std::int8_t); }
832 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
838 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
839 return std::make_unique<RField>(newName);
843 static std::string TypeName() {
return "std::uint8_t"; }
850 void GenerateColumnsImpl() final;
851 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
853 std::
uint8_t *Map(NTupleSize_t globalIndex) {
854 return fPrincipalColumn->Map<std::uint8_t>(globalIndex);
856 std::uint8_t *
Map(
const RClusterIndex &clusterIndex) {
857 return fPrincipalColumn->Map<std::uint8_t>(clusterIndex);
859 std::uint8_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
860 return fPrincipalColumn->MapV<std::uint8_t>(globalIndex, nItems);
862 std::uint8_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
863 return fPrincipalColumn->MapV<std::uint8_t>(clusterIndex, nItems);
866 using Detail::RFieldBase::GenerateValue;
867 template <
typename... ArgsT>
870 return Detail::RFieldValue(
871 Detail::RColumnElement<std::uint8_t>(
static_cast<std::uint8_t*
>(where)),
872 this,
static_cast<std::uint8_t*
>(where), std::forward<ArgsT>(args)...);
875 Detail::RFieldValue CaptureValue(
void *where)
final {
876 return Detail::RFieldValue(
true ,
877 Detail::RColumnElement<std::uint8_t>(
static_cast<std::uint8_t*
>(where)),
this, where);
879 size_t GetValueSize() const final {
return sizeof(std::uint8_t); }
880 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
884class RField<std::int16_t> :
public Detail::RFieldBase {
886 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
887 return std::make_unique<RField>(newName);
891 static std::string TypeName() {
return "std::int16_t"; }
898 void GenerateColumnsImpl() final;
899 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
901 std::int16_t *Map(NTupleSize_t globalIndex) {
902 return fPrincipalColumn->Map<std::int16_t>(globalIndex);
904 std::int16_t *
Map(
const RClusterIndex &clusterIndex) {
905 return fPrincipalColumn->Map<std::int16_t>(clusterIndex);
907 std::int16_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
908 return fPrincipalColumn->MapV<std::int16_t>(globalIndex, nItems);
910 std::int16_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
911 return fPrincipalColumn->MapV<std::int16_t>(clusterIndex, nItems);
914 using Detail::RFieldBase::GenerateValue;
915 template <
typename... ArgsT>
918 return Detail::RFieldValue(
919 Detail::RColumnElement<std::int16_t>(
static_cast<std::int16_t*
>(where)),
920 this,
static_cast<std::int16_t*
>(where), std::forward<ArgsT>(args)...);
923 Detail::RFieldValue CaptureValue(
void *where)
final {
924 return Detail::RFieldValue(
true ,
925 Detail::RColumnElement<std::int16_t>(
static_cast<std::int16_t*
>(where)),
this, where);
927 size_t GetValueSize() const final {
return sizeof(std::int16_t); }
928 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
932class RField<std::uint16_t> :
public Detail::RFieldBase {
934 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
935 return std::make_unique<RField>(newName);
939 static std::string TypeName() {
return "std::uint16_t"; }
946 void GenerateColumnsImpl() final;
947 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
949 std::uint16_t *Map(NTupleSize_t globalIndex) {
950 return fPrincipalColumn->Map<std::uint16_t>(globalIndex);
952 std::uint16_t *
Map(
const RClusterIndex &clusterIndex) {
953 return fPrincipalColumn->Map<std::uint16_t>(clusterIndex);
955 std::uint16_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
956 return fPrincipalColumn->MapV<std::uint16_t>(globalIndex, nItems);
958 std::uint16_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
959 return fPrincipalColumn->MapV<std::uint16_t>(clusterIndex, nItems);
962 using Detail::RFieldBase::GenerateValue;
963 template <
typename... ArgsT>
966 return Detail::RFieldValue(
967 Detail::RColumnElement<std::uint16_t>(
static_cast<std::uint16_t*
>(where)),
968 this,
static_cast<std::uint16_t*
>(where), std::forward<ArgsT>(args)...);
971 Detail::RFieldValue CaptureValue(
void *where)
final {
972 return Detail::RFieldValue(
true ,
973 Detail::RColumnElement<std::uint16_t>(
static_cast<std::uint16_t*
>(where)),
this, where);
975 size_t GetValueSize() const final {
return sizeof(std::uint16_t); }
976 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
980class RField<std::int32_t> :
public Detail::RFieldBase {
982 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
983 return std::make_unique<RField>(newName);
987 static std::string TypeName() {
return "std::int32_t"; }
994 void GenerateColumnsImpl() final;
995 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
997 std::int32_t *Map(NTupleSize_t globalIndex) {
998 return fPrincipalColumn->Map<std::int32_t>(globalIndex);
1000 std::int32_t *
Map(
const RClusterIndex &clusterIndex) {
1001 return fPrincipalColumn->Map<std::int32_t>(clusterIndex);
1003 std::int32_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1004 return fPrincipalColumn->MapV<std::int32_t>(globalIndex, nItems);
1006 std::int32_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1007 return fPrincipalColumn->MapV<std::int32_t>(clusterIndex, nItems);
1010 using Detail::RFieldBase::GenerateValue;
1011 template <
typename... ArgsT>
1014 return Detail::RFieldValue(
1015 Detail::RColumnElement<std::int32_t>(
static_cast<std::int32_t*
>(where)),
1016 this,
static_cast<std::int32_t*
>(where), std::forward<ArgsT>(args)...);
1019 Detail::RFieldValue CaptureValue(
void *where)
final {
1020 return Detail::RFieldValue(
true ,
1021 Detail::RColumnElement<std::int32_t>(
static_cast<std::int32_t*
>(where)),
this, where);
1023 size_t GetValueSize() const final {
return sizeof(std::int32_t); }
1024 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1028class RField<std::uint32_t> :
public Detail::RFieldBase {
1030 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1031 return std::make_unique<RField>(newName);
1035 static std::string TypeName() {
return "std::uint32_t"; }
1042 void GenerateColumnsImpl() final;
1043 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1045 std::uint32_t *Map(NTupleSize_t globalIndex) {
1046 return fPrincipalColumn->Map<std::uint32_t>(globalIndex);
1048 std::uint32_t *
Map(
const RClusterIndex clusterIndex) {
1049 return fPrincipalColumn->Map<std::uint32_t>(clusterIndex);
1051 std::uint32_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1052 return fPrincipalColumn->MapV<std::uint32_t>(globalIndex, nItems);
1054 std::uint32_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1055 return fPrincipalColumn->MapV<std::uint32_t>(clusterIndex, nItems);
1058 using Detail::RFieldBase::GenerateValue;
1059 template <
typename... ArgsT>
1062 return Detail::RFieldValue(
1063 Detail::RColumnElement<std::uint32_t>(
static_cast<std::uint32_t*
>(where)),
1064 this,
static_cast<std::uint32_t*
>(where), std::forward<ArgsT>(args)...);
1067 Detail::RFieldValue CaptureValue(
void *where)
final {
1068 return Detail::RFieldValue(
true ,
1069 Detail::RColumnElement<std::uint32_t>(
static_cast<std::uint32_t*
>(where)),
this, where);
1071 size_t GetValueSize() const final {
return sizeof(std::uint32_t); }
1072 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1076class RField<std::uint64_t> :
public Detail::RFieldBase {
1078 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1079 return std::make_unique<RField>(newName);
1083 static std::string TypeName() {
return "std::uint64_t"; }
1090 void GenerateColumnsImpl() final;
1091 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1093 std::uint64_t *Map(NTupleSize_t globalIndex) {
1094 return fPrincipalColumn->Map<std::uint64_t>(globalIndex);
1096 std::uint64_t *
Map(
const RClusterIndex &clusterIndex) {
1097 return fPrincipalColumn->Map<std::uint64_t>(clusterIndex);
1099 std::uint64_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1100 return fPrincipalColumn->MapV<std::uint64_t>(globalIndex, nItems);
1102 std::uint64_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1103 return fPrincipalColumn->MapV<std::uint64_t>(clusterIndex, nItems);
1106 using Detail::RFieldBase::GenerateValue;
1107 template <
typename... ArgsT>
1110 return Detail::RFieldValue(
1111 Detail::RColumnElement<std::uint64_t>(
static_cast<std::uint64_t*
>(where)),
1112 this,
static_cast<std::uint64_t*
>(where), std::forward<ArgsT>(args)...);
1115 Detail::RFieldValue CaptureValue(
void *where)
final {
1116 return Detail::RFieldValue(
true ,
1117 Detail::RColumnElement<std::uint64_t>(
static_cast<std::uint64_t*
>(where)),
this, where);
1119 size_t GetValueSize() const final {
return sizeof(std::uint64_t); }
1120 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1124class RField<std::int64_t> :
public Detail::RFieldBase {
1126 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1127 return std::make_unique<RField>(newName);
1131 static std::string TypeName() {
return "std::int64_t"; }
1138 void GenerateColumnsImpl() final;
1139 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1141 std::int64_t *Map(NTupleSize_t globalIndex) {
1142 return fPrincipalColumn->Map<std::int64_t>(globalIndex);
1144 std::int64_t *
Map(
const RClusterIndex &clusterIndex) {
1145 return fPrincipalColumn->Map<std::int64_t>(clusterIndex);
1147 std::int64_t *MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems) {
1148 return fPrincipalColumn->MapV<std::int64_t>(globalIndex, nItems);
1150 std::int64_t *MapV(
const RClusterIndex &clusterIndex, NTupleSize_t &nItems) {
1151 return fPrincipalColumn->MapV<std::int64_t>(clusterIndex, nItems);
1154 using Detail::RFieldBase::GenerateValue;
1155 template <
typename... ArgsT>
1158 return Detail::RFieldValue(
1159 Detail::RColumnElement<std::int64_t>(
static_cast<std::int64_t*
>(where)),
1160 this,
static_cast<std::int64_t*
>(where), std::forward<ArgsT>(args)...);
1163 Detail::RFieldValue CaptureValue(
void *where)
final {
1164 return Detail::RFieldValue(
true ,
1165 Detail::RColumnElement<std::int64_t>(
static_cast<std::int64_t*
>(where)),
this, where);
1167 size_t GetValueSize() const final {
return sizeof(std::int64_t); }
1168 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1172class RField<std::string> :
public Detail::RFieldBase {
1175 Detail::RColumnElement<ClusterSize_t, EColumnType::kIndex> fElemIndex;
1177 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1178 return std::make_unique<RField>(newName);
1185 static std::string TypeName() {
return "std::string"; }
1188 , fIndex(0), fElemIndex(&fIndex) {}
1193 void GenerateColumnsImpl() final;
1194 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1197 template <typename... ArgsT>
1198 ROOT::Experimental::Detail::
RFieldValue GenerateValue(
void* where, ArgsT&&... args)
1200 return Detail::RFieldValue(
this,
static_cast<std::string*
>(where), std::forward<ArgsT>(args)...);
1203 void DestroyValue(
const Detail::RFieldValue& value,
bool dtorOnly =
false) {
1204 auto str = value.Get<std::string>();
1205 str->~basic_string();
1209 Detail::RFieldValue CaptureValue(
void *where) {
1210 return Detail::RFieldValue(
true ,
this, where);
1212 size_t GetValueSize() const final {
return sizeof(std::string); }
1213 size_t GetAlignment() const final {
return std::alignment_of<std::string>(); }
1214 void CommitCluster() final;
1215 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
1219template <typename ItemT, std::
size_t N>
1220class
RField<std::array<ItemT,
N>> : public RArrayField {
1221 using ContainerT =
typename std::array<ItemT, N>;
1223 static std::string TypeName() {
1227 : RArrayField(
name, std::make_unique<
RField<ItemT>>(
RField<ItemT>::TypeName()),
N)
1233 using Detail::RFieldBase::GenerateValue;
1234 template <
typename... ArgsT>
1237 return Detail::RFieldValue(
this,
static_cast<ContainerT*
>(where), std::forward<ArgsT>(args)...);
1240 return GenerateValue(where, ContainerT());
1245#if __cplusplus >= 201703L
1246template <
typename... ItemTs>
1247class RField<std::variant<ItemTs...>> :
public RVariantField {
1248 using ContainerT =
typename std::variant<ItemTs...>;
1250 template <
typename HeadT,
typename... TailTs>
1251 static std::string BuildItemTypes()
1254 if constexpr(
sizeof...(TailTs) > 0)
1255 result +=
"," + BuildItemTypes<TailTs...>();
1259 template <
typename HeadT,
typename... TailTs>
1260 static std::vector<Detail::RFieldBase *> BuildItemFields(
unsigned int index = 0)
1262 std::vector<Detail::RFieldBase *> result;
1263 result.emplace_back(
new RField<HeadT>(
"_" + std::to_string(index)));
1264 if constexpr(
sizeof...(TailTs) > 0) {
1265 auto tailFields = BuildItemFields<TailTs...>(index + 1);
1266 result.insert(result.end(), tailFields.begin(), tailFields.end());
1272 static std::string TypeName() {
return "std::variant<" + BuildItemTypes<ItemTs...>() +
">"; }
1273 explicit RField(std::string_view
name) : RVariantField(
name, BuildItemFields<ItemTs...>()) {}
1278 using Detail::RFieldBase::GenerateValue;
1279 template <
typename... ArgsT>
1282 return Detail::RFieldValue(
this,
static_cast<ContainerT*
>(where), std::forward<ArgsT>(args)...);
1285 return GenerateValue(where, ContainerT());
1290template <
typename ItemT>
1291class RField<std::vector<ItemT>> :
public RVectorField {
1292 using ContainerT =
typename std::vector<ItemT>;
1296 : RVectorField(
name, std::make_unique<
RField<ItemT>>(
"_0"))
1302 using Detail::RFieldBase::GenerateValue;
1303 template <
typename... ArgsT>
1306 return Detail::RFieldValue(
this,
static_cast<ContainerT*
>(where), std::forward<ArgsT>(args)...);
1309 return GenerateValue(where, ContainerT());
1311 Detail::RFieldValue CaptureValue(
void *where)
final {
1312 return Detail::RFieldValue(
true ,
this, where);
1314 size_t GetValueSize() const final {
return sizeof(ContainerT); }
1319class RField<std::vector<bool>> :
public Detail::RFieldBase {
1324 std::unique_ptr<Detail::RFieldBase> CloneImpl(std::string_view newName)
const final {
1325 return std::make_unique<RField>(newName);
1327 std::size_t AppendImpl(
const Detail::RFieldValue& value)
final;
1328 void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value)
final;
1329 void GenerateColumnsImpl() final;
1330 void GenerateColumnsImpl(const RNTupleDescriptor &desc) final;
1333 static std::
string TypeName() {
return "std::vector<bool>"; }
1339 using Detail::RFieldBase::GenerateValue;
1340 template <
typename... ArgsT>
1343 return Detail::RFieldValue(
this,
static_cast<std::vector<bool>*
>(where), std::forward<ArgsT>(args)...);
1346 return GenerateValue(where, std::vector<bool>());
1348 Detail::RFieldValue CaptureValue(
void *where)
final {
1349 return Detail::RFieldValue(
true ,
this, where);
1351 std::vector<Detail::RFieldValue> SplitValue(
const Detail::RFieldValue &value)
const final;
1352 void DestroyValue(
const Detail::RFieldValue& value,
bool dtorOnly =
false) final;
1354 size_t GetValueSize() const final {
return sizeof(std::vector<bool>); }
1355 size_t GetAlignment() const final {
return std::alignment_of<std::vector<bool>>(); }
1356 void CommitCluster() final { fNWritten = 0; }
1357 void AcceptVisitor(Detail::RFieldVisitor &visitor)
const final;
1358 void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *
size)
const {
1359 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
1361 void GetCollectionInfo(
const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *
size)
const
1363 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
1372template <
typename ItemT>
1380 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1381 auto newItemField = fSubFields[0]->Clone(fSubFields[0]->GetName());
1382 return std::make_unique<RField<ROOT::VecOps::RVec<ItemT>>>(newName, std::move(newItemField));
1387 auto count = typedValue->size();
1388 for (
unsigned i = 0; i < count; ++i) {
1389 auto itemValue = fSubFields[0]->CaptureValue(&typedValue->data()[i]);
1390 nbytes += fSubFields[0]->Append(itemValue);
1394 fColumns[0]->Append(elemIndex);
1395 return nbytes +
sizeof(elemIndex);
1401 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
1402 typedValue->resize(nItems);
1403 for (
unsigned i = 0; i < nItems; ++i) {
1404 auto itemValue = fSubFields[0]->GenerateValue(&typedValue->data()[i]);
1405 fSubFields[0]->Read(collectionStart + i, &itemValue);
1410 RField(std::string_view fieldName, std::unique_ptr<Detail::RFieldBase> itemField)
1413 , fItemSize(itemField->GetValueSize()), fNWritten(0)
1415 Attach(std::move(itemField));
1427 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
1428 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
1432 GenerateColumnsImpl();
1444 using Detail::RFieldBase::GenerateValue;
1445 template <
typename... ArgsT>
1457 size_t GetAlignment() const final {
return std::alignment_of<ContainerT>(); }
1470 std::unique_ptr<Detail::RFieldBase>
CloneImpl(std::string_view newName)
const final {
1471 return std::make_unique<RField<ROOT::VecOps::RVec<bool>>>(newName);
1475 auto count = typedValue->size();
1476 for (
unsigned i = 0; i < count; ++i) {
1477 bool bval = (*typedValue)[i];
1478 auto itemValue = fSubFields[0]->CaptureValue(&bval);
1479 fSubFields[0]->Append(itemValue);
1483 fColumns[0]->Append(elemIndex);
1484 return count +
sizeof(elemIndex);
1490 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &nItems);
1491 typedValue->resize(nItems);
1492 for (
unsigned i = 0; i < nItems; ++i) {
1493 bool bval = (*typedValue)[i];
1494 auto itemValue = fSubFields[0]->GenerateValue(&bval);
1495 fSubFields[0]->Read(collectionStart + i, &itemValue);
1496 (*typedValue)[i] = bval;
1512 fColumns.emplace_back(std::unique_ptr<Detail::RColumn>(
1513 Detail::RColumn::Create<ClusterSize_t, EColumnType::kIndex>(modelIndex, 0)));
1517 GenerateColumnsImpl();
1527 static std::string
TypeName() {
return "ROOT::VecOps::RVec<bool>"; }
1529 using Detail::RFieldBase::GenerateValue;
1530 template <
typename... ArgsT>
1542 size_t GetAlignment() const final {
return std::alignment_of<ContainerT>(); }
ROOT::Experimental::RField< T > RField
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Binding & operator=(OUT(*fun)(void))
std::size_t GetSize() const
Pairs of C++ type and column type, like float and EColumnType::kReal32.
void Append(const RColumnElementBase &element)
void Read(const NTupleSize_t globalIndex, RColumnElementBase *element)
NTupleSize_t GetGlobalIndex(const RClusterIndex &clusterIndex)
NTupleSize_t GetNElements() const
void GetCollectionInfo(const NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
For offset columns only, look at the two adjacent values that define a collection's coordinates.
Iterates over the sub tree of fields in depth-first search order.
void Advance()
Given that the iterator points to a valid field which is not the end iterator, go to the next field i...
std::vector< Position > fStack
The stack of nodes visited when walking down the tree of fields.
std::ptrdiff_t difference_type
pointer operator->() const
bool operator!=(const iterator &rh) const
reference operator*() const
std::forward_iterator_tag iterator_category
RSchemaIterator(pointer val, int idxInParent)
bool operator==(const iterator &rh) const
RFieldBase * GetParent() const
virtual RFieldValue CaptureValue(void *where)=0
Creates a value from a memory location with an already constructed object.
std::string GetDescription() const
Get the field's description.
void SetOnDiskId(DescriptorId_t id)
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.
std::vector< std::unique_ptr< RFieldBase > > fSubFields
Collections and classes own sub fields.
RFieldBase * fParent
Sub fields point to their mother field.
std::string GetName() const
std::size_t GetNRepetitions() const
std::string fDescription
Free text set by the user.
virtual void DestroyValue(const RFieldValue &value, bool dtorOnly=false)
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
virtual RNTupleVersion GetTypeVersion() const
Indicates an evolution of the C++ type itself.
DescriptorId_t GetOnDiskId() const
void ConnectPageSink(RPageSink &pageSink)
Fields and their columns live in the void until connected to a physical page storage.
ROOT::Experimental::EColumnType EnsureColumnType(const std::vector< EColumnType > &requestedTypes, unsigned int columnIndex, const RNTupleDescriptor &desc)
Throws an exception if the column given by fOnDiskId and the columnIndex in the provided descriptor i...
void Flush() const
Ensure that all received items are written from page buffers to the storage.
virtual void ReadInClusterImpl(const RClusterIndex &clusterIndex, RFieldValue *value)
virtual void CommitCluster()
Perform housekeeping tasks for global to cluster-local index translation.
virtual size_t GetAlignment() const
For many types, the alignment requirement is equal to the size; otherwise override.
virtual std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const =0
Called by Clone(), which additionally copies the on-disk ID.
virtual size_t GetValueSize() const =0
The number of bytes taken by a value of the appropriate type.
void SetDescription(std::string_view description)
virtual std::vector< RFieldValue > SplitValue(const RFieldValue &value) const
Creates the list of direct child values given a value for this field.
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 on a trivial type that maps as-is to a single column.
std::string fType
The C++ type captured by this field.
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName)
Factory method to resurrect a field from the stored on-disk type information.
std::string fName
The field name relative to its parent field.
virtual RNTupleVersion GetFieldVersion() const
Indicates an evolution of the mapping scheme from C++ type to columns.
NTupleSize_t GetNElements() const
void ConnectPageSource(RPageSource &pageSource)
std::size_t Append(const RFieldValue &value)
Write the given value into columns.
virtual std::size_t AppendImpl(const RFieldValue &value)
Operations on values of complex types, e.g.
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 ...
virtual void ReadGlobalImpl(NTupleSize_t globalIndex, RFieldValue *value)
ENTupleStructure fStructure
The role of this field in the data model structure.
void Read(const RClusterIndex &clusterIndex, RFieldValue *value)
std::vector< std::unique_ptr< RColumn > > fColumns
The columns are connected either to a sink or to a source (not to both); they are owned by the field.
void Attach(std::unique_ptr< Detail::RFieldBase > child)
Add a new subfield to the list of nested fields.
std::vector< RFieldBase * > GetSubFields() const
virtual RFieldValue GenerateValue(void *where)=0
Generates a tree value in a given location of size at least GetValueSize().
RFieldBase & operator=(const RFieldBase &)=delete
ENTupleStructure GetStructure() const
void Read(NTupleSize_t globalIndex, RFieldValue *value)
Populate a single value with data from the tree, which needs to be of the fitting type.
RFieldValue GenerateValue()
Generates an object of the field type and allocates new initialized memory according to the type.
RColumn * fPrincipalColumn
Points into fColumns.
RColumnElementBase fMappedElement
For simple types, the mapped element drills through the layers from the C++ data representation to th...
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 available trivial, native content types of a column.
The generic field for fixed size arrays, which do not need an offset column.
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
void ReadInClusterImpl(const RClusterIndex &clusterIndex, Detail::RFieldValue *value) final
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
RArrayField & operator=(RArrayField &&other)=default
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
RArrayField(RArrayField &&other)=default
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
std::size_t AppendImpl(const Detail::RFieldValue &value) 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.
The field for a class with dictionary.
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
static constexpr const char * kPrefixInherited
Prefix used in the subfield names generated for base classes.
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)
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
std::size_t AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
RClassField & operator=(RClassField &&other)=default
void AcceptVisitor(Detail::RFieldVisitor &visitor) const override
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
void ReadInClusterImpl(const RClusterIndex &clusterIndex, Detail::RFieldValue *value) 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
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
RClassField(RClassField &&other)=default
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
The collection field is only used for writing; when reading, untyped collections are projected to an ...
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
static std::string TypeName()
std::shared_ptr< RCollectionNTupleWriter > fCollectionNTuple
Save the link to the collection ntuple in order to reset the offset counter when committing the clust...
~RCollectionField()=default
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
RCollectionField(RCollectionField &&other)=default
Holds the static meta-data of a column in a tree.
A field translates read and write calls from/to underlying columns to/from tree values.
Represents transient storage of simple or complex C++ values.
The container field for an ntuple model, which itself has no physical representation.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const
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.
Detail::RFieldValue GenerateValue(void *)
Generates a tree value in a given location of size at least GetValueSize().
std::unique_ptr< REntry > GenerateEntry() const
Generates managed values for the top-level sub fields.
Detail::RFieldValue CaptureValue(void *) final
Creates a value from a memory location with an already constructed object.
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)
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
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 * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size)
Special help for offset fields.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RField(std::string_view name)
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
std::size_t AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
typename ROOT::VecOps::RVec< ItemT > ContainerT
static std::string TypeName()
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
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
For many types, the alignment requirement is equal to the size; otherwise override.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
void CommitCluster() final
Perform housekeeping tasks for global to cluster-local index translation.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
RField(std::string_view name)
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
std::size_t AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
void CommitCluster() final
Perform housekeeping tasks for global to cluster-local index translation.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
RField(RField &&other)=default
typename ROOT::VecOps::RVec< bool > ContainerT
static std::string TypeName()
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
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.
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)
static std::string TypeName()
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
RField(RField &&other)=default
bool * Map(const RClusterIndex &clusterIndex)
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
char * 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.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
RField(RField &&other)=default
char * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
static std::string TypeName()
char * Map(const RClusterIndex &clusterIndex)
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
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)
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
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.
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
static std::string TypeName()
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
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)
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
float * Map(const RClusterIndex &clusterIndex)
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
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)
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where, ArgsT &&... args)
RField(RField &&other)=default
ROOT::Experimental::Detail::RFieldValue GenerateValue(void *where) final
Generates a tree value in a given location of size at least GetValueSize().
static std::string TypeName()
The on-storage meta-data of an ntuple.
For forward and backward compatibility, attach version information to the consitituents of the file f...
The field for an untyped record.
std::size_t fMaxAlignment
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
RRecordField(RRecordField &&other)=default
std::size_t AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
void GenerateColumnsImpl(const RNTupleDescriptor &) final
Creates the backing columns corresponsing to the field type for reading.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
std::size_t GetItemPadding(std::size_t baseOffset, std::size_t itemAlignment) const
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
Detail::RFieldValue CaptureValue(void *where) final
Creates a value from a memory location with an already constructed object.
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
RRecordField & operator=(RRecordField &&other)=default
void ReadInClusterImpl(const RClusterIndex &clusterIndex, Detail::RFieldValue *value) final
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
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 (nested) std::vector<Type> except for std::vector<bool>
Detail::RFieldValue CaptureValue(void *where) override
Creates a value from a memory location with an already constructed object.
void CommitCluster() final
Perform housekeeping tasks for global to cluster-local index translation.
std::unique_ptr< Detail::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
size_t GetValueSize() const override
The number of bytes taken by a value of the appropriate type.
std::vector< Detail::RFieldValue > SplitValue(const Detail::RFieldValue &value) const final
Creates the list of direct child values given a value for this field.
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
void ReadGlobalImpl(NTupleSize_t globalIndex, Detail::RFieldValue *value) final
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size) const
RVectorField & operator=(RVectorField &&other)=default
void GenerateColumnsImpl() final
Creates the backing columns corresponsing to the field type for writing.
size_t GetAlignment() const final
For many types, the alignment requirement is equal to the size; otherwise override.
void DestroyValue(const Detail::RFieldValue &value, bool dtorOnly=false) final
Releases the resources acquired during GenerateValue (memory and constructor) This implementation wor...
std::size_t AppendImpl(const Detail::RFieldValue &value) final
Operations on values of complex types, e.g.
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.
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 &)
Returns a string with the demangled and normalized name for the given type.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Position(RFieldBase *fieldPtr, int idxInParent)
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...