16#ifndef ROOT7_RColumnElement
17#define ROOT7_RColumnElement
29namespace Experimental {
74 void WriteTo(
void *destination, std::size_t count)
const {
79 void ReadFrom(
void *source, std::size_t count) {
88 virtual void Pack(
void *destination,
void *source, std::size_t count)
const
90 std::memcpy(destination, source, count);
94 virtual void Unpack(
void *destination,
void *source, std::size_t count)
const
96 std::memcpy(destination, source, count);
106template <
typename CppT, EColumnType ColumnT>
113 static_assert(
sizeof(CppT) !=
sizeof(CppT),
"No column mapping for this C++ type");
121 static constexpr bool kIsMappable =
true;
122 static constexpr std::size_t
kSize =
sizeof(float);
123 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
132 static constexpr bool kIsMappable =
true;
133 static constexpr std::size_t
kSize =
sizeof(double);
134 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
143 static constexpr bool kIsMappable =
true;
144 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
145 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
147 bool IsMappable() const final {
return kIsMappable; }
154 static constexpr bool kIsMappable =
true;
155 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
156 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
158 bool IsMappable() const final {
return kIsMappable; }
165 static constexpr bool kIsMappable =
true;
166 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
167 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
169 bool IsMappable() const final {
return kIsMappable; }
176 static constexpr bool kIsMappable =
true;
177 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
178 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
180 bool IsMappable() const final {
return kIsMappable; }
187 static constexpr bool kIsMappable =
true;
188 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
189 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
191 bool IsMappable() const final {
return kIsMappable; }
198 static constexpr bool kIsMappable =
true;
200 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
209 static constexpr bool kIsMappable =
true;
211 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
220 static constexpr bool kIsMappable =
true;
221 static constexpr std::size_t
kSize =
sizeof(char);
222 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
231 static constexpr bool kIsMappable =
false;
232 static constexpr std::size_t
kSize =
sizeof(bool);
233 static constexpr std::size_t kBitsOnStorage = 1;
238 void Pack(
void *dst,
void *src, std::size_t count)
const final;
239 void Unpack(
void *dst,
void *src, std::size_t count)
const final;
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-...
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)
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)
static RColumnElementBase Generate(EColumnType type)
std::size_t GetSize() const
virtual ~RColumnElementBase()=default
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)
bool IsMappable() const final
Derived, typed classes tell whether the on-storage layout is bitwise identical to the memory layout.
RColumnElement(RColumnSwitch *value)
std::size_t GetBitsOnStorage() const final
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.
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.
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.
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)
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
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...