16#ifndef ROOT7_RColumnElement
17#define ROOT7_RColumnElement
30namespace Experimental {
76 void WriteTo(
void *destination, std::size_t count)
const {
81 void ReadFrom(
void *source, std::size_t count) {
90 virtual void Pack(
void *destination,
void *source, std::size_t count)
const
92 std::memcpy(destination, source, count);
96 virtual void Unpack(
void *destination,
void *source, std::size_t count)
const
98 std::memcpy(destination, source, count);
108template <
typename CppT, EColumnType ColumnT>
115 static_assert(
sizeof(CppT) !=
sizeof(CppT),
"No column mapping for this C++ type");
123 static constexpr bool kIsMappable =
true;
124 static constexpr std::size_t
kSize =
sizeof(float);
125 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
134 static constexpr bool kIsMappable =
true;
136 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
145 static constexpr bool kIsMappable =
true;
146 static constexpr std::size_t
kSize =
sizeof(std::uint8_t);
147 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
149 bool IsMappable() const final {
return kIsMappable; }
156 static constexpr bool kIsMappable =
true;
157 static constexpr std::size_t
kSize =
sizeof(std::int32_t);
158 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
160 bool IsMappable() const final {
return kIsMappable; }
167 static constexpr bool kIsMappable =
true;
168 static constexpr std::size_t
kSize =
sizeof(std::uint32_t);
169 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
171 bool IsMappable() const final {
return kIsMappable; }
178 static constexpr bool kIsMappable =
true;
179 static constexpr std::size_t
kSize =
sizeof(std::int64_t);
180 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
182 bool IsMappable() const final {
return kIsMappable; }
189 static constexpr bool kIsMappable =
true;
190 static constexpr std::size_t
kSize =
sizeof(std::uint64_t);
191 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
193 bool IsMappable() const final {
return kIsMappable; }
200 static constexpr bool kIsMappable =
true;
202 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
211 static constexpr bool kIsMappable =
true;
213 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
222 static constexpr bool kIsMappable =
true;
223 static constexpr std::size_t
kSize =
sizeof(char);
224 static constexpr std::size_t kBitsOnStorage =
kSize * 8;
233 static constexpr bool kIsMappable =
false;
235 static constexpr std::size_t kBitsOnStorage = 1;
240 void Pack(
void *dst,
void *src, std::size_t count)
const final;
241 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-...
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)
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 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
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...