From 79c79f3c7028a58c8af2c575bee788d67d0dc892 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 20 Aug 2021 11:37:23 +0200 Subject: cleanup --- source/blender/blenlib/BLI_index_mask.hh | 1 + source/blender/nodes/NOD_multi_function.hh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) 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 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 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 map_; -- cgit v1.2.3