20template<
class... Funcs>
22 explicit overload(Funcs... funcs) : Funcs(funcs)... {}
23 using Funcs::operator()...;
28 template<
typename Func,
typename... Types,
size_t... indices>
31 ((func(indices, values)), ...);
34 template<
typename Func,
typename... Types>
37 std::forward<Types>(values)...);
44 static inline std::string
toString(
const T& val,
void* =
nullptr) {
45 if constexpr (std::is_same_v<T, std::string>) {
47 }
else if constexpr (std::is_same_v<T, ku_string_t>) {
48 return val.getAsString();
50 static_assert(std::is_same<T, int64_t>::value || std::is_same<T, int32_t>::value ||
51 std::is_same<T, int16_t>::value || std::is_same<T, int8_t>::value ||
52 std::is_same<T, uint64_t>::value || std::is_same<T, uint32_t>::value ||
53 std::is_same<T, uint16_t>::value || std::is_same<T, uint8_t>::value ||
54 std::is_same<T, double>::value || std::is_same<T, float>::value);
55 return std::to_string(val);
62 uint32_t pageOffset) {
63 memcpy(&overflowPtr, &pageIdx, 4);
64 memcpy(((uint8_t*)&overflowPtr) + 4, &pageOffset, 4);
67 uint32_t& pageOffset) {
69 memcpy(&pageIdx, &overflowPtr, 4);
70 memcpy(&pageOffset, ((uint8_t*)&overflowPtr) + 4, 4);
75 if constexpr (std::is_same_v<T, int64_t>) {
77 }
else if constexpr (std::is_same_v<T, int32_t>) {
79 }
else if constexpr (std::is_same_v<T, int16_t>) {
81 }
else if constexpr (std::is_same_v<T, int8_t>) {
83 }
else if constexpr (std::is_same_v<T, uint64_t>) {
85 }
else if constexpr (std::is_same_v<T, uint32_t>) {
87 }
else if constexpr (std::is_same_v<T, uint16_t>) {
89 }
else if constexpr (std::is_same_v<T, uint8_t>) {
91 }
else if constexpr (std::is_same_v<T, float>) {
93 }
else if constexpr (std::is_same_v<T, double>) {
95 }
else if constexpr (std::is_same_v<T, int128_t>) {
97 }
else if constexpr (std::is_same_v<T, interval_t>) {
99 }
else if constexpr (std::same_as<T, ku_string_t> || std::same_as<T, std::string> ||
100 std::same_as<T, std::string_view>) {
143 template<
typename... Fs>
151 return func(int8_t());
153 return func(uint8_t());
155 return func(int16_t());
157 return func(uint16_t());
159 return func(int32_t());
161 return func(uint32_t());
164 return func(int64_t());
166 return func(uint64_t());
172 return func(
double());
174 return func(
float());
178 return func(int16_t());
180 return func(int32_t());
182 return func(int64_t());
229 template<
typename... Fs>
237 return func(int8_t());
239 return func(uint8_t());
241 return func(int16_t());
243 return func(uint16_t());
245 return func(int32_t());
247 return func(uint32_t());
249 return func(int64_t());
251 return func(uint64_t());
257 return func(
double());
259 return func(
float());
279 return func(uint8_t());
#define KU_UNREACHABLE
Definition assert.h:28
KUZU_API LogicalTypeID getLogicalTypeID() const
Definition types.h:269
KUZU_API PhysicalTypeID getPhysicalType() const
Definition types.h:273
Definition type_utils.h:26
static void paramPackForEachHelper(const Func &func, std::index_sequence< indices... >, Types &&... values)
Definition type_utils.h:29
static void paramPackForEach(const Func &func, Types &&... values)
Definition type_utils.h:35
static auto visit(const LogicalType &dataType, Fs... funcs)
Definition type_utils.h:144
static std::string entryToString(const LogicalType &dataType, const uint8_t *value, ValueVector *vector)
static void decodeOverflowPtr(uint64_t overflowPtr, page_idx_t &pageIdx, uint32_t &pageOffset)
Definition type_utils.h:66
static std::string relToString(const struct_entry_t &val, ValueVector *vector)
static auto visit(PhysicalTypeID dataType, Fs &&... funcs)
Definition type_utils.h:230
static constexpr common::PhysicalTypeID getPhysicalTypeIDForType()
Definition type_utils.h:74
static void encodeOverflowPtr(uint64_t &overflowPtr, page_idx_t pageIdx, uint32_t pageOffset)
Definition type_utils.h:61
static std::string nodeToString(const struct_entry_t &val, ValueVector *vector)
static std::string toString(const T &val, void *=nullptr)
Definition type_utils.h:44
Definition value_vector.h:20
PhysicalTypeID
Definition types.h:212
uint32_t page_idx_t
Definition types.h:30
struct KUZU_API int128_t
Definition int128_t.h:17
Definition array_utils.h:7
Definition interval_t.h:35
Definition ku_string.h:12
Definition type_utils.h:21
overload(Funcs... funcs)
Definition type_utils.h:22
Definition timestamp_t.h:49
Definition timestamp_t.h:46
Definition timestamp_t.h:52
Definition timestamp_t.h:10
Definition timestamp_t.h:43