12 identifiers_.append(std::move(identifier));
28 for (
const std::string &identifier : other.identifiers_) {
29 if (identifiers_.contains(identifier)) {
41 item.type->geometry_nodes_cpp_type->destruct(item.value);
43 for (
void *buffer : buffers_) {
56 : items_(std::move(other.items_)), buffers_(std::move(other.buffers_))
76 new (
this)
Bundle(std::move(other));
84 const CPPType &cpp_type = *type.geometry_nodes_cpp_type;
87 items_.append(
StoredItem{std::move(key), &type, buffer});
88 buffers_.append(buffer);
96 this->
add_new(key, type, value);
100bool Bundle::add(SocketInterfaceKey &&key,
const bNodeSocketType &type,
const void *value)
105 this->
add_new(std::move(key), type, value);
112 if (item.key.matches(key)) {
113 return Item{item.type, item.value};
121 const int removed_num = items_.remove_if([&key](
StoredItem &item) {
128 return removed_num >= 1;
134 if (item.key.matches(key)) {
void copy_construct(const void *src, void *dst) const
void destruct(void *ptr) const
Bundle & operator=(const Bundle &other)
bool add(const SocketInterfaceKey &key, const bke::bNodeSocketType &type, const void *value)
void add_new(SocketInterfaceKey key, const bke::bNodeSocketType &type, const void *value)
std::optional< Item > lookup(const SocketInterfaceKey &key) const
void delete_self() override
bool contains(const SocketInterfaceKey &key) const
bool remove(const SocketInterfaceKey &key)
bool matches(const SocketInterfaceKey &other) const
SocketInterfaceKey(Vector< std::string > identifiers)
Span< std::string > identifiers() const
void * MEM_mallocN_aligned(size_t len, size_t alignment, const char *str)
void MEM_freeN(void *vmemh)
const blender::CPPType * geometry_nodes_cpp_type
const bke::bNodeSocketType * type