48class RNTupleCollectionView;
181 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view
newName)
const final;
186 std::size_t
AppendImpl(
const void *from)
final;
226 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view
newName)
const final;
235 std::size_t
AppendImpl(
const void *from)
final;
264 std::unique_ptr<RFieldBase>
CloneImpl(std::string_view
newName)
const final;
285template <
typename T,
typename =
void>
291 static_assert(std::is_class_v<T>,
"no I/O support for this basic C++ type");
332 const RColumnRepresentations &GetColumnRepresentations()
const final;
360 fTraits |= kTraitTrivialType;
395template <
typename SizeT>
400 return std::make_unique<RField<RNTupleCardinality<SizeT>>>(
newName);
439 for (std::size_t i = 0; i <
nBatch; ++i) {
446 return RBulkSpec::kAllSet;
463 static std::size_t GetOffsetOfMember(
const char *
name);
471 std::unique_ptr<RFieldBase> CloneImpl(std::string_view
newName)
const final;
473 void ConstructValue(
void *
where)
const final;
476 std::size_t AppendImpl(
const void *from)
final;
479 void AfterConnectPageSource()
final;
482 static std::
string TypeName() {
return "TObject"; }
507 return std::unique_ptr<T>(
static_cast<T *
>(CreateObjectRawPtr()));
511struct RFieldBase::RCreateObjectDeleter<void> {
517std::unique_ptr<void, typename RFieldBase::RCreateObjectDeleter<void>::deleter>
518ROOT::RFieldBase::CreateObject<void>()
const;
520namespace Experimental {
522using RFieldZero [[deprecated(
"ROOT::Experimental::RFieldZero moved to ROOT::RFieldZero")]] =
ROOT::RFieldZero;
523using RClassField [[deprecated(
"ROOT::Experimental::RClassField moved to ROOT::RClassField")]] =
ROOT::RClassField;
524using REnumField [[deprecated(
"ROOT::Experimental::REnumField moved to ROOT::REnumField")]] =
ROOT::REnumField;
525using RStreamerField [[deprecated(
"ROOT::Experimental::RStreamerField moved to ROOT::RStreamerField")]] =
528using RSimpleField [[deprecated(
"ROOT::Experimental::RSimpleField moved to ROOT::RSimpleField")]] =
530using RInvalidField [[deprecated(
"ROOT::Experimental::RInvalidField moved to ROOT::RInvalidField")]] =
532using RCardinalityField [[deprecated(
"ROOT::Experimental::RCardinalityField moved to ROOT::RCardinalityField")]] =
535using RField [[deprecated(
"ROOT::Experimental::RField moved to ROOT::RField")]] =
ROOT::RField<T>;
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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
Abstract interface to read data from an ntuple.
The in-memory representation of a 32bit or 64bit on-disk index column.
An artificial field that transforms an RNTuple column that contains the offset of collections into co...
RCardinalityField(RCardinalityField &&other)=default
void GetCollectionInfo(ROOT::NTupleSize_t globalIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *size)
RCardinalityField & operator=(RCardinalityField &&other)=default
void GetCollectionInfo(RNTupleLocalIndex localIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *size)
~RCardinalityField() override=default
RCardinalityField(std::string_view fieldName, std::string_view typeName)
void operator()(void *objPtr, bool dtorOnly) final
RClassDeleter(TClass *cl)
The field for a class with dictionary.
void AddReadCallbacksFromIORule(const TSchemaRule *rule)
Register post-read callback corresponding to a ROOT I/O customization rules.
TClass * fStagingClass
The TClass instance that corresponds to the staging area.
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
std::unique_ptr< RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
RClassField(RClassField &&other)=default
std::vector< RSubFieldInfo > fSubfieldsInfo
Additional information kept for each entry in fSubfields
std::size_t fMaxAlignment
std::unique_ptr< unsigned char[]> fStagingArea
The staging area stores inputs to I/O rules according to the offsets given by the streamer info of "T...
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
~RClassField() override=default
RClassField & operator=(RClassField &&other)=default
void BeforeConnectPageSource(ROOT::Experimental::Internal::RPageSource &pageSource) final
Called by ConnectPageSource() before connecting; derived classes may override this as appropriate.
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
void Attach(std::unique_ptr< RFieldBase > child, RSubFieldInfo info)
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
std::vector< const TSchemaRule * > FindRules(const ROOT::RFieldDescriptor *fieldDesc)
Given the on-disk information from the page source, find all the I/O customization rules that apply t...
ROOT::DescriptorId_t LookupMember(const ROOT::RNTupleDescriptor &desc, std::string_view memberName, ROOT::DescriptorId_t classFieldId)
Returns the id of member 'name' in the class field given by 'fieldId', or kInvalidDescriptorId if no ...
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
std::uint32_t GetTypeVersion() const final
Indicates an evolution of the C++ type itself.
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
void PrepareStagingArea(const std::vector< const TSchemaRule * > &rules, const ROOT::RNTupleDescriptor &desc, const ROOT::RFieldDescriptor &classFieldId)
If there are rules with inputs (source members), create the staging area according to the TClass inst...
std::vector< RValue > SplitValue(const RValue &value) const final
Creates the list of direct child values given an existing value for this field.
std::uint32_t GetTypeChecksum() const final
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
std::unique_ptr< RDeleter > GetDeleter() const final
std::unordered_map< std::string, RStagingItem > fStagingItems
Lookup staging items by member name.
static constexpr const char * kPrefixInherited
Prefix used in the subfield names generated for base classes.
void SetStagingClass(const std::string &className, unsigned int classVersion)
Sets fStagingClass according to the given name and version.
The field for an unscoped or scoped enum with dictionary.
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.
~REnumField() override=default
REnumField(REnumField &&other)=default
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
REnumField & operator=(REnumField &&other)=default
std::size_t AppendImpl(const void *from) final
Operations on values of complex types, e.g.
Base class for all ROOT issued exceptions.
The list of column representations a field can have.
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.
void Attach(std::unique_ptr< RFieldBase > child)
Add a new subfield to the list of nested fields.
std::vector< std::unique_ptr< RFieldBase > > fSubfields
Collections and classes own subfields.
virtual const RColumnRepresentations & GetColumnRepresentations() const
Implementations in derived classes should return a static RColumnRepresentations object.
virtual void GenerateColumns()
Implementations in derived classes should create the backing columns corresponding to the field type ...
friend class ROOT::RClassField
static std::size_t CallAppendOn(RFieldBase &other, const void *from)
Allow derived classes to call Append() and Read() on other (sub)fields.
std::uint32_t fTraits
Properties of the type that allow for optimizations of collections of that type.
@ kTraitInvalidField
This field is an instance of RInvalidField and can be safely static_cast to it.
const std::string & GetTypeName() const
static void CallReadOn(RFieldBase &other, RNTupleLocalIndex localIndex, void *to)
static void CallConstructValueOn(const RFieldBase &other, void *where)
Allow derived classes to call ConstructValue(void *) and GetDeleter() on other (sub)fields.
virtual ROOT::RExtraTypeInfoDescriptor GetExtraTypeInfo() const
Metadata stored for every field of an RNTuple.
The container field for an ntuple model, which itself has no physical representation.
void AcceptVisitor(ROOT::Detail::RFieldVisitor &visitor) const final
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...
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.
RField(std::string_view name)
void ReadGlobalImpl(ROOT::NTupleSize_t globalIndex, void *to) final
Get the number of elements of the collection identified by globalIndex.
RField & operator=(RField &&other)=default
std::size_t ReadBulkImpl(const RBulkSpec &bulkSpec) final
General implementation of bulk read.
RField(RField &&other)=default
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
void ReadInClusterImpl(RNTupleLocalIndex localIndex, void *to) final
Get the number of elements of the collection identified by clusterIndex.
std::unique_ptr< ROOT::RFieldBase > CloneImpl(std::string_view newName) const final
Called by Clone(), which additionally copies the on-disk ID.
static std::string TypeName()
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
RField(RField &&other)=default
RField & operator=(RField &&other)=default
std::unique_ptr< RDeleter > GetDeleter() const final
static std::size_t GetOffsetBits()
static std::size_t GetOffsetUniqueID()
Classes with dictionaries that can be inspected by TClass.
RField(RField &&other)=default
RField & operator=(RField &&other)=default
static std::string TypeName()
RField(std::string_view name)
Used in RFieldBase::Check() to record field creation failures.
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.
@ kGeneric
Generic unrecoverable error.
@ kUnknownType
The type given to RFieldBase::Create was unknown.
@ kTypeError
The type given to RFieldBase::Create was invalid.
@ kUnknownStructure
The field could not be created because its descriptor had an unknown structural role.
RCategory GetCategory() const
const std::string & GetError() const
RInvalidField(std::string_view name, std::string_view type, std::string_view error, RCategory category)
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...
A view for a collection, that can itself generate new ntuple views for its nested fields.
The on-storage metadata of an RNTuple.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
void GenerateColumns() override
Implementations in derived classes should create the backing columns corresponding to the field type ...
size_t GetAlignment() const final
As a rule of thumb, the alignment is equal to the size of the type.
RSimpleField & operator=(RSimpleField &&other)=default
RSimpleField(std::string_view name, std::string_view type)
T * Map(RNTupleLocalIndex localIndex)
~RSimpleField() override=default
T * Map(ROOT::NTupleSize_t globalIndex)
size_t GetValueSize() const final
The number of bytes taken by a value of the appropriate type.
RSimpleField(RSimpleField &&other)=default
void ConstructValue(void *where) const final
Constructs value in a given location of size at least GetValueSize(). Called by the base class' Creat...
T * MapV(ROOT::NTupleSize_t globalIndex, ROOT::NTupleSize_t &nItems)
void GenerateColumns(const ROOT::RNTupleDescriptor &desc) override
Implementations in derived classes should create the backing columns corresponding to the field type ...
T * MapV(RNTupleLocalIndex localIndex, ROOT::NTupleSize_t &nItems)
RStreamerFieldDeleter(TClass *cl)
The field for a class using ROOT standard streaming.
ROOT::Internal::RColumnIndex fIndex
number of bytes written in the current cluster
bool HasExtraTypeInfo() const final
ROOT::Experimental::Internal::RNTupleSerializer::StreamerInfoMap_t fStreamerInfos
streamer info records seen during writing
void CommitClusterImpl() final
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::string GetRenormalizedDemangledTypeName(const std::type_info &ti)
Given a type info ask ROOT meta to demangle it, then renormalize the resulting type name for RNTuple.
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...
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
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::size_t fOffset
offset in fStagingArea
std::unique_ptr< RFieldBase > fField
The field used to read the on-disk data.
Input parameter to RFieldBase::ReadBulk() and RFieldBase::ReadBulkImpl().
Helper types to present an offset column as array of collection sizes.