Blender V4.5
NOD_geometry_nodes_bundle.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "BKE_node.hh"
8
11
12#include "DNA_node_types.h"
13
14namespace blender::nodes {
15
21 public:
27
28 private:
29 Vector<StoredItem> items_;
30 Vector<void *> buffers_;
31
32 public:
33 struct Item {
35 const void *value;
36 };
37
39 Bundle(const Bundle &other);
40 Bundle(Bundle &&other) noexcept;
41 Bundle &operator=(const Bundle &other);
42 Bundle &operator=(Bundle &&other) noexcept;
43 ~Bundle();
44
46 {
47 return BundlePtr(MEM_new<Bundle>(__func__));
48 }
49
50 void add_new(SocketInterfaceKey key, const bke::bNodeSocketType &type, const void *value);
51 bool add(const SocketInterfaceKey &key, const bke::bNodeSocketType &type, const void *value);
52 bool add(SocketInterfaceKey &&key, const bke::bNodeSocketType &type, const void *value);
53 bool remove(const SocketInterfaceKey &key);
54 bool contains(const SocketInterfaceKey &key) const;
55
56 std::optional<Item> lookup(const SocketInterfaceKey &key) const;
57
59 {
60 return items_;
61 }
62
63 void delete_self() override;
64};
65
66} // namespace blender::nodes
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
bool contains(const SocketInterfaceKey &key) const
bool remove(const SocketInterfaceKey &key)
Span< StoredItem > items() const
ImplicitSharingPtr< Bundle > BundlePtr
Defines a socket type.
Definition BKE_node.hh:152
const bke::bNodeSocketType * type