31namespace Experimental {
102 template <
typename CppT, EColumnType ColumnT>
105 auto column =
new RColumn(model, index);
133 for (
unsigned i = 0; i < count; ++i) {
190 ReadV(globalIndex + nBatch, count - nBatch, &elemTail);
212 template <
typename CppT>
215 return MapV<CppT>(globalIndex, nItems);
218 template <
typename CppT>
221 return MapV<CppT>(clusterIndex, nItems);
224 template <
typename CppT>
231 return reinterpret_cast<CppT*
>(
236 template <
typename CppT>
243 return reinterpret_cast<CppT*
>(
271 idxStart = *Map<ClusterSize_t>(globalIndex - 1);
272 idxEnd = *Map<ClusterSize_t>(globalIndex);
276 idxEnd = *Map<ClusterSize_t>(globalIndex);
278 idxStart = (globalIndex == selfOffset) ? 0 : *Map<ClusterSize_t>(globalIndex - 1);
281 idxEnd = *Map<ClusterSize_t>(globalIndex);
283 *collectionSize = idxEnd - idxStart;
290 auto index = clusterIndex.
GetIndex();
291 auto idxStart = (index == 0) ? 0 : *Map<ClusterSize_t>(clusterIndex - 1);
292 auto idxEnd = *Map<ClusterSize_t>(clusterIndex);
293 *collectionSize = idxEnd - idxStart;
299 auto varSwitch = Map<RColumnSwitch>(globalIndex);
301 *tag = varSwitch->GetTag();
#define R__unlikely(expr)
void WriteTo(void *destination, std::size_t count) const
Write one or multiple column elements into destination.
void ReadFrom(void *source, std::size_t count)
Set the column element or an array of elements from the memory location source.
std::size_t GetSize() const
Pairs of C++ type and column type, like float and EColumnType::kReal32.
static RColumn * Create(const RColumnModel &model, std::uint32_t index)
RPageStorage::ColumnHandle_t GetHandleSource() const
void ReadV(const NTupleSize_t globalIndex, const ClusterSize_t::ValueType count, RColumnElementBase *elemArray)
RColumn & operator=(const RColumn &)=delete
void GetCollectionInfo(const RClusterIndex &clusterIndex, RClusterIndex *collectionStart, ClusterSize_t *collectionSize)
const RColumnModel & GetModel() const
ColumnId_t GetColumnIdSource() const
std::uint32_t GetIndex() const
RPage fReadPage
The currently mapped page for reading.
CppT * MapV(const RClusterIndex &clusterIndex, NTupleSize_t &nItems)
RPageSource * fPageSource
void AppendV(const RColumnElementBase &elemArray, std::size_t count)
RColumnElementBase * GetElement() const
void Append(const RColumnElementBase &element)
RNTupleVersion GetVersion() const
CppT * MapV(const NTupleSize_t globalIndex, NTupleSize_t &nItems)
void FlushShadowWritePage()
When the main write page surpasses the 50% fill level, the (full) shadow write page gets flushed.
void Connect(DescriptorId_t fieldId, RPageStorage *pageStorage)
void MapPage(const NTupleSize_t index)
void SwapWritePagesIfFull()
Used in Append() and AppendV() to switch pages when the main page reached the target size The other p...
void GetSwitchInfo(NTupleSize_t globalIndex, RClusterIndex *varIndex, std::uint32_t *tag)
Get the currently active cluster id.
CppT * Map(const NTupleSize_t globalIndex)
std::uint32_t fApproxNElementsPerPage
For writing, the targeted number of elements, given by fApproxNElementsPerPage (in the write options)...
void Read(const NTupleSize_t globalIndex, RColumnElementBase *element)
CppT * Map(const RClusterIndex &clusterIndex)
NTupleSize_t GetGlobalIndex(const RClusterIndex &clusterIndex)
std::unique_ptr< RColumnElementBase > fElement
Used to pack and unpack pages on writing/reading.
int fWritePageIdx
Index of the current write page.
NTupleSize_t GetNElements() const
RColumn(const RColumn &)=delete
std::uint32_t fIndex
Columns belonging to the same field are distinguished by their order.
RPageStorage::ColumnHandle_t GetHandleSink() const
RPageSource * GetPageSource() const
NTupleSize_t fNElements
The number of elements written resp. available in the column.
ColumnId_t fColumnIdSource
The column id is used to find matching pages with content when reading.
void ReadV(const RClusterIndex &clusterIndex, const ClusterSize_t::ValueType count, RColumnElementBase *elemArray)
RPageStorage::ColumnHandle_t fHandleSink
void Read(const RClusterIndex &clusterIndex, RColumnElementBase *element)
RPageStorage::ColumnHandle_t fHandleSource
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.
RClusterIndex GetClusterIndex(NTupleSize_t globalIndex)
RPage fWritePage[2]
A set of open pages into which new elements are being written.
Abstract interface to write data into an ntuple.
void CommitPage(ColumnHandle_t columnHandle, const RPage &page)
Write a page to the storage. The column must have been added before.
Abstract interface to read data from an ntuple.
Common functionality of an ntuple storage for both reading and writing.
NTupleSize_t GetIndexOffset() const
NTupleSize_t GetId() const
A page is a slice of a column that is mapped into memory.
ClusterSize_t::ValueType GetClusterRangeLast() const
ClusterSize_t::ValueType GetNElements() const
bool Contains(NTupleSize_t globalIndex) const
void * GrowUnchecked(ClusterSize_t::ValueType nElements)
Called during writing: returns a pointer after the last element and increases the element counter in ...
const RClusterInfo & GetClusterInfo() const
void Reset(NTupleSize_t rangeFirst)
Forget all currently stored elements (size == 0) and set a new starting index.
NTupleSize_t GetGlobalRangeFirst() const
NTupleSize_t GetGlobalRangeLast() const
ClusterSize_t::ValueType GetClusterRangeFirst() const
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 a column in a tree.
EColumnType GetType() const
For forward and backward compatibility, attach version information to the consitituents of the file f...
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr ColumnId_t kInvalidColumnId
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...
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...