39 values_.
add_new_as(std::forward<ForwardKey>(key), value);
46 const CPPType &type = *value.type();
47 void *buffer = allocator_.
allocate(type.size(), type.alignment());
48 type.move_construct(value.get(), buffer);
56 const CPPType &type = *value.type();
57 void *buffer = allocator_.
allocate(type.size(), type.alignment());
58 type.copy_construct(value.get(), 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);
87 template<
typename T,
typename ForwardKey> T
extract(
const ForwardKey &key)
90 const CPPType &type = *value.type();
93 type.relocate_assign(value.get(), &return_value);
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
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)
void * allocate(const int64_t size, const int64_t alignment)
Value pop_as(const ForwardKey &key)
ValueIterator values() const
void add_new_as(ForwardKey &&key, ForwardValue &&...value)
const Value & lookup_as(const ForwardKey &key) const
bool contains_as(const ForwardKey &key) const