30namespace Experimental {
69 template <
typename CppT, EColumnType ColumnT>
72 auto column =
new RColumn(model, index);
97 for (
unsigned i = 0; i < count; ++i) {
139 ReadV(globalIndex + nBatch, count - nBatch, &elemTail);
161 template <
typename CppT, EColumnType ColumnT>
166 return reinterpret_cast<CppT*
>(
171 template <
typename CppT, EColumnType ColumnT>
176 return reinterpret_cast<CppT*
>(
199 auto idxStart = (globalIndex == 0) ? 0 : *Map<ClusterSize_t, EColumnType::kIndex>(globalIndex - 1);
200 auto idxEnd = *Map<ClusterSize_t, EColumnType::kIndex>(globalIndex);
202 if (globalIndex == selfOffset) {
206 *collectionSize = idxEnd - idxStart;
213 auto index = clusterIndex.
GetIndex();
214 auto idxStart = (index == 0) ? 0 : *Map<ClusterSize_t, EColumnType::kIndex>(clusterIndex - 1);
215 auto idxEnd = *Map<ClusterSize_t, EColumnType::kIndex>(clusterIndex);
216 *collectionSize = idxEnd - idxStart;
222 auto varSwitch = Map<RColumnSwitch, EColumnType::kSwitch>(globalIndex);
224 *tag = varSwitch->GetTag();
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
RPage fHeadPage
Open page into which new elements are being written.
ColumnId_t GetColumnIdSource() const
std::uint32_t GetIndex() const
RPageSource * fPageSource
void AppendV(const RColumnElementBase &elemArray, std::size_t count)
RColumnElementBase * GetElement() const
void Append(const RColumnElementBase &element)
RNTupleVersion GetVersion() const
CppT * Map(const NTupleSize_t globalIndex)
void Connect(DescriptorId_t fieldId, RPageStorage *pageStorage)
void MapPage(const NTupleSize_t index)
void GetSwitchInfo(NTupleSize_t globalIndex, RClusterIndex *varIndex, std::uint32_t *tag)
Get the currently active cluster id.
void Read(const NTupleSize_t globalIndex, RColumnElementBase *element)
NTupleSize_t GetGlobalIndex(const RClusterIndex &clusterIndex)
std::unique_ptr< RColumnElementBase > fElement
Used to pack and unpack pages on writing/reading.
NTupleSize_t GetNElements() const
RColumn(const RColumn &)=delete
RPage fCurrentPage
The currently mapped page for reading.
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.
CppT * Map(const RClusterIndex &clusterIndex)
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)
Abstract interface to write data into an ntuple.
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
const RClusterInfo & GetClusterInfo() const
NTupleSize_t GetGlobalRangeFirst() const
NTupleSize_t GetGlobalRangeLast() const
void * TryGrow(ClusterSize_t::ValueType nElements)
Return a pointer after the last element that has space for nElements new elements.
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.
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...