diff options
author | Jacques Lucke <jacques@blender.org> | 2021-08-20 12:37:23 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-08-20 12:37:23 +0300 |
commit | 79c79f3c7028a58c8af2c575bee788d67d0dc892 (patch) | |
tree | 81cdb4c795596e7c64f0d4591019af659b913703 | |
parent | a9970d3cb92baa4991e7825b36033d8d69df43bd (diff) |
cleanup
-rw-r--r-- | source/blender/blenlib/BLI_index_mask.hh | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_multi_function.hh | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_index_mask.hh b/source/blender/blenlib/BLI_index_mask.hh index 3dc56f13c4e..7a3169520ca 100644 --- a/source/blender/blenlib/BLI_index_mask.hh +++ b/source/blender/blenlib/BLI_index_mask.hh @@ -90,6 +90,7 @@ class IndexMask { { } + /** Checks that the indices are non-negative and in ascending order. */ static bool indices_are_valid_index_mask(Span<int64_t> indices) { if (!indices.is_empty()) { diff --git a/source/blender/nodes/NOD_multi_function.hh b/source/blender/nodes/NOD_multi_function.hh index 96118ef3f76..2f4b104fb4c 100644 --- a/source/blender/nodes/NOD_multi_function.hh +++ b/source/blender/nodes/NOD_multi_function.hh @@ -28,6 +28,9 @@ using namespace fn::multi_function_types; class NodeMultiFunctions; +/** + * Utility class to help nodes build a multi-function for themselves. + */ class NodeMultiFunctionBuilder : NonCopyable, NonMovable { private: ResourceScope &resource_scope_; @@ -40,8 +43,17 @@ class NodeMultiFunctionBuilder : NonCopyable, NonMovable { public: NodeMultiFunctionBuilder(ResourceScope &resource_scope, bNode &node, bNodeTree &tree); + /** + * Assign a multi-function for the current node. The input and output parameters of the function + * have to match the available sockets in the node. + */ void set_matching_fn(const MultiFunction *fn); void set_matching_fn(const MultiFunction &fn); + + /** + * Utility method for creating and assigning a multi-function when it can't have a static + * lifetime. + */ template<typename T, typename... Args> void construct_and_set_matching_fn(Args &&...args); bNode &node(); @@ -50,6 +62,9 @@ class NodeMultiFunctionBuilder : NonCopyable, NonMovable { ResourceScope &resource_scope(); }; +/** + * Gives access to multi-functions for all nodes in a node tree that support them. + */ class NodeMultiFunctions { private: Map<const bNode *, const MultiFunction *> map_; |