A field translates read and write calls from/to underlying columns to/from tree values.
A field is a serializable C++ type or a container for a collection of sub fields. The RFieldBase and its type-safe descendants provide the object to column mapper. They map C++ objects to primitive columns. The mapping is trivial for simple types such as 'double'. Complex types resolve to multiple primitive columns. The field knows based on its type and the field name the type(s) and name(s) of the columns.
Note: the class hierarchy starting at RFieldBase is not meant to be extended by user-provided child classes. This is and can only be partially enforced through C++.
Definition at line 67 of file RFieldBase.hxx.
Classes | |
class | RBulk |
Similar to RValue but manages an array of consecutive values. More... | |
struct | RBulkSpec |
Input parameter to ReadBulk() and ReadBulkImpl(). See RBulk class for more information. More... | |
struct | RCheckResult |
Used in the return value of the Check() method. More... | |
class | RColumnRepresentations |
Some fields have multiple possible column representations, e.g. More... | |
struct | RCreateObjectDeleter |
struct | RCreateObjectDeleter< void > |
class | RDeleter |
A functor to release the memory acquired by CreateValue (memory and constructor). More... | |
class | RSchemaIteratorTemplate |
Iterates over the sub tree of fields in depth-first search order. More... | |
struct | RSharedPtrDeleter |
class | RTypedDeleter |
A deleter for templated RFieldBase descendents where the value type is known. More... | |
class | RValue |
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field. More... | |
Public Types | |
using | ColumnRepresentation_t = std::vector< EColumnType > |
enum class | EState { kUnconnected , kConnectedToSink , kConnectedToSource } |
During its lifetime, a field undergoes the following possible state transitions: More... | |
using | RConstSchemaIterator = RSchemaIteratorTemplate< true > |
using | RSchemaIterator = RSchemaIteratorTemplate< false > |
Public Member Functions | |
RFieldBase (const RFieldBase &)=delete | |
RFieldBase (RFieldBase &&)=default | |
RFieldBase (std::string_view name, std::string_view type, ENTupleStructure structure, bool isSimple, std::size_t nRepetitions=0) | |
The constructor creates the underlying column objects and connects them to either a sink or a source. | |
virtual | ~RFieldBase ()=default |
virtual void | AcceptVisitor (Detail::RFieldVisitor &visitor) const |
RSchemaIterator | begin () |
RValue | BindValue (std::shared_ptr< void > objPtr) |
Creates a value from a memory location with an already constructed object. | |
RConstSchemaIterator | cbegin () const |
RConstSchemaIterator | cend () const |
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. | |
RBulk | CreateBulk () |
The returned bulk is initially empty; RBulk::ReadBulk will construct the array of values. | |
template<> | |
std::unique_ptr< void, typename RFieldBase::RCreateObjectDeleter< void >::deleter > | CreateObject () const |
template<typename T > | |
std::unique_ptr< T, typename RCreateObjectDeleter< T >::deleter > | CreateObject () const |
Generates an object of the field type and allocates new initialized memory according to the type. | |
template<> | |
std::unique_ptr< void, typename ROOT::Experimental::RFieldBase::RCreateObjectDeleter< void >::deleter > | CreateObject () const |
RValue | CreateValue () |
Generates an object of the field type and wraps the created object in a shared pointer and returns it an RValue connected to the field. | |
RSchemaIterator | end () |
virtual size_t | GetAlignment () const =0 |
As a rule of thumb, the alignment is equal to the size of the type. | |
RColumnRepresentations::Selection_t | GetColumnRepresentatives () const |
Returns the fColumnRepresentative pointee or, if unset, the field's default representative. | |
const std::string & | GetDescription () const |
Get the field's description. | |
const std::string & | GetFieldName () const |
virtual std::uint32_t | GetFieldVersion () const |
Indicates an evolution of the mapping scheme from C++ type to columns. | |
NTupleSize_t | GetNElements () const |
std::size_t | GetNRepetitions () const |
DescriptorId_t | GetOnDiskId () const |
std::uint32_t | GetOnDiskTypeChecksum () const |
Return checksum stored in the field descriptor; only valid after a call to ConnectPageSource() , if the field stored a type checksum. | |
std::uint32_t | GetOnDiskTypeVersion () const |
Return the C++ type version stored in the field descriptor; only valid after a call to ConnectPageSource() | |
const RFieldBase * | GetParent () const |
std::string | GetQualifiedFieldName () const |
Returns the field name and parent field names separated by dots ("grandparent.parent.child") | |
EState | GetState () const |
ENTupleStructure | GetStructure () const |
std::vector< RFieldBase * > | GetSubFields () |
std::vector< const RFieldBase * > | GetSubFields () const |
int | GetTraits () const |
const std::string & | GetTypeAlias () const |
virtual std::uint32_t | GetTypeChecksum () const |
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set. | |
const std::string & | GetTypeName () const |
virtual std::uint32_t | GetTypeVersion () const |
Indicates an evolution of the C++ type itself. | |
virtual size_t | GetValueSize () const =0 |
The number of bytes taken by a value of the appropriate type. | |
bool | HasDefaultColumnRepresentative () const |
Whether or not an explicit column representative was set. | |
bool | HasReadCallbacks () const |
bool | IsSimple () const |
RFieldBase & | operator= (const RFieldBase &)=delete |
RFieldBase & | operator= (RFieldBase &&)=default |
void | SetColumnRepresentatives (const RColumnRepresentations::Selection_t &representatives) |
Fixes a column representative. | |
void | SetDescription (std::string_view description) |
void | SetOnDiskId (DescriptorId_t id) |
virtual std::vector< RValue > | SplitValue (const RValue &value) const |
Creates the list of direct child values given a value for this field. | |
Static Public Member Functions | |
static std::vector< RCheckResult > | Check (const std::string &fieldName, const std::string &typeName) |
Checks if the given type is supported by RNTuple. | |
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. | |
static RResult< void > | EnsureValidFieldName (std::string_view fieldName) |
Check whether a given string is a valid field name. | |
Static Public Attributes | |
static constexpr std::uint32_t | kInvalidTypeVersion = -1U |
static constexpr int | kTraitMappable = 0x04 |
A field of a fundamental type that can be directly mapped via RField<T>::Map() , i.e. | |
static constexpr int | kTraitTriviallyConstructible = 0x01 |
No constructor needs to be called, i.e. | |
static constexpr int | kTraitTriviallyDestructible = 0x02 |
The type is cleaned up just by freeing its memory. I.e. the destructor performs a no-op. | |
static constexpr int | kTraitTrivialType = kTraitTriviallyConstructible | kTraitTriviallyDestructible |
Shorthand for types that are both trivially constructible and destructible. | |
static constexpr int | kTraitTypeChecksum = 0x08 |
The TClass checksum is set and valid. | |
Protected Member Functions | |
size_t | AddReadCallback (ReadCallback_t func) |
Set a user-defined function to be called after reading a value, giving a chance to inspect and/or modify the value object. | |
std::size_t | Append (const void *from) |
Write the given value into columns. | |
virtual std::size_t | AppendImpl (const void *from) |
Operations on values of complex types, e.g. | |
void | Attach (std::unique_ptr< RFieldBase > child) |
Add a new subfield to the list of nested fields. | |
void | AutoAdjustColumnTypes (const RNTupleWriteOptions &options) |
When connecting a field to a page sink, the field's default column representation is subject to adjustment according to the write options. | |
virtual std::unique_ptr< RFieldBase > | CloneImpl (std::string_view newName) const =0 |
Called by Clone(), which additionally copies the on-disk ID. | |
virtual void | CommitClusterImpl () |
virtual void | ConstructValue (void *where) const =0 |
Constructs value in a given location of size at least GetValueSize(). Called by the base class' CreateValue(). | |
const ColumnRepresentation_t & | EnsureCompatibleColumnTypes (const RNTupleDescriptor &desc, std::uint16_t representationIndex) const |
Returns the on-disk column types found in the provided descriptor for fOnDiskId and the given representation index. | |
virtual void | GenerateColumns () |
Implementations in derived classes should create the backing columns corresponsing to the field type for writing. | |
virtual void | GenerateColumns (const RNTupleDescriptor &) |
Implementations in derived classes should create the backing columns corresponsing to the field type for reading. | |
template<typename... ColumnCppTs> | |
void | GenerateColumnsImpl () |
For writing, use the currently set column representative. | |
template<std::uint32_t ColumnIndexT, typename HeadT , typename... TailTs> | |
void | GenerateColumnsImpl (const ColumnRepresentation_t &representation, std::uint16_t representationIndex) |
Helpers for generating columns. | |
template<typename... ColumnCppTs> | |
void | GenerateColumnsImpl (const RNTupleDescriptor &desc) |
For reading, use the on-disk column list. | |
virtual const RColumnRepresentations & | GetColumnRepresentations () const |
Implementations in derived classes should return a static RColumnRepresentations object. | |
virtual std::unique_ptr< RDeleter > | GetDeleter () const |
virtual RExtraTypeInfoDescriptor | GetExtraTypeInfo () const |
virtual bool | HasExtraTypeInfo () const |
virtual void | OnConnectPageSource () |
Called by ConnectPageSource() once connected; derived classes may override this as appropriate. | |
void | Read (NTupleSize_t globalIndex, void *to) |
Populate a single value with data from the field. | |
void | Read (RClusterIndex clusterIndex, void *to) |
std::size_t | ReadBulk (const RBulkSpec &bulkSpec) |
Returns the number of newly available values, that is the number of bools in bulkSpec.fMaskAvail that flipped from false to true. | |
virtual std::size_t | ReadBulkImpl (const RBulkSpec &bulkSpec) |
General implementation of bulk read. | |
virtual void | ReadGlobalImpl (NTupleSize_t globalIndex, void *to) |
virtual void | ReadInClusterImpl (RClusterIndex clusterIndex, void *to) |
void | RemoveReadCallback (size_t idx) |
Static Protected Member Functions | |
static std::size_t | CallAppendOn (RFieldBase &other, const void *from) |
Allow derived classes to call Append and Read on other (sub) fields. | |
static void | CallConstructValueOn (const RFieldBase &other, void *where) |
Allow derived classes to call ConstructValue(void *) and GetDeleter on other (sub) fields. | |
static void | CallReadOn (RFieldBase &other, NTupleSize_t globalIndex, void *to) |
static void | CallReadOn (RFieldBase &other, RClusterIndex clusterIndex, void *to) |
static RResult< std::unique_ptr< RFieldBase > > | Create (const std::string &fieldName, const std::string &canonicalType, const std::string &typeAlias, bool fContinueOnError=false) |
Factory method to resurrect a field from the stored on-disk type information. | |
static std::unique_ptr< RDeleter > | GetDeleterOf (const RFieldBase &other) |
static Internal::RColumn * | GetPrincipalColumnOf (const RFieldBase &other) |
Fields may need direct access to the principal column of their sub fields, e.g. in RRVecField::ReadBulk. | |
Protected Attributes | |
Internal::RColumn * | fAuxiliaryColumn = nullptr |
Some fields have a second column in its column representation. | |
std::vector< std::unique_ptr< Internal::RColumn > > | fAvailableColumns |
The columns are connected either to a sink or to a source (not to both); they are owned by the field. | |
std::vector< std::reference_wrapper< const ColumnRepresentation_t > > | fColumnRepresentatives |
Pointers into the static vector GetColumnRepresentations().GetSerializationTypes() when SetColumnRepresentatives is called. | |
std::uint32_t | fOnDiskTypeChecksum = 0 |
TClass checksum cached from the descriptor after a call to ConnectPageSource() . | |
std::uint32_t | fOnDiskTypeVersion = kInvalidTypeVersion |
C++ type version cached from the descriptor after a call to ConnectPageSource() | |
RFieldBase * | fParent |
Sub fields point to their mother field. | |
Internal::RColumn * | fPrincipalColumn = nullptr |
All fields that have columns have a distinct main column. | |
std::vector< ReadCallback_t > | fReadCallbacks |
List of functions to be called after reading a value. | |
std::vector< std::unique_ptr< RFieldBase > > | fSubFields |
Collections and classes own sub fields. | |
int | fTraits = 0 |
Properties of the type that allow for optimizations of collections of that type. | |
std::string | fTypeAlias |
A typedef or using name that was used when creating the field. | |
Private Types | |
using | ReadCallback_t = std::function< void(void *)> |
Private Member Functions | |
void | CommitCluster () |
Flushes data from active columns to disk and calls CommitClusterImpl. | |
void | ConnectPageSink (Internal::RPageSink &pageSink, NTupleSize_t firstEntry=0) |
Fields and their columns live in the void until connected to a physical page storage. | |
void | ConnectPageSource (Internal::RPageSource &pageSource) |
Connects the field and its sub field tree to the given page source. | |
void * | CreateObjectRawPtr () const |
Factory method for the field's type. The caller owns the returned pointer. | |
NTupleSize_t | EntryToColumnElementIndex (NTupleSize_t globalIndex) const |
Translate an entry index to a column element index of the principal column and viceversa. | |
void | InvokeReadCallbacks (void *target) |
Private Attributes | |
std::string | fDescription |
Free text set by the user. | |
bool | fIsSimple |
A field qualifies as simple if it is both mappable and has no post-read callback. | |
std::string | fName |
The field name relative to its parent field. | |
std::size_t | fNRepetitions |
For fixed sized arrays, the array length. | |
DescriptorId_t | fOnDiskId = kInvalidDescriptorId |
When the columns are connected to a page source or page sink, the field represents a field id in the corresponding RNTuple descriptor. | |
EState | fState = EState::kUnconnected |
Changed by ConnectTo[Sink,Source], reset by Clone() | |
ENTupleStructure | fStructure |
The role of this field in the data model structure. | |
std::string | fType |
The C++ type captured by this field. | |
#include <ROOT/RFieldBase.hxx>
using ROOT::Experimental::RFieldBase::ColumnRepresentation_t = std::vector<EColumnType> |
Definition at line 125 of file RFieldBase.hxx.
Definition at line 669 of file RFieldBase.hxx.
|
private |
Definition at line 74 of file RFieldBase.hxx.
Definition at line 668 of file RFieldBase.hxx.
|
strong |
During its lifetime, a field undergoes the following possible state transitions:
[*] --> Unconnected --> ConnectedToSink -— | | | | --> ConnectedToSource —> [*]
Enumerator | |
---|---|
kUnconnected | |
kConnectedToSink | |
kConnectedToSource |
Definition at line 134 of file RFieldBase.hxx.
ROOT::Experimental::RFieldBase::RFieldBase | ( | std::string_view | name, |
std::string_view | type, | ||
ENTupleStructure | structure, | ||
bool | isSimple, | ||
std::size_t | nRepetitions = 0 |
||
) |
The constructor creates the underlying column objects and connects them to either a sink or a source.
If isSimple
is true
, the trait kTraitMappable
is automatically set on construction. However, the field might be demoted to non-simple if a post-read callback is set.
Definition at line 568 of file RField.cxx.
|
delete |
|
default |
|
virtualdefault |
|
virtual |
Reimplemented in ROOT::Experimental::RFieldZero, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCardinalityField, ROOT::Experimental::RField< ClusterSize_t >, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RField< bool >, ROOT::Experimental::RField< char >, ROOT::Experimental::RField< float >, ROOT::Experimental::RField< double >, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::RNullableField, ROOT::Experimental::RClassField, and ROOT::Experimental::RProxiedCollectionField.
Definition at line 1232 of file RField.cxx.
|
protected |
Set a user-defined function to be called after reading a value, giving a chance to inspect and/or modify the value object.
Returns an index that can be used to remove the callback.
Definition at line 1123 of file RField.cxx.
|
inlineprotected |
Write the given value into columns.
The value object has to be of the same type as the field. Returns the number of uncompressed bytes written.
Definition at line 506 of file RFieldBase.hxx.
|
protectedvirtual |
Operations on values of complex types, e.g.
ones that involve multiple columns or for which no direct column type exists.
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RMapField, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RVectorField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RProxiedCollectionField, and ROOT::Experimental::RRVecField.
Definition at line 933 of file RField.cxx.
|
protected |
Add a new subfield to the list of nested fields.
Definition at line 984 of file RField.cxx.
|
protected |
When connecting a field to a page sink, the field's default column representation is subject to adjustment according to the write options.
E.g., if compression is turned off, encoded columns are changed to their unencoded counterparts.
Definition at line 1136 of file RField.cxx.
|
inline |
Definition at line 777 of file RFieldBase.hxx.
|
inline |
Creates a value from a memory location with an already constructed object.
Definition at line 723 of file RFieldBase.hxx.
|
inlinestaticprotected |
Allow derived classes to call Append and Read on other (sub) fields.
Definition at line 565 of file RFieldBase.hxx.
|
inlinestaticprotected |
Allow derived classes to call ConstructValue(void *) and GetDeleter on other (sub) fields.
Definition at line 492 of file RFieldBase.hxx.
|
inlinestaticprotected |
Definition at line 567 of file RFieldBase.hxx.
|
inlinestaticprotected |
Definition at line 566 of file RFieldBase.hxx.
|
inline |
Definition at line 782 of file RFieldBase.hxx.
|
inline |
Definition at line 786 of file RFieldBase.hxx.
|
static |
Checks if the given type is supported by RNTuple.
In case of success, the result vector is empty. Otherwise there is an error record for each failing sub field (sub type).
Definition at line 601 of file RField.cxx.
std::unique_ptr< ROOT::Experimental::RFieldBase > ROOT::Experimental::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.
Definition at line 922 of file RField.cxx.
|
protectedpure virtual |
Called by Clone(), which additionally copies the on-disk ID.
Implemented in ROOT::Experimental::RInvalidField, ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RField< ClusterSize_t >, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RField< bool >, ROOT::Experimental::RField< char >, ROOT::Experimental::RField< float >, ROOT::Experimental::RField< double >, ROOT::Experimental::RMapField, ROOT::Experimental::RSetField, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RFieldZero, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRecordField, ROOT::Experimental::RPairField, ROOT::Experimental::RTupleField, ROOT::Experimental::RRVecField, ROOT::Experimental::Internal::RRDFCardinalityField, and ROOT::Experimental::Internal::RArraySizeField.
|
private |
Flushes data from active columns to disk and calls CommitClusterImpl.
Definition at line 1027 of file RField.cxx.
|
inlineprotectedvirtual |
Reimplemented in ROOT::Experimental::RUnsplitField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RNullableField, and ROOT::Experimental::RVariantField.
Definition at line 579 of file RFieldBase.hxx.
|
private |
Fields and their columns live in the void until connected to a physical page storage.
Only once connected, data can be read or written. In order to find the field in the page storage, the field's on-disk ID has to be set.
firstEntry | The global index of the first entry with on-disk data for the connected field |
Definition at line 1159 of file RField.cxx.
|
private |
Connects the field and its sub field tree to the given page source.
Once connected, data can be read. Only unconnected fields may be connected, i.e. the method is not idempotent. The field ID has to be set prior to calling this function. For sub fields, a field ID may or may not be set. If the field ID is unset, it will be determined using the page source descriptor, based on the parent field ID and the sub field name.
Definition at line 1185 of file RField.cxx.
|
protectedpure virtual |
Constructs value in a given location of size at least GetValueSize(). Called by the base class' CreateValue().
Implemented in ROOT::Experimental::RFieldZero, ROOT::Experimental::RInvalidField, ROOT::Experimental::RCollectionField, ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::Internal::RArraySizeField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RField< T, typename >, ROOT::Experimental::RSimpleField< T >, ROOT::Experimental::RSimpleField< bool >, ROOT::Experimental::RSimpleField< char >, ROOT::Experimental::RSimpleField< ClusterSize_t >, ROOT::Experimental::RSimpleField< double >, ROOT::Experimental::RSimpleField< float >, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RClassField, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRecordField, ROOT::Experimental::RPairField, ROOT::Experimental::RTupleField, ROOT::Experimental::RArrayField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, and ROOT::Experimental::RVariantField.
|
staticprotected |
Factory method to resurrect a field from the stored on-disk type information.
This overload takes an already normalized type name and type alias TODO(jalopezg): this overload may eventually be removed leaving only the RFieldBase::Create()
that takes a single type name
Definition at line 622 of file RField.cxx.
|
static |
Factory method to resurrect a field from the stored on-disk type information.
Definition at line 593 of file RField.cxx.
|
inline |
The returned bulk is initially empty; RBulk::ReadBulk will construct the array of values.
Definition at line 721 of file RFieldBase.hxx.
std::unique_ptr< void, typename RFieldBase::RCreateObjectDeleter< void >::deleter > ROOT::Experimental::RFieldBase::CreateObject | ( | ) | const |
std::unique_ptr< T, typename RFieldBase::RCreateObjectDeleter< T >::deleter > ROOT::Experimental::RFieldBase::CreateObject |
Generates an object of the field type and allocates new initialized memory according to the type.
Implemented at the end of this header because the implementation is using RField<T>::TypeName() The returned object can be released with delete
, i.e. it is valid to call auto ptr = field->CreateObject(); delete ptr.release();
Note that CreateObject<void> is supported. The returned unique_ptr has a custom deleter that reports an error if it is called. The intended use of the returned unique_ptr<void> is to call release()
. In this way, the transfer of pointer ownership is explicit.
Definition at line 504 of file RField.hxx.
std::unique_ptr< void, typename ROOT::Experimental::RFieldBase::RCreateObjectDeleter< void >::deleter > ROOT::Experimental::RFieldBase::CreateObject | ( | ) | const |
Definition at line 553 of file RField.cxx.
|
private |
Factory method for the field's type. The caller owns the returned pointer.
Definition at line 964 of file RField.cxx.
ROOT::Experimental::RFieldBase::RValue ROOT::Experimental::RFieldBase::CreateValue | ( | ) |
Generates an object of the field type and wraps the created object in a shared pointer and returns it an RValue connected to the field.
Definition at line 972 of file RField.cxx.
|
inline |
Definition at line 781 of file RFieldBase.hxx.
|
protected |
Returns the on-disk column types found in the provided descriptor for fOnDiskId and the given representation index.
If there are no columns for the given representation index, return an empty ColumnRepresentation_t list. Otherwise, the returned reference points into the static array returned by GetColumnRepresentations(). Throws an exception if the types on disk don't match any of the deserialization types from GetColumnRepresentations().
Definition at line 1088 of file RField.cxx.
|
static |
Check whether a given string is a valid field name.
Definition at line 905 of file RField.cxx.
|
private |
Translate an entry index to a column element index of the principal column and viceversa.
These functions take into account the role and number of repetitions on each level of the field hierarchy as follows:
The column element index also depends on the number of repetitions of each field in the hierarchy, e.g., given a field with type std::array<std::array<float, 4>, 2>
, this function returns 8 for the inner-most field.
Definition at line 995 of file RField.cxx.
|
inlineprotectedvirtual |
Implementations in derived classes should create the backing columns corresponsing to the field type for writing.
The default implementation does not attach any columns to the field.
Reimplemented in ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::Internal::RArraySizeField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RCardinalityField, ROOT::Experimental::RSimpleField< T >, ROOT::Experimental::RSimpleField< bool >, ROOT::Experimental::RSimpleField< char >, ROOT::Experimental::RSimpleField< ClusterSize_t >, ROOT::Experimental::RSimpleField< double >, ROOT::Experimental::RSimpleField< float >, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RBitsetField, ROOT::Experimental::RNullableField, and ROOT::Experimental::RVariantField.
Definition at line 467 of file RFieldBase.hxx.
|
inlineprotectedvirtual |
Implementations in derived classes should create the backing columns corresponsing to the field type for reading.
The default implementation does not attach any columns to the field. The method should check, using the page source and fOnDiskId, if the column types match and throw if they don't.
Reimplemented in ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::RCardinalityField, ROOT::Experimental::RNullableField, ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RSimpleField< T >, ROOT::Experimental::RSimpleField< bool >, ROOT::Experimental::RSimpleField< char >, ROOT::Experimental::RSimpleField< ClusterSize_t >, ROOT::Experimental::RSimpleField< double >, ROOT::Experimental::RSimpleField< float >, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RBitsetField, ROOT::Experimental::RVariantField, and ROOT::Experimental::Internal::RArraySizeField.
Definition at line 471 of file RFieldBase.hxx.
|
inlineprotected |
For writing, use the currently set column representative.
Definition at line 427 of file RFieldBase.hxx.
|
inlineprotected |
Helpers for generating columns.
We use the fact that most fields have the same C++/memory types for all their column representations. Where possible, we call the helpers not from the header to reduce compilation time.
Definition at line 405 of file RFieldBase.hxx.
|
inlineprotected |
For reading, use the on-disk column list.
Definition at line 443 of file RFieldBase.hxx.
|
pure virtual |
As a rule of thumb, the alignment is equal to the size of the type.
There are, however, various exceptions to this rule depending on OS and CPU architecture. So enforce the alignment to be explicitly spelled out.
Implemented in ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::Internal::RArraySizeField, ROOT::Experimental::RFieldZero, ROOT::Experimental::RInvalidField, ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RSimpleField< T >, ROOT::Experimental::RSimpleField< bool >, ROOT::Experimental::RSimpleField< char >, ROOT::Experimental::RSimpleField< ClusterSize_t >, ROOT::Experimental::RSimpleField< double >, ROOT::Experimental::RSimpleField< float >, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RMapField, ROOT::Experimental::RSetField, and ROOT::Experimental::RRVecField.
|
protectedvirtual |
Implementations in derived classes should return a static RColumnRepresentations object.
The default implementation does not attach any columns to the field.
Reimplemented in ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RCardinalityField, ROOT::Experimental::RField< ClusterSize_t >, ROOT::Experimental::RField< bool >, ROOT::Experimental::RField< char >, ROOT::Experimental::RField< float >, ROOT::Experimental::RField< double >, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RBitsetField, ROOT::Experimental::RNullableField, and ROOT::Experimental::RVariantField.
Definition at line 916 of file RField.cxx.
ROOT::Experimental::RFieldBase::RColumnRepresentations::Selection_t ROOT::Experimental::RFieldBase::GetColumnRepresentatives | ( | ) | const |
Returns the fColumnRepresentative pointee or, if unset, the field's default representative.
Definition at line 1057 of file RField.cxx.
|
inlineprotectedvirtual |
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRecordField, ROOT::Experimental::RPairField, ROOT::Experimental::RTupleField, and ROOT::Experimental::RRVecField.
Definition at line 490 of file RFieldBase.hxx.
|
inlinestaticprotected |
Definition at line 493 of file RFieldBase.hxx.
|
inline |
Get the field's description.
Definition at line 749 of file RFieldBase.hxx.
|
inlineprotectedvirtual |
Reimplemented in ROOT::Experimental::RUnsplitField.
Definition at line 587 of file RFieldBase.hxx.
|
inline |
Definition at line 736 of file RFieldBase.hxx.
|
inlinevirtual |
Indicates an evolution of the mapping scheme from C++ type to columns.
Definition at line 766 of file RFieldBase.hxx.
|
inline |
Definition at line 743 of file RFieldBase.hxx.
|
inline |
Definition at line 742 of file RFieldBase.hxx.
|
inline |
Definition at line 753 of file RFieldBase.hxx.
|
inline |
Return checksum stored in the field descriptor; only valid after a call to ConnectPageSource()
, if the field stored a type checksum.
Definition at line 775 of file RFieldBase.hxx.
|
inline |
Return the C++ type version stored in the field descriptor; only valid after a call to ConnectPageSource()
Definition at line 772 of file RFieldBase.hxx.
|
inline |
Definition at line 744 of file RFieldBase.hxx.
|
inlinestaticprotected |
Fields may need direct access to the principal column of their sub fields, e.g. in RRVecField::ReadBulk.
Definition at line 570 of file RFieldBase.hxx.
std::string ROOT::Experimental::RFieldBase::GetQualifiedFieldName | ( | ) | const |
Returns the field name and parent field names separated by dots ("grandparent.parent.child")
Definition at line 581 of file RField.cxx.
|
inline |
Definition at line 751 of file RFieldBase.hxx.
|
inline |
Definition at line 741 of file RFieldBase.hxx.
std::vector< ROOT::Experimental::RFieldBase * > ROOT::Experimental::RFieldBase::GetSubFields | ( | ) |
Definition at line 1007 of file RField.cxx.
std::vector< const ROOT::Experimental::RFieldBase * > ROOT::Experimental::RFieldBase::GetSubFields | ( | ) | const |
Definition at line 1017 of file RField.cxx.
|
inline |
Definition at line 733 of file RFieldBase.hxx.
|
inline |
Definition at line 740 of file RFieldBase.hxx.
|
inlinevirtual |
Return the current TClass reported checksum of this class. Only valid if kTraitTypeChecksum is set.
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, and ROOT::Experimental::RField< TObject >.
Definition at line 770 of file RFieldBase.hxx.
|
inline |
Definition at line 739 of file RFieldBase.hxx.
|
inlinevirtual |
Indicates an evolution of the C++ type itself.
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, and ROOT::Experimental::RField< TObject >.
Definition at line 768 of file RFieldBase.hxx.
|
pure virtual |
The number of bytes taken by a value of the appropriate type.
Implemented in ROOT::Experimental::Internal::RRDFCardinalityField, ROOT::Experimental::Internal::RArraySizeField, ROOT::Experimental::RFieldZero, ROOT::Experimental::RInvalidField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RSimpleField< T >, ROOT::Experimental::RSimpleField< bool >, ROOT::Experimental::RSimpleField< char >, ROOT::Experimental::RSimpleField< ClusterSize_t >, ROOT::Experimental::RSimpleField< double >, ROOT::Experimental::RSimpleField< float >, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RClassField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, and ROOT::Experimental::RVectorField.
|
inline |
Whether or not an explicit column representative was set.
Definition at line 763 of file RFieldBase.hxx.
|
inlineprotectedvirtual |
Reimplemented in ROOT::Experimental::RUnsplitField.
Definition at line 583 of file RFieldBase.hxx.
|
inline |
Definition at line 734 of file RFieldBase.hxx.
|
inlineprivate |
Definition at line 318 of file RFieldBase.hxx.
|
inline |
Definition at line 747 of file RFieldBase.hxx.
|
inlineprotectedvirtual |
Called by ConnectPageSource()
once connected; derived classes may override this as appropriate.
Reimplemented in ROOT::Experimental::RClassField, and ROOT::Experimental::RField< TObject >.
Definition at line 593 of file RFieldBase.hxx.
|
delete |
|
default |
|
inlineprotected |
Populate a single value with data from the field.
The memory location pointed to by to needs to be of the fitting type. The fast path is conditioned by the field qualifying as simple, i.e. maps as-is to a single column and has no read callback.
Definition at line 518 of file RFieldBase.hxx.
|
inlineprotected |
Definition at line 531 of file RFieldBase.hxx.
|
inlineprotected |
Returns the number of newly available values, that is the number of bools in bulkSpec.fMaskAvail that flipped from false to true.
As a special return value, kAllSet can be used if all values are read independent from the masks.
Definition at line 552 of file RFieldBase.hxx.
|
protectedvirtual |
General implementation of bulk read.
Loop over the required range and read values that are required and not already present. Derived classes may implement more optimized versions of this method. See ReadBulk() for the return value.
Reimplemented in ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, and ROOT::Experimental::RRVecField.
Definition at line 944 of file RField.cxx.
|
protectedvirtual |
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::RUnsplitField, ROOT::Experimental::REnumField, ROOT::Experimental::RCollectionField, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RMapField, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RField< ROOT::VecOps::RVec< ItemT > >, ROOT::Experimental::RVectorField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RBitsetField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, ROOT::Experimental::RVariantField, ROOT::Experimental::RProxiedCollectionField, ROOT::Experimental::RRVecField, ROOT::Experimental::Internal::RArraySizeField, and ROOT::Experimental::Internal::RRDFCardinalityField.
Definition at line 939 of file RField.cxx.
|
inlineprotectedvirtual |
Reimplemented in ROOT::Experimental::RClassField, ROOT::Experimental::REnumField, ROOT::Experimental::RField< RNTupleCardinality< SizeT > >, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RAtomicField, ROOT::Experimental::RNullableField, ROOT::Experimental::Internal::RArraySizeField, and ROOT::Experimental::Internal::RRDFCardinalityField.
Definition at line 499 of file RFieldBase.hxx.
|
protected |
Definition at line 1130 of file RField.cxx.
void ROOT::Experimental::RFieldBase::SetColumnRepresentatives | ( | const RColumnRepresentations::Selection_t & | representatives | ) |
Fixes a column representative.
This can only be done before connecting the field to a page sink. Otherwise, or if the provided representation is not in the list of GetColumnRepresentations, an exception is thrown
Definition at line 1071 of file RField.cxx.
void ROOT::Experimental::RFieldBase::SetDescription | ( | std::string_view | description | ) |
Definition at line 1042 of file RField.cxx.
void ROOT::Experimental::RFieldBase::SetOnDiskId | ( | DescriptorId_t | id | ) |
Definition at line 1049 of file RField.cxx.
|
virtual |
Creates the list of direct child values given a value for this field.
E.g. a single value for the correct variant or all the elements of a collection. The default implementation assumes no sub values and returns an empty vector.
Reimplemented in ROOT::Experimental::RArrayAsRVecField, ROOT::Experimental::RClassField, ROOT::Experimental::REnumField, ROOT::Experimental::RField< TObject >, ROOT::Experimental::RMapField, ROOT::Experimental::RRecordField, ROOT::Experimental::RArrayField, ROOT::Experimental::RRVecField, ROOT::Experimental::RVectorField, ROOT::Experimental::RAtomicField, ROOT::Experimental::ROptionalField, ROOT::Experimental::RUniquePtrField, and ROOT::Experimental::RProxiedCollectionField.
Definition at line 979 of file RField.cxx.
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 69 of file RFieldBase.hxx.
|
friend |
Definition at line 70 of file RFieldBase.hxx.
|
friend |
Definition at line 68 of file RFieldBase.hxx.
|
protected |
Some fields have a second column in its column representation.
In this case, fAuxiliaryColumn points into fAvailableColumns to the column that immediately follows the column fPrincipalColumn points to.
Definition at line 381 of file RFieldBase.hxx.
|
protected |
The columns are connected either to a sink or to a source (not to both); they are owned by the field.
Contains all columns of all representations in order of representation and column index.
Definition at line 384 of file RFieldBase.hxx.
|
protected |
Pointers into the static vector GetColumnRepresentations().GetSerializationTypes() when SetColumnRepresentatives is called.
Otherwise (if empty) GetColumnRepresentatives() returns a vector with a single element, the default representation.
Definition at line 399 of file RFieldBase.hxx.
|
private |
Free text set by the user.
Definition at line 314 of file RFieldBase.hxx.
|
private |
A field qualifies as simple if it is both mappable and has no post-read callback.
Definition at line 308 of file RFieldBase.hxx.
|
private |
The field name relative to its parent field.
Definition at line 300 of file RFieldBase.hxx.
|
private |
For fixed sized arrays, the array length.
Definition at line 306 of file RFieldBase.hxx.
|
private |
When the columns are connected to a page source or page sink, the field represents a field id in the corresponding RNTuple descriptor.
This on-disk ID is set in RPageSink::Create() for writing and by RFieldDescriptor::CreateField() when recreating a field / model from the stored descriptor.
Definition at line 312 of file RFieldBase.hxx.
|
protected |
TClass checksum cached from the descriptor after a call to ConnectPageSource()
.
Only set for classes with dictionaries.
Definition at line 395 of file RFieldBase.hxx.
|
protected |
C++ type version cached from the descriptor after a call to ConnectPageSource()
Definition at line 392 of file RFieldBase.hxx.
|
protected |
Sub fields point to their mother field.
Definition at line 371 of file RFieldBase.hxx.
|
protected |
All fields that have columns have a distinct main column.
E.g., for simple fields (float, int, ...), the principal column corresponds to the field type. For collection fields except fixed-sized arrays, the main column is the offset field. Class fields have no column of their own. When reading, points to any column of the column team of the active representation. Usually, this is just the first column, except for the nullable field. When writing, points to the first column index of the currently active (not suppressed) column representation.
Definition at line 378 of file RFieldBase.hxx.
|
protected |
List of functions to be called after reading a value.
Definition at line 390 of file RFieldBase.hxx.
|
private |
Changed by ConnectTo[Sink,Source], reset by Clone()
Definition at line 316 of file RFieldBase.hxx.
|
private |
The role of this field in the data model structure.
Definition at line 304 of file RFieldBase.hxx.
|
protected |
Collections and classes own sub fields.
Definition at line 369 of file RFieldBase.hxx.
|
protected |
Properties of the type that allow for optimizations of collections of that type.
Definition at line 386 of file RFieldBase.hxx.
|
private |
The C++ type captured by this field.
Definition at line 302 of file RFieldBase.hxx.
|
protected |
A typedef or using name that was used when creating the field.
Definition at line 388 of file RFieldBase.hxx.
|
staticconstexpr |
Definition at line 111 of file RFieldBase.hxx.
|
staticconstexpr |
A field of a fundamental type that can be directly mapped via RField<T>::Map()
, i.e.
maps as-is to a single column
Definition at line 119 of file RFieldBase.hxx.
|
staticconstexpr |
No constructor needs to be called, i.e.
any bit pattern in the allocated memory represents a valid type A trivially constructible field has a no-op ConstructValue() implementation
Definition at line 114 of file RFieldBase.hxx.
|
staticconstexpr |
The type is cleaned up just by freeing its memory. I.e. the destructor performs a no-op.
Definition at line 116 of file RFieldBase.hxx.
|
staticconstexpr |
Shorthand for types that are both trivially constructible and destructible.
Definition at line 123 of file RFieldBase.hxx.
|
staticconstexpr |
The TClass checksum is set and valid.
Definition at line 121 of file RFieldBase.hxx.