20template<
class... Funcs>
22 explicit overload(Funcs... funcs) : Funcs(funcs)... {}
23 using Funcs::operator()...;
32 static inline std::string
toString(
const T& val,
void* =
nullptr) {
33 static_assert(std::is_same<T, int64_t>::value || std::is_same<T, int32_t>::value ||
34 std::is_same<T, int16_t>::value || std::is_same<T, int8_t>::value ||
35 std::is_same<T, uint64_t>::value || std::is_same<T, uint32_t>::value ||
36 std::is_same<T, uint16_t>::value || std::is_same<T, uint8_t>::value ||
37 std::is_same<T, double>::value || std::is_same<T, float>::value);
38 return std::to_string(val);
44 uint32_t pageOffset) {
45 memcpy(&overflowPtr, &pageIdx, 4);
46 memcpy(((uint8_t*)&overflowPtr) + 4, &pageOffset, 4);
49 uint32_t& pageOffset) {
51 memcpy(&pageIdx, &overflowPtr, 4);
52 memcpy(&pageOffset, ((uint8_t*)&overflowPtr) + 4, 4);
57 if constexpr (std::is_same_v<T, int64_t>) {
59 }
else if constexpr (std::is_same_v<T, int32_t>) {
61 }
else if constexpr (std::is_same_v<T, int16_t>) {
63 }
else if constexpr (std::is_same_v<T, int8_t>) {
65 }
else if constexpr (std::is_same_v<T, uint64_t>) {
67 }
else if constexpr (std::is_same_v<T, uint32_t>) {
69 }
else if constexpr (std::is_same_v<T, uint16_t>) {
71 }
else if constexpr (std::is_same_v<T, uint8_t>) {
73 }
else if constexpr (std::is_same_v<T, float>) {
75 }
else if constexpr (std::is_same_v<T, double>) {
77 }
else if constexpr (std::is_same_v<T, int128_t>) {
79 }
else if constexpr (std::is_same_v<T, interval_t>) {
81 }
else if constexpr (std::same_as<T, ku_string_t> || std::same_as<T, std::string> ||
82 std::same_as<T, std::string_view>) {
125 template<
typename... Fs>
133 return func(int8_t());
135 return func(uint8_t());
137 return func(int16_t());
139 return func(uint16_t());
141 return func(int32_t());
143 return func(uint32_t());
146 return func(int64_t());
148 return func(uint64_t());
154 return func(
double());
156 return func(
float());
160 return func(int16_t());
162 return func(int32_t());
164 return func(int64_t());
211 return func(uint8_t());
215 template<
typename... Fs>
223 return func(int8_t());
225 return func(uint8_t());
227 return func(int16_t());
229 return func(uint16_t());
231 return func(int32_t());
233 return func(uint32_t());
235 return func(int64_t());
237 return func(uint64_t());
243 return func(
double());
245 return func(
float());
263 return func(uint8_t());
#define KU_UNREACHABLE
Definition assert.h:28
KUZU_API LogicalTypeID getLogicalTypeID() const
Definition types.h:224
KUZU_API PhysicalTypeID getPhysicalType() const
Definition types.h:227
Definition type_utils.h:26
static auto visit(const LogicalType &dataType, Fs... funcs)
Definition type_utils.h:126
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:48
static std::string relToString(const struct_entry_t &val, ValueVector *vector)
static auto visit(PhysicalTypeID dataType, Fs &&... funcs)
Definition type_utils.h:216
static constexpr common::PhysicalTypeID getPhysicalTypeIDForType()
Definition type_utils.h:56
static void encodeOverflowPtr(uint64_t &overflowPtr, page_idx_t pageIdx, uint32_t pageOffset)
Definition type_utils.h:43
static std::string nodeToString(const struct_entry_t &val, ValueVector *vector)
static std::string toString(const T &val, void *=nullptr)
Definition type_utils.h:32
Definition value_vector.h:20
PhysicalTypeID
Definition types.h:171
uint32_t page_idx_t
Definition types.h:26
struct KUZU_API int128_t
Definition int128_t.h:17
Definition alter_type.h:5
Definition internal_id_t.h:31
Definition interval_t.h:30
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