39 values_.add_new_as(std::forward<ForwardKey>(key), value);
47 void *buffer = allocator_.allocate(type.
size(), type.
alignment());
49 values_.add_new_as(std::forward<ForwardKey>(key),
GMutablePointer{type, buffer});
57 void *buffer = allocator_.allocate(type.
size(), type.
alignment());
59 values_.add_new_as(std::forward<ForwardKey>(key),
GMutablePointer{type, buffer});
63 template<
typename ForwardKey,
typename T>
void add_new(ForwardKey &&key,
T &&value)
65 if constexpr (std::is_rvalue_reference_v<T>) {
78 return values_.pop_as(key);
83 return values_.lookup_as(key);
87 template<
typename T,
typename ForwardKey>
T extract(
const ForwardKey &key)
97 template<
typename T,
typename ForwardKey>
const T &
lookup(
const ForwardKey &key)
const
102 return *(
const T *)value.
get();
105 template<
typename ForwardKey>
bool contains(
const ForwardKey &key)
const
107 return values_.contains_as(key);
void copy_construct(const void *src, void *dst) const
int64_t alignment() const
void move_construct(void *src, void *dst) const
void relocate_assign(void *src, void *dst) const
const CPPType * type() const
const CPPType * type() const
void add_new_by_copy(ForwardKey &&key, GPointer value)
void add_new(ForwardKey &&key, T &&value)
void add_new_by_move(ForwardKey &&key, GMutablePointer value)
const T & lookup(const ForwardKey &key) const
bool contains(const ForwardKey &key) const
void add_new_direct(ForwardKey &&key, GMutablePointer value)
GPointer lookup(const ForwardKey &key) const
GMutablePointer extract(const ForwardKey &key)
GValueMap(LinearAllocator<> &allocator)
T extract(const ForwardKey &key)