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;
147 RClassField(std::string_view fieldName, std::string_view className);
157 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
169 void operator()(
void *objPtr,
bool dtorOnly)
final;
182 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
191 std::size_t
AppendImpl(
const void *from)
final;
201 RStreamerField(std::string_view fieldName, std::string_view className, std::string_view typeAlias = "");
210 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
216 REnumField(std::string_view fieldName, std::string_view enumName,
TEnum *enump);
217 REnumField(std::string_view fieldName, std::string_view enumName, std::unique_ptr<RFieldBase> intField);
220 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view newName)
const final;
229 REnumField(std::string_view fieldName, std::string_view enumName);
241template <
typename T,
typename =
void>
247 static_assert(std::is_class_v<T>,
"no I/O support for this basic C++ type");
275 fPrincipalColumn->GetCollectionInfo(globalIndex, collectionStart,
size);
279 fPrincipalColumn->GetCollectionInfo(clusterIndex, collectionStart,
size);
288 const RColumnRepresentations &GetColumnRepresentations() const final;
290 void GenerateColumns() final {
throw RException(
R__FAIL(
"Cardinality fields must only be used for reading")); }
316 fTraits |= kTraitTrivialType;
345namespace Experimental {
347template <
typename SizeT>
350 std::unique_ptr<ROOT::Experimental::RFieldBase>
CloneImpl(std::string_view newName)
const final
352 return std::make_unique<RField<RNTupleCardinality<SizeT>>>(newName);
371 fPrincipalColumn->GetCollectionInfo(globalIndex, &collectionStart, &
size);
380 fPrincipalColumn->GetCollectionInfo(clusterIndex, &collectionStart, &
size);
388 fPrincipalColumn->GetCollectionInfo(bulkSpec.fFirstIndex, &collectionStart, &collectionSize);
391 typedValues[0] = collectionSize;
393 auto lastOffset = collectionStart.
GetIndex() + collectionSize;
395 std::size_t nEntries = 1;
396 while (nRemainingEntries > 0) {
400 std::size_t nBatch = std::min(nRemainingEntries, nItemsUntilPageEnd);
401 for (std::size_t i = 0; i < nBatch; ++i) {
402 typedValues[nEntries + i] = offsets[i] - lastOffset;
403 lastOffset = offsets[i];
405 nRemainingEntries -= nBatch;
408 return RBulkSpec::kAllSet;
415 static std::size_t GetOffsetOfMember(
const char *
name);
423 std::unique_ptr<RFieldBase> CloneImpl(std::string_view newName)
const final;
425 void ConstructValue(
void *where)
const final;
426 std::unique_ptr<RDeleter>
GetDeleter() const final {
return std::make_unique<RTypedDeleter<TObject>>(); }
428 std::size_t AppendImpl(
const void *from)
final;
429 void ReadGlobalImpl(
NTupleSize_t globalIndex,
void *to)
final;
431 void OnConnectPageSource() final;
434 static std::
string TypeName() {
return "TObject"; }
436 RField(std::string_view fieldName);
442 size_t GetValueSize() const final;
443 size_t GetAlignment() const final;
444 std::uint32_t GetTypeVersion() const final;
445 std::uint32_t GetTypeChecksum() const final;
446 void AcceptVisitor(Detail::RFieldVisitor &visitor) const final;
459 return std::unique_ptr<T>(
static_cast<T *
>(CreateObjectRawPtr()));
469std::unique_ptr<void, typename RFieldBase::RCreateObjectDeleter<void>::deleter>
470ROOT::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.
The in-memory representation of a 32bit or 64bit on-disk index column.
std::map< Int_t, TVirtualStreamerInfo * > StreamerInfoMap_t
Abstract interface to read data from an ntuple.
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
RCardinalityField & operator=(RCardinalityField &&other)=default
~RCardinalityField() override=default
RCardinalityField(RCardinalityField &&other)=default
void GetCollectionInfo(RClusterIndex clusterIndex, RClusterIndex *collectionStart, NTupleSize_t *size)
RCardinalityField(std::string_view fieldName, std::string_view typeName)
void GetCollectionInfo(NTupleSize_t globalIndex, RClusterIndex *collectionStart, NTupleSize_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 BeforeConnectPageSource(Internal::RPageSource &pageSource) final
Called by ConnectPageSource() before connecting; derived classes may override this as appropriate.
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...
NTupleSize_t 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...
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
friend class ROOT::Experimental::RClassField
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
bool HasExtraTypeInfo() const final
Internal::RColumnIndex fIndex
number of bytes written in the current cluster
Internal::RNTupleSerializer::StreamerInfoMap_t fStreamerInfos
streamer info records seen during writing
Base class for all ROOT issued exceptions.
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...
Helper types to present an offset column as array of collection sizes.