48namespace Experimental {
60 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
80 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final
118 void operator()(
void *objPtr,
bool dtorOnly)
final;
128 RClassField(std::string_view fieldName, std::string_view className,
TClass *classp);
135 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
138 std::unique_ptr<RDeleter>
GetDeleter() const final {
return std::make_unique<RClassDeleter>(
fClass); }
140 std::size_t
AppendImpl(
const void *from)
final;
146 RClassField(std::string_view fieldName, std::string_view className);
156 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
168 void operator()(
void *objPtr,
bool dtorOnly)
final;
181 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
190 std::size_t
AppendImpl(
const void *from)
final;
200 RStreamerField(std::string_view fieldName, std::string_view className, std::string_view typeAlias = "");
209 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
215 REnumField(std::string_view fieldName, std::string_view enumName,
TEnum *enump);
216 REnumField(std::string_view fieldName, std::string_view enumName, std::unique_ptr<RFieldBase> intField);
219 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
228 REnumField(std::string_view fieldName, std::string_view enumName);
240template <
typename T,
typename =
void>
246 static_assert(std::is_class_v<T>,
"no I/O support for this basic C++ type");
274 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
278 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
287 const RColumnRepresentations &GetColumnRepresentations() const final;
289 void GenerateColumns() final {
throw RException(
R__FAIL(
"Cardinality fields must only be used for reading")); }
315 fTraits |= kTraitTrivialType;
344namespace Experimental {
346template <
typename SizeT>
349 std::unique_ptr<ROOT::Experimental::RFieldBase>
CloneImpl(std::string_view newName)
const final
351 return std::make_unique<RField<RNTupleCardinality<SizeT>>>(newName);
370 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &
size);
379 fPrincipalColumn->GetCollectionInfo(clusterIndex, &collectionStart, &
size);
387 fPrincipalColumn->GetCollectionInfo(bulkSpec.fFirstIndex, &collectionStart, &collectionSize);
390 typedValues[0] = collectionSize;
392 auto lastOffset = collectionStart.
GetIndex() + collectionSize;
394 std::size_t nEntries = 1;
395 while (nRemainingEntries > 0) {
397 auto offsets = fPrincipalColumn->MapV<
ClusterSize_t>(bulkSpec.fFirstIndex + nEntries, nItemsUntilPageEnd);
398 std::size_t nBatch = std::min(nRemainingEntries, nItemsUntilPageEnd);
399 for (std::size_t i = 0; i < nBatch; ++i) {
400 typedValues[nEntries + i] = offsets[i] - lastOffset;
401 lastOffset = offsets[i];
403 nRemainingEntries -= nBatch;
406 return RBulkSpec::kAllSet;
413 static std::size_t GetOffsetOfMember(
const char *
name);
421 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName)
const final;
423 void ConstructValue(
void *where)
const final;
424 std::unique_ptr<RDeleter>
GetDeleter() const final {
return std::make_unique<RTypedDeleter<TObject>>(); }
426 std::size_t AppendImpl(
const void *from)
final;
427 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to)
final;
429 void OnConnectPageSource() final;
432 static std::
string TypeName() {
return "TObject"; }
434 RField(std::string_view fieldName);
440 size_t GetValueSize() const final;
441 size_t GetAlignment() const final;
442 std::uint32_t GetTypeVersion() const final;
443 std::uint32_t GetTypeChecksum() const final;
444 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
457 return std::unique_ptr<T>(
static_cast<T *
>(CreateObjectRawPtr()));
467std::unique_ptr<void, typename RFieldBase::RCreateObjectDeleter<void>::deleter>
468ROOT::Experimental::RFieldBase::CreateObject<void>()
const;
#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
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
TRObject operator()(const T1 &t1) const
Binding & operator=(OUT(*fun)(void))
Abstract base class for classes implementing the visitor design pattern.
std::map< Int_t, TVirtualStreamerInfo * > StreamerInfoMap_t
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
RCardinalityField & operator=(RCardinalityField &&other)=default
~RCardinalityField() override=default
void GetCollectionInfo(RClusterIndex clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *size)
RCardinalityField(RCardinalityField &&other)=default
RCardinalityField(std::string_view fieldName, std::string_view typeName)
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *size)
void operator()(void *objPtr, bool dtorOnly) final
RClassDeleter(TClass *cl)
The field for a class with dictionary.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void ReadInClusterImpl(RClusterIndex clusterIndex, void *to) final
static constexpr const char * kPrefixInherited
Prefix used in the subfield names generated for base classes.
void Attach(std::unique_ptr< RFieldBase > child, RSubFieldInfo info)
void OnConnectPageSource() final
Called by ConnectPageSource() once connected; derived classes may override this as appropriate.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
std::uint32_t GetTypeChecksum() const final
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
void AddReadCallbacksFromIORules(const std::span< const TSchemaRule * > rules, TClass *classp=nullptr)
Register post-read callbacks corresponding to a list of ROOT I/O customization rules.
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
std::uint32_t GetTypeVersion() const final
Indicates an evolution of the C++ type itself.
void AcceptVisitor(Detail::RFieldVisitor &visitor) const final
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given a value for this field.
std::vector< RSubFieldInfo > fSubFieldsInfo
Additional information kept for each entry in fSubFields
std::size_t fMaxAlignment
std::unique_ptr< RDeleter > GetDeleter() const final
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
ClusterSize_t::ValueType GetIndex() const
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 ReadInClusterImpl(RClusterIndex clusterIndex, void *to) final
REnumField(REnumField &&other)=default
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
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 ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
Base class for all ROOT issued exceptions.
Some fields have multiple possible column representations, e.g.
A functor to release the memory acquired by CreateValue (memory and constructor).
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
A field translates read and write calls from/to underlying columns to/from tree values.
virtual void GenerateColumns()
Implementations in derived classes should create the backing columns corresponsing to the field type ...
void Attach(std::unique_ptr< RFieldBase > child)
Add a new subfield to the list of nested fields.
const std::string & GetTypeName() const
static std::size_t CallAppendOn(RFieldBase &other, const void *from)
Allow derived classes to call Append and Read on other (sub) fields.
virtual RExtraTypeInfoDescriptor GetExtraTypeInfo() const
static void CallReadOn(RFieldBase &other, RClusterIndex clusterIndex, void *to)
static void CallConstructValueOn(const RFieldBase &other, void *where)
Allow derived classes to call ConstructValue(void *) and GetDeleter on other (sub) fields.
std::vector< std::unique_ptr< RFieldBase > > fSubFields
Collections and classes own sub fields.
virtual const RColumnRepresentations & GetColumnRepresentations() const
Implementations in derived classes should return a static RColumnRepresentations object.
The container field for an ntuple model, which itself has no physical representation.
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< RFieldBase > CloneImpl(std::string_view newName) const final
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 ConstructValue(void *) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
RField(std::string_view name)
std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final
General implementation of bulk read.
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::unique_ptr< ROOT::Experimental::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RField(RField &&other)=default
void ReadInClusterImpl(RClusterIndex clusterIndex, void *to) final
Get the number of elements of the collection identified by clusterIndex.
void ReadGlobalImpl(NTupleSize_t globalIndex, void *to) final
Get the number of elements of the collection identified by globalIndex.
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
RField & operator=(RField &&other)=default
static std::string TypeName()
std::unique_ptr< RDeleter > GetDeleter() const final
static std::size_t GetOffsetUniqueID()
RField(RField &&other)=default
static std::size_t GetOffsetBits()
RField & operator=(RField &&other)=default
Classes with dictionaries that can be inspected by TClass.
RField(std::string_view name)
RField & operator=(RField &&other)=default
RField(RField &&other)=default
static std::string TypeName()
Used in RFieldBase::Check() to record field creation failures.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
const std::string & GetError() const
RInvalidField(std::string_view name, std::string_view type, std::string_view error)
void ConstructValue(void *) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
std::unique_ptr< 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.
A view for a collection, that can itself generate new ntuple views for its nested fields.
The on-storage meta-data of an ntuple.
T * Map(RClusterIndex clusterIndex)
T * MapV(RClusterIndex clusterIndex, NTupleSize_t &nItems)
RSimpleField & operator=(RSimpleField &&other)=default
T * Map(NTupleSize_t globalIndex)
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void GenerateColumns(const RNTupleDescriptor &desc) override
Implementations in derived classes should create the backing columns corresponsing to the field type ...
~RSimpleField() override=default
T * MapV(NTupleSize_t globalIndex, NTupleSize_t &nItems)
RSimpleField(RSimpleField &&other)=default
RSimpleField(std::string_view name, std::string_view type)
void GenerateColumns() override
Implementations in derived classes should create the backing columns corresponsing to the field type ...
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.
RStreamerFieldDeleter(TClass *cl)
The field for a class using ROOT standard streaming.
void CommitClusterImpl() final
ClusterSize_t fIndex
number of bytes written in the current cluster
bool HasExtraTypeInfo() const final
Internal::RNTupleSerializer::StreamerInfoMap_t fStreamerInfos
streamer info records seen during writing
TClass instances represent classes, structs and namespaces in the ROOT type system.
The TEnum class implements the enum type.
Mother of all ROOT objects.
Abstract Interface class describing Streamer information for one class.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
ENTupleStructure
The fields in the ntuple model tree can carry different structural information about the type system.
std::string GetDemangledTypeName(const std::type_info &t)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Wrap the integer in a struct in order to avoid template specialization clash with std::uint64_t.
Helper types to present an offset column as array of collection sizes.