13#ifndef ROOT_RColumnElementBase
14#define ROOT_RColumnElementBase
57 std::optional<std::pair<double, double>>
fValueRange = std::nullopt;
86 template <
typename CppT =
void>
104 throw RException(
R__FAIL(std::string(
"internal error: cannot change bit width of this column type")));
109 throw RException(
R__FAIL(std::string(
"internal error: cannot change value range of this column type")));
113 virtual void Pack(
void *destination,
const void *source, std::size_t count)
const
115 std::memcpy(destination, source, count);
119 virtual void Unpack(
void *destination,
const void *source, std::size_t count)
const
121 std::memcpy(destination, source, count);
136std::unique_ptr<RColumnElementBase>
141template <
typename CppT>
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Basic types used by ROOT and required by TInterpreter.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
RColumnElementBase(std::size_t size, std::size_t bitsOnStorage=0)
virtual bool IsMappable() const
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
static const char * GetColumnTypeName(ROOT::ENTupleColumnType type)
std::size_t GetBitsOnStorage() const
RColumnElementBase & operator=(RColumnElementBase &&other)=default
std::size_t fBitsOnStorage
static std::unique_ptr< RColumnElementBase > Generate(ROOT::ENTupleColumnType type)
If CppT == void, use the default C++ type for the given column type.
virtual void SetBitsOnStorage(std::size_t bitsOnStorage)
static std::pair< std::uint16_t, std::uint16_t > GetValidBitRange(ROOT::ENTupleColumnType type)
Most types have a fixed on-disk bit width.
RColumnElementBase(std::size_t size, std::size_t bitsOnStorage=0)
std::optional< std::pair< double, double > > GetValueRange() const
RColumnElementBase & operator=(const RColumnElementBase &other)=delete
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-...
std::size_t fSize
Size of the C++ value that corresponds to the on-disk element.
RColumnElementBase(const RColumnElementBase &other)=default
std::optional< std::pair< double, double > > fValueRange
This is only meaningful for column elements that support it (e.g. Real32Quant).
std::size_t GetSize() const
virtual ~RColumnElementBase()=default
virtual RIdentifier GetIdentifier() const =0
RColumnElementBase(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-...
std::size_t GetPackedSize(std::size_t nElements=1U) const
Base class for all ROOT issued exceptions.
std::unique_ptr< RColumnElementBase > GenerateColumnElement(std::type_index inMemoryType, ROOT::ENTupleColumnType onDiskType)
Every concrete RColumnElement type is identified by its on-disk type (column type) and the in-memory ...
Every concrete RColumnElement type is identified by its on-disk type (column type) and the in-memory ...
std::type_index fInMemoryType
bool operator!=(const RIdentifier &other) const
bool operator==(const RIdentifier &other) const
ROOT::ENTupleColumnType fOnDiskType