30#include <unordered_map>
34class RNTupleFillContext;
58 std::vector<ROOT::RFieldBase::RValue>
fValues;
107 "make sure to use a token from a model with the same schema as this entry."));
120 static const std::string empty =
"";
124 template <
typename T>
127 if constexpr (!std::is_void_v<T>) {
128 if (!Internal::IsMatchingFieldType<T>(
fFieldTypes[token.fIndex])) {
167 template <
typename T>
182 template <
typename T>
191 template <
typename T>
206 template <
typename T>
215 template <
typename T>
220 return std::static_pointer_cast<T>(
fValues[token.
fIndex].GetPtr<
void>());
229 template <
typename T>
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
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 index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
The REntry is a collection of values in an RNTuple corresponding to a complete row in the data set.
std::uint64_t fModelId
The entry must be linked to a specific model, identified by a model ID.
void EmplaceNewValue(ROOT::RFieldToken token)
Create a new value for the field referenced by token.
std::shared_ptr< T > GetPtr(ROOT::RFieldToken token) const
Get the (typed) pointer to the value for the field referenced by token.
std::vector< ROOT::RFieldBase::RValue > fValues
Corresponds to the fields of the linked model.
std::uint64_t GetModelId() const
void BindValue(std::string_view fieldName, std::shared_ptr< T > objPtr)
Bind the value for the field, referenced by its name, to objPtr.
void BindValue(ROOT::RFieldToken token, std::shared_ptr< T > objPtr)
Bind the value for the field, referenced by token, to objPtr.
std::uint64_t GetSchemaId() const
REntry(const REntry &other)=delete
const std::string & FindFieldName(ROOT::RFieldToken token) const
This function has linear complexity, only use it for more helpful error messages!
const std::string & GetTypeName(ROOT::RFieldToken token) const
void EnsureMatchingType(ROOT::RFieldToken token) const
ConstIterator_t begin() const
void Read(ROOT::NTupleSize_t index)
std::vector< std::string > fFieldTypes
To ensure that the entry is standalone, a copy of all field types.
std::uint64_t fSchemaId
The entry and its tokens are also linked to a specific schema, identified by a schema ID.
void BindRawPtr(std::string_view fieldName, T *rawPtr)
Bind the value for the field, referenced by its name, to rawPtr.
void AddValue(ROOT::RFieldBase::RValue &&value)
std::shared_ptr< T > GetPtr(std::string_view fieldName) const
Get the (typed) pointer to the value for the field referenced by token.
REntry()=default
Creation of entries can be done by the RNTupleModel, the RNTupleReader, or the RNTupleWriter.
REntry(std::uint64_t modelId, std::uint64_t schemaId)
REntry & operator=(REntry &&other)=default
REntry & operator=(const REntry &other)=delete
ConstIterator_t end() const
std::shared_ptr< T > AddValue(ROOT::RField< T > &field)
While building the entry, adds a new value for the field and returns the value's shared pointer.
void EnsureMatchingModel(ROOT::RFieldToken token) const
void BindRawPtr(ROOT::RFieldToken token, T *rawPtr)
Bind the value for the field, referenced by token, to rawPtr.
void EmplaceNewValue(std::string_view fieldName)
Create a new value for the field referenced by its name.
REntry(REntry &&other)=default
ROOT::RFieldToken GetToken(std::string_view fieldName) const
The ordinal of the (sub)field fieldName; can be used in other methods to address the corresponding va...
std::unordered_map< std::string, std::size_t > fFieldName2Token
For fast lookup of token IDs given a (sub)field name present in the entry.
const std::string & GetTypeName(std::string_view fieldName) const
Base class for all ROOT issued exceptions.
Points to an object with RNTuple I/O support and keeps a pointer to the corresponding field.
A field token identifies a (sub)field in an entry.
std::size_t fIndex
The index of the field (top-level or registered subfield)
std::uint64_t fSchemaId
Safety check to prevent tokens from other models being used.
Classes with dictionaries that can be inspected by TClass.
A context for filling entries (data) into clusters of an RNTuple.
The RNTupleModel encapulates the schema of an RNTuple.
Reads RNTuple data from storage.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.