16#ifndef ROOT7_RColumnElement
17#define ROOT7_RColumnElement
32#ifndef R__LITTLE_ENDIAN
35#define R__LITTLE_ENDIAN 1
37#define R__LITTLE_ENDIAN 0
46template <std::
size_t N>
47static void CopyElementsBswap(
void *destination,
const void *source, std::size_t count)
51 for (std::size_t i = 0; i < count; ++i) {
58namespace Experimental {
105 void WriteTo(
void *destination, std::size_t count)
const {
119 virtual void Pack(
void *destination,
void *source, std::size_t count)
const
121 std::memcpy(destination, source, count);
125 virtual void Unpack(
void *destination,
void *source, std::size_t count)
const
127 std::memcpy(destination, source, count);
139template <
typename CppT>
145 void Pack(
void *dst,
void *
src, std::size_t count)
const final
147#if R__LITTLE_ENDIAN == 1
150 CopyElementsBswap<sizeof(CppT)>(dst,
src, count);
153 void Unpack(
void *dst,
void *
src, std::size_t count)
const final
155#if R__LITTLE_ENDIAN == 1
158 CopyElementsBswap<sizeof(CppT)>(dst,
src, count);
166template <
typename CppT, EColumnType ColumnT = EColumnType::kUnknown>
173 static_assert(
sizeof(CppT) !=
sizeof(CppT),
"No column mapping for this C++ type");
187 static constexpr std::size_t
kSize =
sizeof(char);
194 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
201 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
208 static constexpr std::size_t
kSize =
sizeof(std::int16_t);
215 static constexpr std::size_t
kSize =
sizeof(std::uint16_t);
222 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
229 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
236 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
243 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
250 static constexpr std::size_t
kSize =
sizeof(float);
278 static constexpr std::size_t
kSize =
sizeof(float);
279 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
289 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
298 static constexpr bool kIsMappable =
true;
299 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
300 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
302 bool IsMappable() const final {
return kIsMappable; }
309 static constexpr bool kIsMappable =
true;
310 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
311 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
313 bool IsMappable() const final {
return kIsMappable; }
320 static constexpr bool kIsMappable =
true;
321 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
322 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
324 bool IsMappable() const final {
return kIsMappable; }
331 static constexpr bool kIsMappable =
true;
332 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
333 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
335 bool IsMappable() const final {
return kIsMappable; }
340class RColumnElement<std::int16_t,
EColumnType::kInt16> :
public RColumnElementLE<std::int16_t> {
342 static constexpr std::size_t
kSize =
sizeof(std::int16_t);
343 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
345 bool IsMappable() const final {
return kIsMappable; }
350class RColumnElement<std::uint16_t,
EColumnType::kInt16> :
public RColumnElementLE<std::uint16_t> {
352 static constexpr std::size_t
kSize =
sizeof(std::uint16_t);
353 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
355 bool IsMappable() const final {
return kIsMappable; }
360class RColumnElement<std::int32_t,
EColumnType::kInt32> :
public RColumnElementLE<std::int32_t> {
362 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
363 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
365 bool IsMappable() const final {
return kIsMappable; }
370class RColumnElement<std::uint32_t,
EColumnType::kInt32> :
public RColumnElementLE<std::uint32_t> {
372 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
373 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
375 bool IsMappable() const final {
return kIsMappable; }
380class RColumnElement<std::int64_t,
EColumnType::kInt64> :
public RColumnElementLE<std::int64_t> {
382 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
383 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
385 bool IsMappable() const final {
return kIsMappable; }
390class RColumnElement<std::uint64_t,
EColumnType::kInt64> :
public RColumnElementLE<std::uint64_t> {
392 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
393 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
395 bool IsMappable() const final {
return kIsMappable; }
403 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
412 static constexpr bool kIsMappable =
false;
414 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
419 void Pack(
void *dst,
void *
src, std::size_t count)
const final;
420 void Unpack(
void *dst,
void *
src, std::size_t count)
const final;
426 static constexpr bool kIsMappable =
true;
427 static constexpr std::size_t
kSize =
sizeof(char);
428 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
437 static constexpr bool kIsMappable =
true;
438 static constexpr std::size_t
kSize =
sizeof(char);
439 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
448 static constexpr bool kIsMappable =
false;
450 static constexpr std::size_t kBitsOnStorage = 1;
455 void Pack(
void *dst,
void *
src, std::size_t count)
const final;
456 void Unpack(
void *dst,
void *
src, std::size_t count)
const final;
462 static constexpr bool kIsMappable =
false;
463 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
464 static constexpr std::size_t kBitsOnStorage = 32;
466 bool IsMappable() const final {
return kIsMappable; }
469 void Pack(
void *dst,
void *
src, std::size_t count)
const final;
470 void Unpack(
void *dst,
void *
src, std::size_t count)
const final;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
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
virtual void Pack(void *destination, 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::unique_ptr< RColumnElementBase > Generate(EColumnType type)
void WriteTo(void *destination, std::size_t count) const
Write one or multiple column elements into destination.
RColumnElementBase(RColumnElementBase &&other)=default
virtual bool IsMappable() const
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
void * fRawContent
Points to valid C++ data, either a single value or an array of values.
RColumnElementBase(void *rawContent, std::size_t size)
void * GetRawContent() const
virtual std::size_t GetBitsOnStorage() const
RColumnElementBase(const RColumnElementBase &other)=default
RColumnElementBase & operator=(const RColumnElementBase &other)=delete
std::size_t fSize
Size of the C++ value pointed to by fRawContent (not necessarily equal to the on-disk element size)
static std::string GetTypeName(EColumnType type)
void ReadFrom(void *source, std::size_t count)
Set the column element or an array of elements from the memory location source.
virtual void Unpack(void *destination, 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-...
RColumnElementBase(const RColumnElementBase &elemArray, std::size_t at)
std::size_t GetPackedSize(std::size_t nElements) const
std::size_t GetSize() const
virtual ~RColumnElementBase()=default
Base class for columns whose on-storage representation is little-endian.
RColumnElementLE(void *rawContent, std::size_t size)
static constexpr bool kIsMappable
void Pack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, packing creates an on-disk page from an in-...
void Unpack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, unpacking creates a memory page from an on-...
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
std::size_t GetBitsOnStorage() const final
RColumnElement(ClusterSize_t *value)
RColumnElement(ClusterSize_t *value)
void Pack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, packing creates an on-disk page from an in-...
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
void Unpack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, unpacking creates a memory page from an on-...
RColumnElement(RColumnSwitch *value)
std::size_t GetBitsOnStorage() const final
RColumnElement(RColumnSwitch *value)
RColumnElement(bool *value)
void Unpack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, unpacking creates a memory page from an on-...
void Pack(void *dst, void *src, std::size_t count) const final
If the on-storage layout and the in-memory layout differ, packing creates an on-disk page from an in-...
std::size_t GetBitsOnStorage() const final
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
RColumnElement(bool *value)
std::size_t GetBitsOnStorage() const final
RColumnElement(char *value)
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
std::size_t GetBitsOnStorage() const final
RColumnElement(char *value)
RColumnElement(char *value)
std::size_t GetBitsOnStorage() const final
RColumnElement(double *value)
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
RColumnElement(double *value)
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
std::size_t GetBitsOnStorage() const final
RColumnElement(float *value)
RColumnElement(float *value)
Pairs of C++ type and column type, like float and EColumnType::kReal32.
RColumnElement(CppT *value)
Holds the index and the tag of a kSwitch column.
RClusterSize ClusterSize_t
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Helper templated class for swapping bytes; specializations for N={2,4,8} are provided below.
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...