16#ifndef ROOT7_RColumnElement
17#define ROOT7_RColumnElement
31namespace Experimental {
78 void WriteTo(
void *destination, std::size_t count)
const {
83 void ReadFrom(
void *source, std::size_t count) {
92 virtual void Pack(
void *destination,
void *source, std::size_t count)
const
94 std::memcpy(destination, source, count);
98 virtual void Unpack(
void *destination,
void *source, std::size_t count)
const
100 std::memcpy(destination, source, count);
111template <
typename CppT, EColumnType ColumnT = EColumnType::kUnknown>
118 static_assert(
sizeof(CppT) !=
sizeof(CppT),
"No column mapping for this C++ type");
132 static constexpr std::size_t
kSize =
sizeof(char);
139 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
146 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
153 static constexpr std::size_t
kSize =
sizeof(std::int16_t);
160 static constexpr std::size_t
kSize =
sizeof(std::uint16_t);
167 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
174 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
181 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
188 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
195 static constexpr std::size_t
kSize =
sizeof(float);
224 static constexpr bool kIsMappable =
true;
225 static constexpr std::size_t
kSize =
sizeof(float);
226 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
235 static constexpr bool kIsMappable =
true;
237 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
246 static constexpr bool kIsMappable =
true;
247 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
248 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
250 bool IsMappable() const final {
return kIsMappable; }
257 static constexpr bool kIsMappable =
true;
258 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
259 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
261 bool IsMappable() const final {
return kIsMappable; }
268 static constexpr bool kIsMappable =
true;
269 static constexpr std::size_t
kSize =
sizeof(std::int8_t);
270 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
272 bool IsMappable() const final {
return kIsMappable; }
279 static constexpr bool kIsMappable =
true;
280 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
281 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
283 bool IsMappable() const final {
return kIsMappable; }
290 static constexpr bool kIsMappable =
true;
291 static constexpr std::size_t
kSize =
sizeof(std::int16_t);
292 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
294 bool IsMappable() const final {
return kIsMappable; }
301 static constexpr bool kIsMappable =
true;
302 static constexpr std::size_t
kSize =
sizeof(std::uint16_t);
303 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
305 bool IsMappable() const final {
return kIsMappable; }
312 static constexpr bool kIsMappable =
true;
313 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
314 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
316 bool IsMappable() const final {
return kIsMappable; }
323 static constexpr bool kIsMappable =
true;
324 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
325 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
327 bool IsMappable() const final {
return kIsMappable; }
334 static constexpr bool kIsMappable =
true;
335 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
336 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
338 bool IsMappable() const final {
return kIsMappable; }
345 static constexpr bool kIsMappable =
true;
346 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
347 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
349 bool IsMappable() const final {
return kIsMappable; }
356 static constexpr bool kIsMappable =
true;
358 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
367 static constexpr bool kIsMappable =
true;
369 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
378 static constexpr bool kIsMappable =
true;
379 static constexpr std::size_t
kSize =
sizeof(char);
380 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
389 static constexpr bool kIsMappable =
true;
390 static constexpr std::size_t
kSize =
sizeof(char);
391 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
400 static constexpr bool kIsMappable =
false;
402 static constexpr std::size_t kBitsOnStorage = 1;
407 void Pack(
void *dst,
void *src, std::size_t count)
const final;
408 void Unpack(
void *dst,
void *src, std::size_t count)
const final;
414 static constexpr bool kIsMappable =
false;
415 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
416 static constexpr std::size_t kBitsOnStorage = 32;
418 bool IsMappable() const final {
return kIsMappable; }
421 void Pack(
void *dst,
void *src, std::size_t count)
const final;
422 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
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
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)
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(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
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...