Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RColumn Class Reference

A column is a storage-backed array of a simple, fixed-size type, from which pages can be mapped into memory.

Definition at line 37 of file RColumn.hxx.

Public Member Functions

 RColumn (const RColumn &)=delete
 ~RColumn ()
void Append (const void *from)
void AppendV (const void *from, std::size_t count)
void CommitSuppressed ()
void ConnectPageSink (ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSink &pageSink, ROOT::NTupleSize_t firstElementIndex=0U)
 Connect the column to a page sink.
void ConnectPageSource (ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSource &pageSource)
 Connect the column to a page source.
void Flush ()
std::uint16_t GetBitsOnStorage () const
RNTupleLocalIndex GetClusterIndex (ROOT::NTupleSize_t globalIndex)
void GetCollectionInfo (const ROOT::NTupleSize_t globalIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *collectionSize)
 For offset columns only, look at the two adjacent values that define a collection's coordinates.
void GetCollectionInfo (RNTupleLocalIndex localIndex, RNTupleLocalIndex *collectionStart, ROOT::NTupleSize_t *collectionSize)
ROOT::Internal::RColumnElementBaseGetElement () const
ROOT::NTupleSize_t GetFirstElementIndex () const
ROOT::NTupleSize_t GetGlobalIndex (RNTupleLocalIndex clusterIndex)
ROOT::Internal::RPageStorage::ColumnHandle_t GetHandleSink () const
ROOT::Internal::RPageStorage::ColumnHandle_t GetHandleSource () const
std::uint32_t GetIndex () const
ROOT::NTupleSize_t GetNElements () const
ROOT::DescriptorId_t GetOnDiskId () const
ROOT::Internal::RPageSinkGetPageSink () const
ROOT::Internal::RPageSourceGetPageSource () const
std::uint16_t GetRepresentationIndex () const
void GetSwitchInfo (ROOT::NTupleSize_t globalIndex, RNTupleLocalIndex *varIndex, std::uint32_t *tag)
 Get the currently active cluster id.
ROOT::ENTupleColumnType GetType () const
std::optional< std::pair< double, double > > GetValueRange () const
std::size_t GetWritePageCapacity () const
template<typename CppT>
CppT * Map (const ROOT::NTupleSize_t globalIndex)
template<typename CppT>
CppT * Map (RNTupleLocalIndex localIndex)
void MapPage (RNTupleLocalIndex localIndex)
void MapPage (ROOT::NTupleSize_t globalIndex)
template<typename CppT>
CppT * MapV (const ROOT::NTupleSize_t globalIndex, ROOT::NTupleSize_t &nItems)
template<typename CppT>
CppT * MapV (RNTupleLocalIndex localIndex, ROOT::NTupleSize_t &nItems)
void MergeTeams (RColumn &other)
RColumnoperator= (const RColumn &)=delete
void Read (const ROOT::NTupleSize_t globalIndex, void *to)
void Read (RNTupleLocalIndex localIndex, void *to)
bool ReadPageContains (RNTupleLocalIndex localIndex) const
bool ReadPageContains (ROOT::NTupleSize_t globalIndex) const
void ReadV (RNTupleLocalIndex localIndex, ROOT::NTupleSize_t count, void *to)
void ReadV (ROOT::NTupleSize_t globalIndex, ROOT::NTupleSize_t count, void *to)
void SetBitsOnStorage (std::size_t bits)
void SetValueRange (double min, double max)
bool TryMapPage (RNTupleLocalIndex localIndex)
bool TryMapPage (ROOT::NTupleSize_t globalIndex)

Static Public Member Functions

template<typename CppT>
static std::unique_ptr< RColumnCreate (ROOT::ENTupleColumnType type, std::uint32_t columnIdx, std::uint16_t representationIdx)

Private Member Functions

 RColumn (ROOT::ENTupleColumnType type, std::uint32_t columnIndex, std::uint16_t representationIndex)
void HandleWritePageIfFull ()
 Used when trying to append to a full write page.

Private Attributes

std::unique_ptr< ROOT::Internal::RColumnElementBasefElement
 Used to pack and unpack pages on writing/reading.
ROOT::NTupleSize_t fFirstElementIndex = 0
 Global index of the first element in this column; usually == 0, unless it is a deferred column.
ROOT::Internal::RPageStorage::ColumnHandle_t fHandleSink
ROOT::Internal::RPageStorage::ColumnHandle_t fHandleSource
std::uint32_t fIndex
 Columns belonging to the same field are distinguished by their order.
ROOT::NTupleSize_t fInitialNElements = 1
 The initial number of elements in a page.
std::size_t fLastGoodTeamIdx = 0
 Points into fTeam to the column that successfully returned the last page.
ROOT::NTupleSize_t fNElements = 0
 The number of elements written resp. available in the column.
ROOT::DescriptorId_t fOnDiskId = ROOT::kInvalidDescriptorId
 The column id in the column descriptor, once connected to a sink or source.
ROOT::Internal::RPageSinkfPageSink = nullptr
ROOT::Internal::RPageSourcefPageSource = nullptr
ROOT::Internal::RPageRef fReadPageRef
 The currently mapped page for reading.
std::uint16_t fRepresentationIndex
 Fields can have multiple column representations, distinguished by representation index.
std::vector< RColumn * > fTeam
 The column team is a set of columns that serve the same column index for different representation IDs.
ROOT::ENTupleColumnType fType
ROOT::Internal::RPage fWritePage
 The page into which new elements are being written.

#include <ROOT/RColumn.hxx>

Constructor & Destructor Documentation

◆ RColumn() [1/2]

ROOT::Internal::RColumn::RColumn ( ROOT::ENTupleColumnType type,
std::uint32_t columnIndex,
std::uint16_t representationIndex )
private

◆ RColumn() [2/2]

◆ ~RColumn()

Definition at line 31 of file RColumn.cxx.

Member Function Documentation

◆ Append()

void ROOT::Internal::RColumn::Append ( const void * from)
inline

Definition at line 125 of file RColumn.hxx.

◆ AppendV()

void ROOT::Internal::RColumn::AppendV ( const void * from,
std::size_t count )
inline

Definition at line 137 of file RColumn.hxx.

◆ CommitSuppressed()

Definition at line 79 of file RColumn.cxx.

◆ ConnectPageSink()

Connect the column to a page sink.

firstElementIndex can be used to specify the first column element index with backing storage for this column. On read back, elements before firstElementIndex will cause the zero page to be mapped.

Definition at line 39 of file RColumn.cxx.

◆ ConnectPageSource()

Connect the column to a page source.

Definition at line 56 of file RColumn.cxx.

◆ Create()

template<typename CppT>
std::unique_ptr< RColumn > ROOT::Internal::RColumn::Create ( ROOT::ENTupleColumnType type,
std::uint32_t columnIdx,
std::uint16_t representationIdx )
inlinestatic

Definition at line 106 of file RColumn.hxx.

◆ Flush()

Definition at line 68 of file RColumn.cxx.

◆ GetBitsOnStorage()

std::uint16_t ROOT::Internal::RColumn::GetBitsOnStorage ( ) const
inline

Definition at line 340 of file RColumn.hxx.

◆ GetClusterIndex()

RNTupleLocalIndex ROOT::Internal::RColumn::GetClusterIndex ( ROOT::NTupleSize_t globalIndex)
inline

Definition at line 272 of file RColumn.hxx.

◆ GetCollectionInfo() [1/2]

void ROOT::Internal::RColumn::GetCollectionInfo ( const ROOT::NTupleSize_t globalIndex,
RNTupleLocalIndex * collectionStart,
ROOT::NTupleSize_t * collectionSize )
inline

For offset columns only, look at the two adjacent values that define a collection's coordinates.

Definition at line 282 of file RColumn.hxx.

◆ GetCollectionInfo() [2/2]

void ROOT::Internal::RColumn::GetCollectionInfo ( RNTupleLocalIndex localIndex,
RNTupleLocalIndex * collectionStart,
ROOT::NTupleSize_t * collectionSize )
inline

Definition at line 306 of file RColumn.hxx.

◆ GetElement()

◆ GetFirstElementIndex()

◆ GetGlobalIndex()

ROOT::NTupleSize_t ROOT::Internal::RColumn::GetGlobalIndex ( RNTupleLocalIndex clusterIndex)
inline

Definition at line 264 of file RColumn.hxx.

◆ GetHandleSink()

◆ GetHandleSource()

◆ GetIndex()

std::uint32_t ROOT::Internal::RColumn::GetIndex ( ) const
inline

Definition at line 350 of file RColumn.hxx.

◆ GetNElements()

Definition at line 337 of file RColumn.hxx.

◆ GetOnDiskId()

Definition at line 352 of file RColumn.hxx.

◆ GetPageSink()

Definition at line 355 of file RColumn.hxx.

◆ GetPageSource()

◆ GetRepresentationIndex()

std::uint16_t ROOT::Internal::RColumn::GetRepresentationIndex ( ) const
inline

Definition at line 351 of file RColumn.hxx.

◆ GetSwitchInfo()

void ROOT::Internal::RColumn::GetSwitchInfo ( ROOT::NTupleSize_t globalIndex,
RNTupleLocalIndex * varIndex,
std::uint32_t * tag )
inline

Get the currently active cluster id.

Definition at line 317 of file RColumn.hxx.

◆ GetType()

Definition at line 339 of file RColumn.hxx.

◆ GetValueRange()

std::optional< std::pair< double, double > > ROOT::Internal::RColumn::GetValueRange ( ) const
inline

Definition at line 345 of file RColumn.hxx.

◆ GetWritePageCapacity()

std::size_t ROOT::Internal::RColumn::GetWritePageCapacity ( ) const
inline

Definition at line 360 of file RColumn.hxx.

◆ HandleWritePageIfFull()

Used when trying to append to a full write page.

If possible, expand the page. Otherwise, flush and reset to the minimal size.

Definition at line 78 of file RColumn.hxx.

◆ Map() [1/2]

template<typename CppT>
CppT * ROOT::Internal::RColumn::Map ( const ROOT::NTupleSize_t globalIndex)
inline

Definition at line 226 of file RColumn.hxx.

◆ Map() [2/2]

template<typename CppT>
CppT * ROOT::Internal::RColumn::Map ( RNTupleLocalIndex localIndex)
inline

Definition at line 233 of file RColumn.hxx.

◆ MapPage() [1/2]

void ROOT::Internal::RColumn::MapPage ( RNTupleLocalIndex localIndex)
inline

Definition at line 328 of file RColumn.hxx.

◆ MapPage() [2/2]

Definition at line 327 of file RColumn.hxx.

◆ MapV() [1/2]

template<typename CppT>
CppT * ROOT::Internal::RColumn::MapV ( const ROOT::NTupleSize_t globalIndex,
ROOT::NTupleSize_t & nItems )
inline

Definition at line 240 of file RColumn.hxx.

◆ MapV() [2/2]

template<typename CppT>
CppT * ROOT::Internal::RColumn::MapV ( RNTupleLocalIndex localIndex,
ROOT::NTupleSize_t & nItems )
inline

Definition at line 252 of file RColumn.hxx.

◆ MergeTeams()

Definition at line 114 of file RColumn.cxx.

◆ operator=()

RColumn & ROOT::Internal::RColumn::operator= ( const RColumn & )
delete

◆ Read() [1/2]

void ROOT::Internal::RColumn::Read ( const ROOT::NTupleSize_t globalIndex,
void * to )
inline

Definition at line 159 of file RColumn.hxx.

◆ Read() [2/2]

void ROOT::Internal::RColumn::Read ( RNTupleLocalIndex localIndex,
void * to )
inline

Definition at line 170 of file RColumn.hxx.

◆ ReadPageContains() [1/2]

bool ROOT::Internal::RColumn::ReadPageContains ( RNTupleLocalIndex localIndex) const
inline

Definition at line 333 of file RColumn.hxx.

◆ ReadPageContains() [2/2]

Definition at line 332 of file RColumn.hxx.

◆ ReadV() [1/2]

void ROOT::Internal::RColumn::ReadV ( RNTupleLocalIndex localIndex,
ROOT::NTupleSize_t count,
void * to )
inline

Definition at line 203 of file RColumn.hxx.

◆ ReadV() [2/2]

void ROOT::Internal::RColumn::ReadV ( ROOT::NTupleSize_t globalIndex,
ROOT::NTupleSize_t count,
void * to )
inline

Definition at line 181 of file RColumn.hxx.

◆ SetBitsOnStorage()

void ROOT::Internal::RColumn::SetBitsOnStorage ( std::size_t bits)
inline

Definition at line 359 of file RColumn.hxx.

◆ SetValueRange()

Definition at line 361 of file RColumn.hxx.

◆ TryMapPage() [1/2]

bool ROOT::Internal::RColumn::TryMapPage ( RNTupleLocalIndex localIndex)

Definition at line 99 of file RColumn.cxx.

◆ TryMapPage() [2/2]

Definition at line 84 of file RColumn.cxx.

Member Data Documentation

◆ fElement

Used to pack and unpack pages on writing/reading.

Definition at line 65 of file RColumn.hxx.

◆ fFirstElementIndex

Global index of the first element in this column; usually == 0, unless it is a deferred column.

Definition at line 63 of file RColumn.hxx.

◆ fHandleSink

◆ fHandleSource

◆ fIndex

std::uint32_t ROOT::Internal::RColumn::fIndex
private

Columns belonging to the same field are distinguished by their order.

E.g. for an std::string field, there is the offset column with index 0 and the character value column with index 1.

Definition at line 42 of file RColumn.hxx.

◆ fInitialNElements

The initial number of elements in a page.

Definition at line 55 of file RColumn.hxx.

◆ fLastGoodTeamIdx

Points into fTeam to the column that successfully returned the last page.

Definition at line 72 of file RColumn.hxx.

◆ fNElements

The number of elements written resp. available in the column.

Definition at line 57 of file RColumn.hxx.

◆ fOnDiskId

The column id in the column descriptor, once connected to a sink or source.

Definition at line 61 of file RColumn.hxx.

◆ fPageSink

Definition at line 45 of file RColumn.hxx.

◆ fPageSource

Definition at line 46 of file RColumn.hxx.

◆ fReadPageRef

The currently mapped page for reading.

Definition at line 59 of file RColumn.hxx.

◆ fRepresentationIndex

Fields can have multiple column representations, distinguished by representation index.

Definition at line 44 of file RColumn.hxx.

◆ fTeam

std::vector<RColumn *> ROOT::Internal::RColumn::fTeam
private

The column team is a set of columns that serve the same column index for different representation IDs.

Initially, the team has only one member, the very column it belongs to. Through MergeTeams(), two columns can join forces. The team is used to react on suppressed columns: if the current team member has a suppressed column for a MapPage() call, it get the page from the active column in the corresponding cluster.

Definition at line 70 of file RColumn.hxx.

◆ fType

◆ fWritePage

The page into which new elements are being written.

The page will initially be small (RNTupleWriteOptions::fInitialUnzippedPageSize, which corresponds to fInitialElements) and expand as needed and as memory for page buffers is still available (RNTupleWriteOptions::fPageBufferBudget) or the maximum page size is reached (RNTupleWriteOptions::fMaxUnzippedPageSize).

Definition at line 53 of file RColumn.hxx.


The documentation for this class was generated from the following files: