103 template <
typename CppT>
106 auto column = std::unique_ptr<RColumn>(
new RColumn(model,
index));
130 std::memcpy(dst, from,
fElement->GetSize());
136 void AppendV(
const void *from, std::size_t count)
141 for (
unsigned i = 0;
i < count; ++
i) {
142 Append(
static_cast<const unsigned char *
>(from) +
fElement->GetSize() *
i);
160 std::memcpy(dst, from,
fElement->GetSize() * count);
172 const auto elemSize =
fElement->GetSize();
173 void *from =
static_cast<unsigned char *
>(
fReadPage.GetBuffer()) +
174 (globalIndex -
fReadPage.GetGlobalRangeFirst()) * elemSize;
175 std::memcpy(to, from, elemSize);
183 const auto elemSize =
fElement->GetSize();
184 void *from =
static_cast<unsigned char *
>(
fReadPage.GetBuffer()) +
186 std::memcpy(to, from, elemSize);
196 const auto elemSize =
fElement->GetSize();
197 const void *from =
static_cast<unsigned char *
>(
fReadPage.GetBuffer()) + idxInPage * elemSize;
198 if (globalIndex + count <=
fReadPage.GetGlobalRangeLast() + 1) {
199 std::memcpy(to, from, elemSize * count);
202 std::memcpy(to, from, elemSize * nBatch);
203 auto tail =
static_cast<unsigned char *
>(to) + nBatch * elemSize;
204 ReadV(globalIndex + nBatch, count - nBatch, tail);
215 const auto elemSize =
fElement->GetSize();
216 const void *from =
static_cast<unsigned char *
>(
fReadPage.GetBuffer()) + idxInPage * elemSize;
218 std::memcpy(to, from, elemSize * count);
221 std::memcpy(to, from, elemSize * nBatch);
222 auto tail =
static_cast<unsigned char *
>(to) + nBatch * elemSize;
227 template <
typename CppT>
233 template <
typename CppT>
240 template <
typename CppT>
246 nItems =
fReadPage.GetGlobalRangeLast() - globalIndex + 1;
247 return reinterpret_cast<CppT*
>(
248 static_cast<unsigned char *
>(
fReadPage.GetBuffer()) +
252 template <
typename CppT>
260 return reinterpret_cast<CppT*
>(
261 static_cast<unsigned char *
>(
fReadPage.GetBuffer()) +
278 globalIndex -
fReadPage.GetClusterInfo().GetIndexOffset());
295 auto selfOffset =
fReadPage.GetClusterInfo().GetIndexOffset();
301 *collectionSize = idxEnd - idxStart;
310 *collectionSize = idxEnd - idxStart;
318 *tag = varSwitch->GetTag();
#define R__unlikely(expr)
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
A column element encapsulates the translation between basic C++ types and their column representation...
static std::unique_ptr< RColumnElementBase > Generate(EColumnType type)
If CppT == void, use the default C++ type for the given column type.
RColumn(const RColumn &)=delete
RPageStorage::ColumnHandle_t GetHandleSink() const
void Read(RClusterIndex clusterIndex, void *to)
void ConnectPageSink(DescriptorId_t fieldId, RPageSink &pageSink, NTupleSize_t firstElementIndex=0U)
Connect the column to a page sink.
std::unique_ptr< RColumnElementBase > fElement
Used to pack and unpack pages on writing/reading.
NTupleSize_t GetGlobalIndex(RClusterIndex clusterIndex)
RColumnElementBase * GetElement() const
void GetCollectionInfo(RClusterIndex clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
ColumnId_t fColumnIdSource
The column id is used to find matching pages with content when reading.
void ReadV(RClusterIndex clusterIndex, const ClusterSize_t::ValueType count, void *to)
int fWritePageIdx
Index of the current write page.
CppT * Map(const NTupleSize_t globalIndex)
RPageSource * GetPageSource() const
RPageSource * fPageSource
void AppendV(const void *from, std::size_t count)
void Append(const void *from)
CppT * Map(RClusterIndex clusterIndex)
CppT * MapV(RClusterIndex clusterIndex, NTupleSize_t &nItems)
RColumn & operator=(const RColumn &)=delete
RPageStorage::ColumnHandle_t fHandleSource
void SwapWritePagesIfFull()
Used in Append() and AppendV() to switch pages when the main page reached the target size The other p...
NTupleSize_t fNElements
The number of elements written resp. available in the column.
void ReadV(const NTupleSize_t globalIndex, const ClusterSize_t::ValueType count, void *to)
void Read(const NTupleSize_t globalIndex, void *to)
void MapPage(const NTupleSize_t index)
std::uint32_t fIndex
Columns belonging to the same field are distinguished by their order.
std::uint32_t GetIndex() const
ColumnId_t GetColumnIdSource() const
void ConnectPageSource(DescriptorId_t fieldId, RPageSource &pageSource)
Connect the column to a page source.
std::uint32_t fApproxNElementsPerPage
For writing, the targeted number of elements, given by fApproxNElementsPerPage (in the write options)...
RPageSink * GetPageSink() const
void GetCollectionInfo(const NTupleSize_t globalIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
For offset columns only, look at the two adjacent values that define a collection's coordinates.
CppT * MapV(const NTupleSize_t globalIndex, NTupleSize_t &nItems)
RColumn(const RColumnModel &model, std::uint32_t index)
static std::unique_ptr< RColumn > Create(const RColumnModel &model, std::uint32_t index)
const RColumnModel & GetModel() const
void GetSwitchInfo(NTupleSize_t globalIndex, RClusterIndex *varIndex, std::uint32_t *tag)
Get the currently active cluster id.
RPageStorage::ColumnHandle_t fHandleSink
void FlushShadowWritePage()
When the main write page surpasses the 50% fill level, the (full) shadow write page gets flushed.
RPage fWritePage[2]
A set of open pages into which new elements are being written.
NTupleSize_t GetNElements() const
NTupleSize_t GetFirstElementIndex() const
RPageStorage::ColumnHandle_t GetHandleSource() const
RClusterIndex GetClusterIndex(NTupleSize_t globalIndex)
RPage fReadPage
The currently mapped page for reading.
NTupleSize_t fFirstElementIndex
Global index of the first element in this column; usually == 0, unless it is a deferred column.
Abstract interface to write data into an ntuple.
Abstract interface to read data from an ntuple.
RColumnHandle ColumnHandle_t
The column handle identifies a column with the current open page storage.
A page is a slice of a column that is mapped into memory.
Addresses a column element or field item relative to a particular cluster, instead of a global NTuple...
DescriptorId_t GetClusterId() const
ClusterSize_t::ValueType GetIndex() const
Holds the static meta-data of an RNTuple column.
EColumnType GetType() const
RClusterSize ClusterSize_t
constexpr ColumnId_t kInvalidColumnId
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::int64_t ColumnId_t
Uniquely identifies a physical column within the scope of the current process, used to tag pages.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...