[Bf-blender-cvs] [422901585b0] temp-derived-node-tree-refactor: cleanup naming

Jacques Lucke noreply at git.blender.org
Wed Mar 3 16:37:51 CET 2021


Commit: 422901585b0c01c7fed395a973151d5d563416cc
Author: Jacques Lucke
Date:   Wed Mar 3 16:37:38 2021 +0100
Branches: temp-derived-node-tree-refactor
https://developer.blender.org/rB422901585b0c01c7fed395a973151d5d563416cc

cleanup naming

===================================================================

M	source/blender/nodes/NOD_XXX_node_tree.hh
M	source/blender/nodes/NOD_geometry_exec.hh
M	source/blender/nodes/intern/node_geometry_exec.cc
M	source/blender/nodes/intern/xxx_node_tree.cc

===================================================================

diff --git a/source/blender/nodes/NOD_XXX_node_tree.hh b/source/blender/nodes/NOD_XXX_node_tree.hh
index e9f5dfa8685..d1446857442 100644
--- a/source/blender/nodes/NOD_XXX_node_tree.hh
+++ b/source/blender/nodes/NOD_XXX_node_tree.hh
@@ -49,7 +49,7 @@ class XXXNodeTreeContext {
 
 struct XXXNode {
   const XXXNodeTreeContext *context = nullptr;
-  const NodeRef *node = nullptr;
+  const NodeRef *node_ref = nullptr;
 
   XXXNode() = default;
   XXXNode(const XXXNodeTreeContext *context, const NodeRef *node);
@@ -65,7 +65,7 @@ struct XXXNode {
 
 struct XXXSocket {
   const XXXNodeTreeContext *context = nullptr;
-  const SocketRef *socket = nullptr;
+  const SocketRef *socket_ref = nullptr;
 
   XXXSocket() = default;
   XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket);
@@ -83,7 +83,7 @@ struct XXXSocket {
 
 struct XXXInputSocket {
   const XXXNodeTreeContext *context = nullptr;
-  const InputSocketRef *socket = nullptr;
+  const InputSocketRef *socket_ref = nullptr;
 
   XXXInputSocket() = default;
   XXXInputSocket(const XXXNodeTreeContext *context, const InputSocketRef *socket);
@@ -103,7 +103,7 @@ struct XXXInputSocket {
 
 struct XXXOutputSocket {
   const XXXNodeTreeContext *context = nullptr;
-  const OutputSocketRef *socket = nullptr;
+  const OutputSocketRef *socket_ref = nullptr;
 
   XXXOutputSocket() = default;
   XXXOutputSocket(const XXXNodeTreeContext *context, const OutputSocketRef *socket);
@@ -183,15 +183,15 @@ inline bool XXXNodeTreeContext::is_root() const
  * XXXNode inline methods.
  */
 
-inline XXXNode::XXXNode(const XXXNodeTreeContext *context, const NodeRef *node)
-    : context(context), node(node)
+inline XXXNode::XXXNode(const XXXNodeTreeContext *context, const NodeRef *node_ref)
+    : context(context), node_ref(node_ref)
 {
-  BLI_assert(node == nullptr || &node->tree() == &context->tree());
+  BLI_assert(node_ref == nullptr || &node_ref->tree() == &context->tree());
 }
 
 inline bool operator==(const XXXNode &a, const XXXNode &b)
 {
-  return a.context == b.context && a.node == b.node;
+  return a.context == b.context && a.node_ref == b.node_ref;
 }
 
 inline bool operator!=(const XXXNode &a, const XXXNode &b)
@@ -201,42 +201,43 @@ inline bool operator!=(const XXXNode &a, const XXXNode &b)
 
 inline XXXNode::operator bool() const
 {
-  return node != nullptr;
+  return node_ref != nullptr;
 }
 
 inline const NodeRef *XXXNode::operator->() const
 {
-  return node;
+  return node_ref;
 }
 
 inline uint64_t XXXNode::hash() const
 {
-  return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ DefaultHash<const NodeRef *>{}(node);
+  return DefaultHash<const XXXNodeTreeContext *>{}(context) ^
+         DefaultHash<const NodeRef *>{}(node_ref);
 }
 
 /* --------------------------------------------------------------------
  * XXXSocket inline methods.
  */
 
-inline XXXSocket::XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket)
-    : context(context), socket(socket)
+inline XXXSocket::XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket_ref)
+    : context(context), socket_ref(socket_ref)
 {
-  BLI_assert(socket == nullptr || &socket->tree() == &context->tree());
+  BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree());
 }
 
 inline XXXSocket::XXXSocket(const XXXInputSocket &input_socket)
-    : context(input_socket.context), socket(input_socket.socket)
+    : context(input_socket.context), socket_ref(input_socket.socket_ref)
 {
 }
 
 inline XXXSocket::XXXSocket(const XXXOutputSocket &output_socket)
-    : context(output_socket.context), socket(output_socket.socket)
+    : context(output_socket.context), socket_ref(output_socket.socket_ref)
 {
 }
 
 inline bool operator==(const XXXSocket &a, const XXXSocket &b)
 {
-  return a.context == b.context && a.socket == b.socket;
+  return a.context == b.context && a.socket_ref == b.socket_ref;
 }
 
 inline bool operator!=(const XXXSocket &a, const XXXSocket &b)
@@ -246,18 +247,18 @@ inline bool operator!=(const XXXSocket &a, const XXXSocket &b)
 
 inline XXXSocket::operator bool() const
 {
-  return socket != nullptr;
+  return socket_ref != nullptr;
 }
 
 inline const SocketRef *XXXSocket::operator->() const
 {
-  return socket;
+  return socket_ref;
 }
 
 inline uint64_t XXXSocket::hash() const
 {
   return DefaultHash<const XXXNodeTreeContext *>{}(context) ^
-         DefaultHash<const SocketRef *>{}(socket);
+         DefaultHash<const SocketRef *>{}(socket_ref);
 }
 
 /* --------------------------------------------------------------------
@@ -265,21 +266,21 @@ inline uint64_t XXXSocket::hash() const
  */
 
 inline XXXInputSocket::XXXInputSocket(const XXXNodeTreeContext *context,
-                                      const InputSocketRef *socket)
-    : context(context), socket(socket)
+                                      const InputSocketRef *socket_ref)
+    : context(context), socket_ref(socket_ref)
 {
-  BLI_assert(socket == nullptr || &socket->tree() == &context->tree());
+  BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree());
 }
 
 inline XXXInputSocket::XXXInputSocket(const XXXSocket &base_socket)
-    : context(base_socket.context), socket(&base_socket.socket->as_input())
+    : context(base_socket.context), socket_ref(&base_socket.socket_ref->as_input())
 {
-  BLI_assert(socket == nullptr || &socket->tree() == &context->tree());
+  BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree());
 }
 
 inline bool operator==(const XXXInputSocket &a, const XXXInputSocket &b)
 {
-  return a.context == b.context && a.socket == b.socket;
+  return a.context == b.context && a.socket_ref == b.socket_ref;
 }
 
 inline bool operator!=(const XXXInputSocket &a, const XXXInputSocket &b)
@@ -289,18 +290,18 @@ inline bool operator!=(const XXXInputSocket &a, const XXXInputSocket &b)
 
 inline XXXInputSocket::operator bool() const
 {
-  return socket != nullptr;
+  return socket_ref != nullptr;
 }
 
 inline const InputSocketRef *XXXInputSocket::operator->() const
 {
-  return socket;
+  return socket_ref;
 }
 
 inline uint64_t XXXInputSocket::hash() const
 {
   return DefaultHash<const XXXNodeTreeContext *>{}(context) ^
-         DefaultHash<const InputSocketRef *>{}(socket);
+         DefaultHash<const InputSocketRef *>{}(socket_ref);
 }
 
 /* --------------------------------------------------------------------
@@ -308,19 +309,19 @@ inline uint64_t XXXInputSocket::hash() const
  */
 
 inline XXXOutputSocket::XXXOutputSocket(const XXXNodeTreeContext *context,
-                                        const OutputSocketRef *socket)
-    : context(context), socket(socket)
+                                        const OutputSocketRef *socket_ref)
+    : context(context), socket_ref(socket_ref)
 {
 }
 
 inline XXXOutputSocket::XXXOutputSocket(const XXXSocket &base_socket)
-    : context(base_socket.context), socket(&base_socket.socket->as_output())
+    : context(base_socket.context), socket_ref(&base_socket.socket_ref->as_output())
 {
 }
 
 inline bool operator==(const XXXOutputSocket &a, const XXXOutputSocket &b)
 {
-  return a.context == b.context && a.socket == b.socket;
+  return a.context == b.context && a.socket_ref == b.socket_ref;
 }
 
 inline bool operator!=(const XXXOutputSocket &a, const XXXOutputSocket &b)
@@ -330,18 +331,18 @@ inline bool operator!=(const XXXOutputSocket &a, const XXXOutputSocket &b)
 
 inline XXXOutputSocket::operator bool() const
 {
-  return socket != nullptr;
+  return socket_ref != nullptr;
 }
 
 inline const OutputSocketRef *XXXOutputSocket::operator->() const
 {
-  return socket;
+  return socket_ref;
 }
 
 inline uint64_t XXXOutputSocket::hash() const
 {
   return DefaultHash<const XXXNodeTreeContext *>{}(context) ^
-         DefaultHash<const OutputSocketRef *>{}(socket);
+         DefaultHash<const OutputSocketRef *>{}(socket_ref);
 }
 
 /* --------------------------------------------------------------------
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index a449d3b0fa8..05c0f8b73e1 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -183,7 +183,7 @@ class GeoNodeExecParams {
    */
   const bNode &node() const
   {
-    return *node_.node->bnode();
+    return *node_->bnode();
   }
 
   const PersistentDataHandleMap &handle_map() const
diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc
index 92437bbd195..27b5e885545 100644
--- a/source/blender/nodes/intern/node_geometry_exec.cc
+++ b/source/blender/nodes/intern/node_geometry_exec.cc
@@ -30,7 +30,7 @@ namespace blender::nodes {
 
 void GeoNodeExecParams::error_message_add(const NodeWarningType type, std::string message) const
 {
-  bNodeTree *btree_cow = node_.node->btree();
+  bNodeTree *btree_cow = node_->btree();
   BLI_assert(btree_cow != nullptr);
   if (btree_cow == nullptr) {
     return;
@@ -40,12 +40,12 @@ void GeoNodeExecParams::error_message_add(const NodeWarningType type, std::strin
   const NodeTreeEvaluationContext context(*self_object_, *modifier_);
 
   BKE_nodetree_error_message_add(
-      *btree_original, context, *node_.node->bnode(), type, std::move(message));
+      *btree_original, context, *node_->bnode(), type, std::move(message));
 }
 
 const bNodeSocket *GeoNodeExecParams::find_available_socket(const StringRef name) const
 {
-  for (const InputSocketRef *socket : node_.node->inputs()) {
+  for (const InputSocketRef *socket : node_->inputs()) {
     if (socket->is_available() && socket->name() == name) {
       return socket->bsocket();
     }
@@ -176,7 +176,7 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier,
                                             const CPPType *requested_type) const
 {
   bNodeSocket *found_socket = nullptr;
-  for (const InputSocketRef *socket : node_.node->inputs()) {
+  for (const InputSocketRef *socket : node_->inputs()) {
     if (socket->identifier() == identifier) {
       found_socket = socket->bsocket();
       break;
@@ -186,7 +186,7 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier,
   if (found_socket == nullpt

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list