[Bf-blender-cvs] [8986cb9ef8b] temp-derived-node-tree-refactor: more accessors

Jacques Lucke noreply at git.blender.org
Wed Mar 3 09:57:02 CET 2021


Commit: 8986cb9ef8b039b207c8b8d18670b1454537f708
Author: Jacques Lucke
Date:   Wed Mar 3 09:01:30 2021 +0100
Branches: temp-derived-node-tree-refactor
https://developer.blender.org/rB8986cb9ef8b039b207c8b8d18670b1454537f708

more accessors

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

M	source/blender/nodes/NOD_XXX_node_tree.hh

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

diff --git a/source/blender/nodes/NOD_XXX_node_tree.hh b/source/blender/nodes/NOD_XXX_node_tree.hh
index 232d90d393a..0a3c6052d8a 100644
--- a/source/blender/nodes/NOD_XXX_node_tree.hh
+++ b/source/blender/nodes/NOD_XXX_node_tree.hh
@@ -36,11 +36,14 @@ class XXXNodeTreeContextInfo {
   Map<const NodeRef *, XXXNodeTreeContextInfo *> children_;
 
   friend XXXNodeTree;
+
+ public:
+  const NodeTreeRef &tree() const;
 };
 
 class XXXNodeTreeContext {
  private:
-  XXXNodeTreeContextInfo *context_ = nullptr;
+  XXXNodeTreeContextInfo *context_info_ = nullptr;
 
   friend XXXNodeTree;
 
@@ -49,6 +52,8 @@ class XXXNodeTreeContext {
   friend bool operator!=(const XXXNodeTreeContext &a, const XXXNodeTreeContext &b);
 
   uint64_t hash() const;
+
+  const XXXNodeTreeContextInfo &info() const;
 };
 
 struct XXXNode {
@@ -107,6 +112,8 @@ class XXXNodeTree {
   XXXNodeTree(bNodeTree &btree, NodeTreeRefMap &node_tree_refs);
   ~XXXNodeTree();
 
+  const XXXNodeTreeContextInfo &root_context_info() const;
+
  private:
   XXXNodeTreeContextInfo &construct_context_info_recursively(XXXNodeTreeContextInfo *parent,
                                                              bNodeTree &btree,
@@ -114,13 +121,22 @@ class XXXNodeTree {
   void destruct_context_info_recursively(XXXNodeTreeContextInfo *context_info);
 };
 
+/* --------------------------------------------------------------------
+ * XXXNodeTreeContextInfo inline methods.
+ */
+
+inline const NodeTreeRef &XXXNodeTreeContextInfo::tree() const
+{
+  return *tree_;
+}
+
 /* --------------------------------------------------------------------
  * XXXNodeTreeContext inline methods.
  */
 
 inline bool operator==(const XXXNodeTreeContext &a, const XXXNodeTreeContext &b)
 {
-  return a.context_ == b.context_;
+  return a.context_info_ == b.context_info_;
 }
 
 inline bool operator!=(const XXXNodeTreeContext &a, const XXXNodeTreeContext &b)
@@ -130,7 +146,12 @@ inline bool operator!=(const XXXNodeTreeContext &a, const XXXNodeTreeContext &b)
 
 inline uint64_t XXXNodeTreeContext::hash() const
 {
-  return DefaultHash<XXXNodeTreeContextInfo *>{}(context_);
+  return DefaultHash<XXXNodeTreeContextInfo *>{}(context_info_);
+}
+
+inline const XXXNodeTreeContextInfo &XXXNodeTreeContext::info() const
+{
+  return *context_info_;
 }
 
 /* --------------------------------------------------------------------
@@ -231,4 +252,13 @@ inline uint64_t XXXOutputSocket::hash() const
          DefaultHash<const OutputSocketRef *>{}(socket);
 }
 
+/* --------------------------------------------------------------------
+ * XXXNodeTree inline methods.
+ */
+
+inline const XXXNodeTreeContextInfo &XXXNodeTree::root_context_info() const
+{
+  return *root_context_info_;
+}
+
 }  // namespace blender::nodes



More information about the Bf-blender-cvs mailing list