Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::RColumnElementBase Class Referenceabstract

A column element encapsulates the translation between basic C++ types and their column representation.

Usually the on-disk element should map bitwise to the in-memory element. Sometimes that's not the case though, for instance on big endian platforms or for bools.

There is a template specialization for every valid pair of C++ type and column representation. These specialized child classes are responsible for overriding Pack() / Unpack() for packing / unpacking elements as appropriate.

Definition at line 54 of file RColumnElementBase.hxx.

Classes

struct  RIdentifier
 Every concrete RColumnElement type is identified by its on-disk type (column type) and the in-memory C++ type, given by a type index. More...
 

Public Member Functions

 RColumnElementBase (const RColumnElementBase &other)=default
 
 RColumnElementBase (RColumnElementBase &&other)=default
 
virtual ~RColumnElementBase ()=default
 
std::size_t GetBitsOnStorage () const
 
virtual RIdentifier GetIdentifier () const =0
 
std::size_t GetPackedSize (std::size_t nElements=1U) const
 
std::size_t GetSize () const
 
std::optional< std::pair< double, double > > GetValueRange () const
 
virtual bool IsMappable () const
 Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
 
RColumnElementBaseoperator= (const RColumnElementBase &other)=delete
 
RColumnElementBaseoperator= (RColumnElementBase &&other)=default
 
virtual void Pack (void *destination, const void *source, std::size_t count) const
 If the on-storage layout and the in-memory layout differ, packing creates an on-disk page from an in-memory page.
 
virtual void SetBitsOnStorage (std::size_t bitsOnStorage)
 
virtual void SetValueRange (double, double)
 
virtual void Unpack (void *destination, const void *source, std::size_t count) const
 If the on-storage layout and the in-memory layout differ, unpacking creates a memory page from an on-storage page.
 

Static Public Member Functions

template<>
std::unique_ptr< RColumnElementBaseGenerate (EColumnType onDiskType)
 
template<>
std::unique_ptr< ROOT::Experimental::Internal::RColumnElementBaseGenerate (EColumnType onDiskType)
 
template<typename CppT = void>
static std::unique_ptr< RColumnElementBaseGenerate (EColumnType type)
 If CppT == void, use the default C++ type for the given column type.
 
static const char * GetColumnTypeName (EColumnType type)
 
static std::pair< std::uint16_t, std::uint16_t > GetValidBitRange (EColumnType type)
 Most types have a fixed on-disk bit width.
 

Protected Member Functions

 RColumnElementBase (std::size_t size, std::size_t bitsOnStorage=0)
 

Protected Attributes

std::size_t fBitsOnStorage
 
std::size_t fSize
 Size of the C++ value that corresponds to the on-disk element.
 
std::optional< std::pair< double, double > > fValueRange = std::nullopt
 This is only meaningful for column elements that support it (e.g. Real32Quant)
 

#include <ROOT/RColumnElementBase.hxx>

Constructor & Destructor Documentation

◆ RColumnElementBase() [1/3]

ROOT::Experimental::Internal::RColumnElementBase::RColumnElementBase ( std::size_t  size,
std::size_t  bitsOnStorage = 0 
)
inlineexplicitprotected

Definition at line 62 of file RColumnElementBase.hxx.

◆ RColumnElementBase() [2/3]

ROOT::Experimental::Internal::RColumnElementBase::RColumnElementBase ( const RColumnElementBase other)
default

◆ RColumnElementBase() [3/3]

ROOT::Experimental::Internal::RColumnElementBase::RColumnElementBase ( RColumnElementBase &&  other)
default

◆ ~RColumnElementBase()

virtual ROOT::Experimental::Internal::RColumnElementBase::~RColumnElementBase ( )
virtualdefault

Member Function Documentation

◆ Generate() [1/3]

template<>
std::unique_ptr< RColumnElementBase > ROOT::Experimental::Internal::RColumnElementBase::Generate ( EColumnType  onDiskType)
static

◆ Generate() [2/3]

template<>
std::unique_ptr< ROOT::Experimental::Internal::RColumnElementBase > ROOT::Experimental::Internal::RColumnElementBase::Generate ( EColumnType  onDiskType)
static

Definition at line 70 of file RColumnElement.cxx.

◆ Generate() [3/3]

template<typename CppT >
std::unique_ptr< RColumnElementBase > ROOT::Experimental::Internal::RColumnElementBase::Generate ( EColumnType  type)
static

If CppT == void, use the default C++ type for the given column type.

Definition at line 144 of file RColumnElementBase.hxx.

◆ GetBitsOnStorage()

std::size_t ROOT::Experimental::Internal::RColumnElementBase::GetBitsOnStorage ( ) const
inline

Definition at line 128 of file RColumnElementBase.hxx.

◆ GetColumnTypeName()

const char * ROOT::Experimental::Internal::RColumnElementBase::GetColumnTypeName ( EColumnType  type)
static

Definition at line 70 of file RColumnElement.cxx.

◆ GetIdentifier()

virtual RIdentifier ROOT::Experimental::Internal::RColumnElementBase::GetIdentifier ( ) const
pure virtual

◆ GetPackedSize()

std::size_t ROOT::Experimental::Internal::RColumnElementBase::GetPackedSize ( std::size_t  nElements = 1U) const
inline

Definition at line 130 of file RColumnElementBase.hxx.

◆ GetSize()

std::size_t ROOT::Experimental::Internal::RColumnElementBase::GetSize ( ) const
inline

Definition at line 127 of file RColumnElementBase.hxx.

◆ GetValidBitRange()

std::pair< std::uint16_t, std::uint16_t > ROOT::Experimental::Internal::RColumnElementBase::GetValidBitRange ( EColumnType  type)
static

Most types have a fixed on-disk bit width.

Some low-precision column types have a range of possible bit widths. Return the minimum and maximum allowed bit size per type.

Definition at line 29 of file RColumnElement.cxx.

◆ GetValueRange()

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

Definition at line 129 of file RColumnElementBase.hxx.

◆ IsMappable()

virtual bool ROOT::Experimental::Internal::RColumnElementBase::IsMappable ( ) const
inlinevirtual

Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.

Definition at line 98 of file RColumnElementBase.hxx.

◆ operator=() [1/2]

RColumnElementBase & ROOT::Experimental::Internal::RColumnElementBase::operator= ( const RColumnElementBase other)
delete

◆ operator=() [2/2]

RColumnElementBase & ROOT::Experimental::Internal::RColumnElementBase::operator= ( RColumnElementBase &&  other)
default

◆ Pack()

virtual void ROOT::Experimental::Internal::RColumnElementBase::Pack ( void *  destination,
const void *  source,
std::size_t  count 
) const
inlinevirtual

If the on-storage layout and the in-memory layout differ, packing creates an on-disk page from an in-memory page.

Definition at line 116 of file RColumnElementBase.hxx.

◆ SetBitsOnStorage()

virtual void ROOT::Experimental::Internal::RColumnElementBase::SetBitsOnStorage ( std::size_t  bitsOnStorage)
inlinevirtual

Definition at line 104 of file RColumnElementBase.hxx.

◆ SetValueRange()

virtual void ROOT::Experimental::Internal::RColumnElementBase::SetValueRange ( double  ,
double   
)
inlinevirtual

Definition at line 110 of file RColumnElementBase.hxx.

◆ Unpack()

virtual void ROOT::Experimental::Internal::RColumnElementBase::Unpack ( void *  destination,
const void *  source,
std::size_t  count 
) const
inlinevirtual

If the on-storage layout and the in-memory layout differ, unpacking creates a memory page from an on-storage page.

Definition at line 122 of file RColumnElementBase.hxx.

Member Data Documentation

◆ fBitsOnStorage

std::size_t ROOT::Experimental::Internal::RColumnElementBase::fBitsOnStorage
protected

Definition at line 58 of file RColumnElementBase.hxx.

◆ fSize

std::size_t ROOT::Experimental::Internal::RColumnElementBase::fSize
protected

Size of the C++ value that corresponds to the on-disk element.

Definition at line 57 of file RColumnElementBase.hxx.

◆ fValueRange

std::optional<std::pair<double, double> > ROOT::Experimental::Internal::RColumnElementBase::fValueRange = std::nullopt
protected

This is only meaningful for column elements that support it (e.g. Real32Quant)

Definition at line 60 of file RColumnElementBase.hxx.

Libraries for ROOT::Experimental::Internal::RColumnElementBase:

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