12#if HX_USE_MACROS_WITH_MODULE
13#error Header does not provide macros alone.
21template<
typename key_t_,
typename value_t_>
28 void set(key_t_ key_, value_t_ value_) { this->set_(key_, value_); }
47 static_assert(
sizeof(
void*) >=
sizeof(value_t_),
"value_t size too big");
50 void set_(int8_t key_, value_t_ value_) { this->set_(
static_cast<int32_t
>(key_), value_); }
51 void set_(uint8_t key_, value_t_ value_) { m_key_=key_;
m_value_=value_; }
52 void set_(int16_t key_, value_t_ value_) { this->set_(
static_cast<int32_t
>(key_), value_); }
53 void set_(uint16_t key_, value_t_ value_) { m_key_=key_;
m_value_=value_; }
54 void set_(int32_t key_, value_t_ value_) {
55 m_key_ =
static_cast<uint32_t
>(key_) ^ 0x80000000u;
58 void set_(int64_t key_, value_t_ value_) =
delete;
59 void set_(uint64_t key_, value_t_ value_) =
delete;
60 void set_(uint32_t key_, value_t_ value_) { m_key_=key_;
m_value_=value_; }
61 void set_(
float key_, value_t_ value_) {
64 int32_t t_ = 0; ::memcpy(&t_, &key_,
sizeof t_);
65 m_key_ =
static_cast<uint32_t
>(t_) ^ (
static_cast<uint32_t
>(t_ >> 31) | 0x80000000u);
68 void set_(
double key_, value_t_ value_) =
delete;
hxradix_sort_key - A key-value pair used with hxradix_sort.
Definition hxradix_sort.hpp:22
void * m_value_
Definition hxradix_sort.hpp:73
void set(key_t_ key_, value_t_ value_)
Sets from the required key_t type and value_t type.
Definition hxradix_sort.hpp:28
value_t_ get_value(void)
Returns the stored value_t.
Definition hxradix_sort.hpp:34
void * m_void_ptr_
Definition hxradix_sort.hpp:75
value_t_ get_value(void) const
Returns the stored value_t.
Definition hxradix_sort.hpp:31
hxradix_sort_key(key_t_ key_, value_t_ value_)
Constructs from the required key_t type and value_t type.
Definition hxradix_sort.hpp:25
bool operator<(hxradix_sort_key x_) const
Comparison operator for comparison sorting hxradix_sort_key objects by key as a fallback for short ar...
Definition hxradix_sort.hpp:38
uint32_t get_modified_key(void) const
A version of the key that may have been modified to work as a uint32_t.
Definition hxradix_sort.hpp:41
int hxsystem_allocator_t
hxsystem_allocator_t - This is extendable by the application.
Definition hxmemory_manager.h:77
void hxradix_sort(hxradix_sort_key< key_t_, value_t_ > *begin_, hxradix_sort_key< key_t_, value_t_ > *end_, hxsystem_allocator_t allocator_)
hxradix_sort - Sorts an array of hxradix_sort_key<key_t, value_t> by key_t using 8-bit digits.
Definition hxradix_sort.hpp:130
hxradix_sort_key< uint32_t, void * > hxradix_sort_key_void
hxradix_sort_key_void - Internal.
Definition hxradix_sort.hpp:81
void hxradix_sort_void11(hxradix_sort_key_void *begin_, hxradix_sort_key_void *end_, hxsystem_allocator_t allocator_)
hxradix_sort_void11 - Internal.
void hxradix_sort_void(hxradix_sort_key_void *begin_, hxradix_sort_key_void *end_, hxsystem_allocator_t allocator_)
hxradix_sort_void - Internal.
void hxradix_sort11(hxradix_sort_key< key_t_, value_t_ > *begin_, hxradix_sort_key< key_t_, value_t_ > *end_, hxsystem_allocator_t allocator_)
hxradix_sort11 - Sorts an array of hxradix_sort_key<key_t, value_t> by key_t using 11-bit digits.
Definition hxradix_sort.hpp:148
#define hxattr_nonnull(...)
hxattr_nonnull - Indicates that a function has args that should not be null.
Definition hxsettings.h:97
#define hxattr_nodiscard
hxattr_nodiscard - Indicates the caller should not discard the return value.
Definition hxsettings.h:89
#define hxattr_hot
hxattr_hot - Optimize a function more aggressively.
Definition hxsettings.h:86
Provides core macros, memory management and feature detection.