31namespace Experimental {
70 template <
typename CppT, EColumnType ColumnT>
73 auto column =
new RColumn(model, index);
98 for (
unsigned i = 0; i < count; ++i) {
138 ReadV(globalIndex + nBatch, count - nBatch, &elemTail);
160 template <
typename CppT, EColumnType ColumnT>
165 return reinterpret_cast<CppT*
>(
170 template <
typename CppT, EColumnType ColumnT>
175 return reinterpret_cast<CppT*
>(
198 auto idxStart = (globalIndex == 0) ? 0 : *Map<ClusterSize_t, EColumnType::kIndex>(globalIndex - 1);
199 auto idxEnd = *Map<ClusterSize_t, EColumnType::kIndex>(globalIndex);
201 if (globalIndex == selfOffset) {
205 *collectionSize = idxEnd - idxStart;
212 auto index = clusterIndex.
GetIndex();
213 auto idxStart = (index == 0) ? 0 : *Map<ClusterSize_t, EColumnType::kIndex>(clusterIndex - 1);
214 auto idxEnd = *Map<ClusterSize_t, EColumnType::kIndex>(clusterIndex);
215 *collectionSize = idxEnd - idxStart;
221 auto varSwitch = Map<RColumnSwitch, EColumnType::kSwitch>(globalIndex);
223 *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
RColumn(const RColumnModel &model, std::uint32_t index)
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.
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...