Class used to write an RNTupleAttrSet in the context of an RNTupleWriter.
An Attribute Set is written as a separate RNTuple linked to the "main" RNTuple that created it. A RNTupleAttrSetWriter only lives as long as the RNTupleWriter that created it (or until CloseAttributeSet() is called). Users should not use this class directly but rather via RNTupleAttrSetWriterHandle, which is the type returned by RNTupleWriter::CreateAttributeSet().
Definition at line 154 of file RNTupleAttrWriting.hxx.
Public Member Functions | |
| RNTupleAttrPendingRange | BeginRange () |
| Begins an attribute range. | |
| void | CommitRange (RNTupleAttrPendingRange range) |
Ends an attribute range and associates the current values of the fields of the attribute model's default entry with all the main RNTuple entries filled since the BeginRange that created the given range. | |
| void | CommitRange (RNTupleAttrPendingRange range, REntry &entry) |
| Like CommitRange(RNTupleAttrPendingRange range) but uses the given entry rather than the default entry. | |
| std::unique_ptr< REntry > | CreateEntry () |
| Creates an REntry fit to pass to CommitRange(RNTupleAttrPendingRange range, REntry entry). | |
| const ROOT::RNTupleDescriptor & | GetDescriptor () const |
| Returns the descriptor of the underlying attribute RNTuple. | |
| const ROOT::RNTupleModel & | GetModel () const |
| Returns the user-defined model used to create this attribute set. | |
Private Member Functions | |
| RNTupleAttrSetWriter (const RNTupleFillContext &mainFillContext, std::unique_ptr< ROOT::Internal::RPageSink > sink, std::unique_ptr< RNTupleModel > metaModel, std::unique_ptr< RNTupleModel > userModel, std::shared_ptr< ROOT::NTupleSize_t > rangeStartPtr, std::shared_ptr< ROOT::NTupleSize_t > rangeLenPtr) | |
| ROOT::Internal::RNTupleLink | Commit () |
| Commits the attributes written so far to disk and disables writing any new ones. | |
Static Private Member Functions | |
| static std::unique_ptr< RNTupleAttrSetWriter > | Create (const RNTupleFillContext &mainFillContext, std::unique_ptr< ROOT::Internal::RPageSink > sink, std::unique_ptr< RNTupleModel > userModel) |
Creates an RNTupleAttrSetWriter associated to the RNTupleWriter owning mainFillContext and writing using sink. | |
Private Attributes | |
| RNTupleFillContext | fFillContext |
| Our own fill context. | |
| const RNTupleFillContext * | fMainFillContext = nullptr |
| Fill context of the main RNTuple being written (i.e. the RNTuple whose attributes we are). | |
| std::shared_ptr< ROOT::NTupleSize_t > | fRangeLenPtr |
| std::shared_ptr< ROOT::NTupleSize_t > | fRangeStartPtr |
| std::unique_ptr< RNTupleModel > | fUserModel |
| The model that the user provided on creation. Used to create user-visible entries. | |
Friends | |
| class | ROOT::RNTupleWriter |
#include <ROOT/RNTupleAttrWriting.hxx>
|
private |
Definition at line 92 of file RNTupleAttrWriting.cxx.
| ROOT::Experimental::RNTupleAttrPendingRange ROOT::Experimental::RNTupleAttrSetWriter::BeginRange | ( | ) |
Begins an attribute range.
All entries filled in the main RNTupleWriter between BeginRange and CommitRange will be associated with the set of values of the fields of this attribute set at the moment of CommitRange. Note that every attribute range must be explicitly committed for it to be stored on disk.
Definition at line 106 of file RNTupleAttrWriting.cxx.
|
private |
Commits the attributes written so far to disk and disables writing any new ones.
Definition at line 141 of file RNTupleAttrWriting.cxx.
| void ROOT::Experimental::RNTupleAttrSetWriter::CommitRange | ( | RNTupleAttrPendingRange | range | ) |
Ends an attribute range and associates the current values of the fields of the attribute model's default entry with all the main RNTuple entries filled since the BeginRange that created the given range.
This is only valid if the model used to create this attribute set is not bare.
Definition at line 136 of file RNTupleAttrWriting.cxx.
| void ROOT::Experimental::RNTupleAttrSetWriter::CommitRange | ( | RNTupleAttrPendingRange | range, |
| REntry & | entry ) |
Like CommitRange(RNTupleAttrPendingRange range) but uses the given entry rather than the default entry.
The given entry must have been created by CreateEntry().
Definition at line 112 of file RNTupleAttrWriting.cxx.
|
staticprivate |
Creates an RNTupleAttrSetWriter associated to the RNTupleWriter owning mainFillContext and writing using sink.
userModel is the schema of the AttributeSet.
Definition at line 57 of file RNTupleAttrWriting.cxx.
|
inline |
Creates an REntry fit to pass to CommitRange(RNTupleAttrPendingRange range, REntry entry).
Definition at line 204 of file RNTupleAttrWriting.hxx.
|
inline |
Returns the descriptor of the underlying attribute RNTuple.
This is NOT the same descriptor as the main RNTuple being written!
Definition at line 185 of file RNTupleAttrWriting.hxx.
|
inline |
Returns the user-defined model used to create this attribute set.
Definition at line 187 of file RNTupleAttrWriting.hxx.
|
friend |
Definition at line 155 of file RNTupleAttrWriting.hxx.
|
private |
Our own fill context.
Definition at line 158 of file RNTupleAttrWriting.hxx.
|
private |
Fill context of the main RNTuple being written (i.e. the RNTuple whose attributes we are).
Definition at line 160 of file RNTupleAttrWriting.hxx.
|
private |
Definition at line 166 of file RNTupleAttrWriting.hxx.
|
private |
Definition at line 165 of file RNTupleAttrWriting.hxx.
|
private |
The model that the user provided on creation. Used to create user-visible entries.
Definition at line 162 of file RNTupleAttrWriting.hxx.