13 identifiers_.
append(std::move(identifier));
17 : identifiers_(std::move(identifiers))
22Span<std::string> SocketInterfaceKey::identifiers()
const
27bool SocketInterfaceKey::matches(
const SocketInterfaceKey &other)
const
29 for (
const std::string &identifier : other.identifiers_) {
30 if (identifiers_.contains(identifier)) {
37Bundle::Bundle() =
default;
41 for (StoredItem &item : items_) {
42 item.type->geometry_nodes_cpp_type->destruct(item.value);
44 for (
void *buffer : buffers_) {
49Bundle::Bundle(
const Bundle &other)
51 for (
const StoredItem &item : other.items_) {
52 this->add_new(item.key, *item.type, item.value);
56Bundle::Bundle(Bundle &&other) noexcept
57 : items_(std::move(other.items_)), buffers_(std::move(other.buffers_))
61Bundle &Bundle::operator=(
const Bundle &other)
67 new (
this) Bundle(other);
71Bundle &Bundle::operator=(Bundle &&other)
noexcept
77 new (
this) Bundle(std::move(other));
81void Bundle::add_new(SocketInterfaceKey
key,
const bke::bNodeSocketType &type,
const void *
value)
85 const CPPType &cpp_type = *type.geometry_nodes_cpp_type;
87 cpp_type.copy_construct(
value, buffer);
88 items_.append(StoredItem{std::move(
key), &type, buffer});
89 buffers_.append(buffer);
96 if (this->contains(
key)) {
105 if (this->contains(
key)) {
108 this->add_new(std::move(
key), type,
value);
114 for (
const StoredItem &item : items_) {
115 if (item.key.matches(
key)) {
116 return Item{item.type, item.value};
122bool Bundle::remove(
const SocketInterfaceKey &
key)
124 const int removed_num = items_.remove_if([&
key](StoredItem &item) {
125 if (item.key.matches(
key)) {
126 item.type->geometry_nodes_cpp_type->destruct(item.value);
131 return removed_num >= 1;
134bool Bundle::contains(
const SocketInterfaceKey &
key)
const
136 for (
const StoredItem &item : items_) {
137 if (item.key.matches(
key)) {
144void Bundle::delete_self()
void append(const T &value)
SocketInterfaceKey(Vector< std::string > identifiers)
void * MEM_mallocN_aligned(size_t len, size_t alignment, const char *str)
void MEM_freeN(void *vmemh)