ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
RNTupleCollectionWriter.hxx
Go to the documentation of this file.
1
/// \file ROOT/RNTupleCollectionWriter.hxx
2
/// \ingroup NTuple ROOT7
3
/// \author Jakob Blomer <jblomer@cern.ch>
4
/// \date 2024-02-22
5
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6
/// is welcome!
7
8
/*************************************************************************
9
* Copyright (C) 1995-2024, Rene Brun and Fons Rademakers. *
10
* All rights reserved. *
11
* *
12
* For the licensing terms see $ROOTSYS/LICENSE. *
13
* For the list of contributors see $ROOTSYS/README/CREDITS. *
14
*************************************************************************/
15
16
#ifndef ROOT7_RNTupleCollectionWriter
17
#define ROOT7_RNTupleCollectionWriter
18
19
#include <
ROOT/REntry.hxx
>
20
#include <
ROOT/RNTupleUtil.hxx
>
21
22
#include <cstddef>
23
#include <memory>
24
#include <utility>
25
26
namespace
ROOT
{
27
namespace
Experimental {
28
29
// clang-format off
30
/**
31
\class ROOT::Experimental::RNTupleCollectionWriter
32
\ingroup NTuple
33
\brief A virtual ntuple used for writing untyped collections that can be used to some extent like an RNTupleWriter
34
*
35
* This class is between a field and a ntuple. It carries the offset column for the collection and the default entry
36
* taken from the collection model. It does not, however, own an ntuple model because the collection model has been
37
* merged into the larger ntuple model.
38
*/
39
// clang-format on
40
class
RNTupleCollectionWriter
{
41
friend
class
RCollectionField
;
42
43
private
:
44
std::size_t
fBytesWritten
= 0;
45
ClusterSize_t
fOffset
;
46
std::unique_ptr<REntry>
fDefaultEntry
;
47
48
public
:
49
explicit
RNTupleCollectionWriter
(std::unique_ptr<REntry> defaultEntry)
50
:
fOffset
(0),
fDefaultEntry
(std::move(defaultEntry))
51
{
52
}
53
RNTupleCollectionWriter
(
const
RNTupleCollectionWriter
&) =
delete
;
54
RNTupleCollectionWriter
&
operator=
(
const
RNTupleCollectionWriter
&) =
delete
;
55
~RNTupleCollectionWriter
() =
default
;
56
57
std::size_t
Fill
() {
return
Fill
(*
fDefaultEntry
); }
58
std::size_t
Fill
(
REntry
&entry)
59
{
60
const
std::size_t bytesWritten = entry.
Append
();
61
fBytesWritten
+= bytesWritten;
62
fOffset
++;
63
return
bytesWritten;
64
}
65
66
ClusterSize_t
*
GetOffsetPtr
() {
return
&
fOffset
; }
67
};
// class RNTupleCollectionWriter
68
69
}
// namespace Experimental
70
}
// namespace ROOT
71
72
#endif
// ROOT7_RNTupleCollectionWriter
REntry.hxx
RNTupleUtil.hxx
ROOT::Experimental::RCollectionField
The collection field is only used for writing; when reading, untyped collections are projected to an ...
Definition
RField.hxx:1618
ROOT::Experimental::REntry
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
Definition
REntry.hxx:45
ROOT::Experimental::REntry::Append
std::size_t Append()
Definition
REntry.hxx:92
ROOT::Experimental::RNTupleCollectionWriter
A virtual ntuple used for writing untyped collections that can be used to some extent like an RNTuple...
Definition
RNTupleCollectionWriter.hxx:40
ROOT::Experimental::RNTupleCollectionWriter::fDefaultEntry
std::unique_ptr< REntry > fDefaultEntry
Definition
RNTupleCollectionWriter.hxx:46
ROOT::Experimental::RNTupleCollectionWriter::~RNTupleCollectionWriter
~RNTupleCollectionWriter()=default
ROOT::Experimental::RNTupleCollectionWriter::Fill
std::size_t Fill(REntry &entry)
Definition
RNTupleCollectionWriter.hxx:58
ROOT::Experimental::RNTupleCollectionWriter::GetOffsetPtr
ClusterSize_t * GetOffsetPtr()
Definition
RNTupleCollectionWriter.hxx:66
ROOT::Experimental::RNTupleCollectionWriter::fOffset
ClusterSize_t fOffset
Definition
RNTupleCollectionWriter.hxx:45
ROOT::Experimental::RNTupleCollectionWriter::fBytesWritten
std::size_t fBytesWritten
Definition
RNTupleCollectionWriter.hxx:44
ROOT::Experimental::RNTupleCollectionWriter::RNTupleCollectionWriter
RNTupleCollectionWriter(const RNTupleCollectionWriter &)=delete
ROOT::Experimental::RNTupleCollectionWriter::RNTupleCollectionWriter
RNTupleCollectionWriter(std::unique_ptr< REntry > defaultEntry)
Definition
RNTupleCollectionWriter.hxx:49
ROOT::Experimental::RNTupleCollectionWriter::operator=
RNTupleCollectionWriter & operator=(const RNTupleCollectionWriter &)=delete
ROOT::Experimental::RNTupleCollectionWriter::Fill
std::size_t Fill()
Definition
RNTupleCollectionWriter.hxx:57
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition
EExecutionPolicy.hxx:4
ROOT::Experimental::RClusterSize
Wrap the integer in a struct in order to avoid template specialization clash with std::uint64_t.
Definition
RNTupleUtil.hxx:51
tree
ntuple
v7
inc
ROOT
RNTupleCollectionWriter.hxx
ROOT v6-32 - Reference Guide Generated on Thu Dec 12 2024 15:06:22 (GVA Time) using Doxygen 1.9.8