16#ifndef ROOT7_RColumnElementBase
17#define ROOT7_RColumnElementBase
59 std::optional<std::pair<double, double>>
fValueRange = std::nullopt;
74 template <
typename CppT =
void>
92 throw RException(
R__FAIL(std::string(
"internal error: cannot change bit width of this column type")));
97 throw RException(
R__FAIL(std::string(
"internal error: cannot change value range of this column type")));
101 virtual void Pack(
void *destination,
const void *source, std::size_t count)
const
103 std::memcpy(destination, source, count);
107 virtual void Unpack(
void *destination,
const void *source, std::size_t count)
const
109 std::memcpy(destination, source, count);
139 static_cast<EColumnCppType>(std::numeric_limits<std::underlying_type_t<EColumnCppType>>::max() - 1);
147template <
typename CppT>
150 if constexpr (std::is_same_v<CppT, char>)
152 else if constexpr (std::is_same_v<CppT, bool>)
154 else if constexpr (std::is_same_v<CppT, std::byte>)
156 else if constexpr (std::is_same_v<CppT, std::uint8_t>)
158 else if constexpr (std::is_same_v<CppT, std::uint16_t>)
160 else if constexpr (std::is_same_v<CppT, std::uint32_t>)
162 else if constexpr (std::is_same_v<CppT, std::uint64_t>)
164 else if constexpr (std::is_same_v<CppT, std::int8_t>)
166 else if constexpr (std::is_same_v<CppT, std::int16_t>)
168 else if constexpr (std::is_same_v<CppT, std::int32_t>)
170 else if constexpr (std::is_same_v<CppT, std::int64_t>)
172 else if constexpr (std::is_same_v<CppT, float>)
174 else if constexpr (std::is_same_v<CppT, double>)
176 else if constexpr (std::is_same_v<CppT, ClusterSize_t>)
178 else if constexpr (std::is_same_v<CppT, RColumnSwitch>)
180 else if constexpr (std::is_same_v<CppT, RTestFutureColumn>)
183 static_assert(!
sizeof(CppT),
"Unsupported Cpp type");
187std::unique_ptr<RColumnElementBase> RColumnElementBase::Generate<void>(
EColumnType type);
#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
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
A column element encapsulates the translation between basic C++ types and their column representation...
RColumnElementBase & operator=(const RColumnElementBase &other)=delete
std::size_t fBitsOnStorage
RColumnElementBase(std::size_t size, std::size_t bitsOnStorage=0)
std::size_t GetSize() const
virtual void SetValueRange(double, double)
virtual bool IsMappable() const
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
std::optional< std::pair< double, double > > fValueRange
This is only meaningful for column elements that support it (e.g. Real32Quant)
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-...
static std::string GetTypeName(EColumnType type)
std::size_t fSize
Size of the C++ value that corresponds to the on-disk element.
std::size_t GetBitsOnStorage() const
std::optional< std::pair< double, double > > GetValueRange() const
RColumnElementBase(const RColumnElementBase &other)=default
virtual ~RColumnElementBase()=default
RColumnElementBase & operator=(RColumnElementBase &&other)=default
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-...
virtual void SetBitsOnStorage(std::size_t bitsOnStorage)
static std::unique_ptr< RColumnElementBase > Generate(EColumnType type)
If CppT == void, use the default C++ type for the given column type.
std::size_t GetPackedSize(std::size_t nElements=1U) const
static std::pair< std::uint16_t, std::uint16_t > GetValidBitRange(EColumnType type)
Most types have a fixed on-disk bit width.
RColumnElementBase(RColumnElementBase &&other)=default
Base class for all ROOT issued exceptions.
constexpr EColumnCppType kTestFutureColumn
std::unique_ptr< RColumnElementBase > GenerateColumnElement(EColumnCppType cppType, EColumnType colType)