[Bf-blender-cvs] [06e398f4274] functions-experimental-refactor: rename OwnedResources to ResourceCollector

Jacques Lucke noreply at git.blender.org
Tue Nov 5 15:55:15 CET 2019


Commit: 06e398f4274fd80ce73b615173c9e1273b7eb2b6
Author: Jacques Lucke
Date:   Tue Nov 5 15:40:03 2019 +0100
Branches: functions-experimental-refactor
https://developer.blender.org/rB06e398f4274fd80ce73b615173c9e1273b7eb2b6

rename OwnedResources to ResourceCollector

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

R095	source/blender/blenlib/BLI_owned_resources.h	source/blender/blenlib/BLI_resource_collector.h
M	source/blender/functions/core/data_graph.cpp
M	source/blender/functions/core/data_graph.hpp
M	source/blender/functions/core/data_graph_builder.hpp
M	source/blender/functions/core/function.hpp
M	source/blender/functions2/FN_vtree_multi_function_network_generation.h
M	source/blender/functions2/intern/vtree_multi_function_network/builder.cc
M	source/blender/functions2/intern/vtree_multi_function_network/builder.h
M	source/blender/functions2/intern/vtree_multi_function_network/generate.cc
M	source/blender/functions2/intern/vtree_multi_function_network/mappings.h
M	source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
M	source/blender/modifiers/intern/MOD_functionpoints_cxx.cc

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

diff --git a/source/blender/blenlib/BLI_owned_resources.h b/source/blender/blenlib/BLI_resource_collector.h
similarity index 95%
rename from source/blender/blenlib/BLI_owned_resources.h
rename to source/blender/blenlib/BLI_resource_collector.h
index d468414bb99..5d0e6d5bb3a 100644
--- a/source/blender/blenlib/BLI_owned_resources.h
+++ b/source/blender/blenlib/BLI_resource_collector.h
@@ -7,7 +7,7 @@
 
 namespace BLI {
 
-class OwnedResources : NonCopyable {
+class ResourceCollector : NonCopyable {
  private:
   struct ResourceData {
     void *data;
@@ -18,9 +18,9 @@ class OwnedResources : NonCopyable {
   Vector<ResourceData> m_resources;
 
  public:
-  OwnedResources() = default;
+  ResourceCollector() = default;
 
-  ~OwnedResources()
+  ~ResourceCollector()
   {
     for (int i = m_resources.size() - 1; i >= 0; i--) {
       ResourceData &data = m_resources[i];
diff --git a/source/blender/functions/core/data_graph.cpp b/source/blender/functions/core/data_graph.cpp
index 258ca3cd93f..41172646eb3 100644
--- a/source/blender/functions/core/data_graph.cpp
+++ b/source/blender/functions/core/data_graph.cpp
@@ -2,7 +2,7 @@
 
 namespace FN {
 
-DataGraph::DataGraph(std::unique_ptr<OwnedResources> resources,
+DataGraph::DataGraph(std::unique_ptr<ResourceCollector> resources,
                      Vector<Node> nodes,
                      Vector<InputSocket> inputs,
                      Vector<OutputSocket> outputs,
diff --git a/source/blender/functions/core/data_graph.hpp b/source/blender/functions/core/data_graph.hpp
index b4f1a4de1ae..86a702e4199 100644
--- a/source/blender/functions/core/data_graph.hpp
+++ b/source/blender/functions/core/data_graph.hpp
@@ -195,7 +195,7 @@ class DataGraph {
   };
 
  private:
-  std::unique_ptr<OwnedResources> m_resources;
+  std::unique_ptr<ResourceCollector> m_resources;
   Vector<Node> m_nodes;
   Vector<InputSocket> m_inputs;
   Vector<OutputSocket> m_outputs;
@@ -203,7 +203,7 @@ class DataGraph {
   std::unique_ptr<MonotonicAllocator<>> m_source_info_allocator;
 
  public:
-  DataGraph(std::unique_ptr<OwnedResources> m_resources,
+  DataGraph(std::unique_ptr<ResourceCollector> m_resources,
             Vector<Node> nodes,
             Vector<InputSocket> inputs,
             Vector<OutputSocket> outputs,
diff --git a/source/blender/functions/core/data_graph_builder.hpp b/source/blender/functions/core/data_graph_builder.hpp
index 9dff2adc1ff..0381c1e1d2d 100644
--- a/source/blender/functions/core/data_graph_builder.hpp
+++ b/source/blender/functions/core/data_graph_builder.hpp
@@ -140,7 +140,7 @@ class BuilderNode {
 
 class DataGraphBuilder {
  private:
-  std::unique_ptr<OwnedResources> m_resources;
+  std::unique_ptr<ResourceCollector> m_resources;
   Vector<BuilderNode *> m_nodes;
   uint m_link_counter = 0;
   uint m_input_socket_counter = 0;
@@ -161,7 +161,7 @@ class DataGraphBuilder {
   template<typename T> void add_resource(std::unique_ptr<T> resource, const char *name)
   {
     if (m_resources.get() == nullptr) {
-      m_resources = BLI::make_unique<OwnedResources>();
+      m_resources = BLI::make_unique<ResourceCollector>();
     }
     m_resources->add(std::move(resource), name);
   }
diff --git a/source/blender/functions/core/function.hpp b/source/blender/functions/core/function.hpp
index 0ae6b864cbc..8ee53aac887 100644
--- a/source/blender/functions/core/function.hpp
+++ b/source/blender/functions/core/function.hpp
@@ -22,13 +22,13 @@
 #include <functional>
 
 #include "BLI_utility_mixins.h"
-#include "BLI_owned_resources.h"
+#include "BLI_resource_collector.h"
 
 #include "type.hpp"
 
 namespace FN {
 
-using BLI::OwnedResources;
+using BLI::ResourceCollector;
 using BLI::Vector;
 
 class Function;
@@ -169,7 +169,7 @@ class Function final : BLI::NonCopyable, BLI::NonMovable {
   Vector<Type *> m_output_types;
 
   std::mutex m_modify_mutex;
-  std::unique_ptr<OwnedResources> m_resources;
+  std::unique_ptr<ResourceCollector> m_resources;
   const char *m_strings;
 };
 
@@ -291,7 +291,7 @@ template<typename T> void Function::add_resource(std::unique_ptr<T> resource, co
   std::lock_guard<std::mutex> lock(m_modify_mutex);
 
   if (m_resources.get() == nullptr) {
-    m_resources = BLI::make_unique<OwnedResources>();
+    m_resources = BLI::make_unique<ResourceCollector>();
   }
 
   m_resources->add(std::move(resource), name);
diff --git a/source/blender/functions2/FN_vtree_multi_function_network_generation.h b/source/blender/functions2/FN_vtree_multi_function_network_generation.h
index a0c27f9ac4e..7af7c0ced3f 100644
--- a/source/blender/functions2/FN_vtree_multi_function_network_generation.h
+++ b/source/blender/functions2/FN_vtree_multi_function_network_generation.h
@@ -2,18 +2,18 @@
 #define __FN_VTREE_MULTI_FUNCTION_NETWORK_GENERATION_H__
 
 #include "FN_vtree_multi_function_network.h"
-#include "BLI_owned_resources.h"
+#include "BLI_resource_collector.h"
 #include "intern/multi_functions/network.h"
 
 namespace FN {
 
-using BLI::OwnedResources;
+using BLI::ResourceCollector;
 
-std::unique_ptr<VTreeMFNetwork> generate_vtree_multi_function_network(const VirtualNodeTree &vtree,
-                                                                      OwnedResources &resources);
+std::unique_ptr<VTreeMFNetwork> generate_vtree_multi_function_network(
+    const VirtualNodeTree &vtree, ResourceCollector &resources);
 
 std::unique_ptr<MF_EvaluateNetwork> generate_vtree_multi_function(const VirtualNodeTree &vtree,
-                                                                  OwnedResources &resources);
+                                                                  ResourceCollector &resources);
 
 }  // namespace FN
 
diff --git a/source/blender/functions2/intern/vtree_multi_function_network/builder.cc b/source/blender/functions2/intern/vtree_multi_function_network/builder.cc
index 4d503d187ff..a38ecfee28d 100644
--- a/source/blender/functions2/intern/vtree_multi_function_network/builder.cc
+++ b/source/blender/functions2/intern/vtree_multi_function_network/builder.cc
@@ -4,7 +4,7 @@ namespace FN {
 
 VTreeMFNetworkBuilder::VTreeMFNetworkBuilder(const VirtualNodeTree &vtree,
                                              const VTreeMultiFunctionMappings &vtree_mappings,
-                                             OwnedResources &resources)
+                                             ResourceCollector &resources)
     : m_vtree(vtree),
       m_vtree_mappings(vtree_mappings),
       m_resources(resources),
diff --git a/source/blender/functions2/intern/vtree_multi_function_network/builder.h b/source/blender/functions2/intern/vtree_multi_function_network/builder.h
index 2687ba2a90a..1167624ffaa 100644
--- a/source/blender/functions2/intern/vtree_multi_function_network/builder.h
+++ b/source/blender/functions2/intern/vtree_multi_function_network/builder.h
@@ -10,7 +10,7 @@ class VTreeMFNetworkBuilder : BLI::NonCopyable, BLI::NonMovable {
  private:
   const VirtualNodeTree &m_vtree;
   const VTreeMultiFunctionMappings &m_vtree_mappings;
-  OwnedResources &m_resources;
+  ResourceCollector &m_resources;
   Array<MFBuilderSocket *> m_socket_map;
   Array<MFDataType> m_type_by_vsocket;
   std::unique_ptr<MFNetworkBuilder> m_builder;
@@ -18,7 +18,7 @@ class VTreeMFNetworkBuilder : BLI::NonCopyable, BLI::NonMovable {
  public:
   VTreeMFNetworkBuilder(const VirtualNodeTree &vtree,
                         const VTreeMultiFunctionMappings &vtree_mappings,
-                        OwnedResources &resources);
+                        ResourceCollector &resources);
 
   const VirtualNodeTree &vtree() const
   {
diff --git a/source/blender/functions2/intern/vtree_multi_function_network/generate.cc b/source/blender/functions2/intern/vtree_multi_function_network/generate.cc
index 5a86c03536b..af9c2cda1dc 100644
--- a/source/blender/functions2/intern/vtree_multi_function_network/generate.cc
+++ b/source/blender/functions2/intern/vtree_multi_function_network/generate.cc
@@ -99,7 +99,7 @@ static bool insert_unlinked_inputs(VTreeMFNetworkBuilder &builder,
 }
 
 std::unique_ptr<VTreeMFNetwork> generate_vtree_multi_function_network(const VirtualNodeTree &vtree,
-                                                                      OwnedResources &resources)
+                                                                      ResourceCollector &resources)
 {
   const VTreeMultiFunctionMappings &mappings = get_vtree_multi_function_mappings();
 
@@ -119,7 +119,7 @@ std::unique_ptr<VTreeMFNetwork> generate_vtree_multi_function_network(const Virt
 }
 
 std::unique_ptr<MF_EvaluateNetwork> generate_vtree_multi_function(const VirtualNodeTree &vtree,
-                                                                  OwnedResources &resources)
+                                                                  ResourceCollector &resources)
 {
   std::unique_ptr<VTreeMFNetwork> network = generate_vtree_multi_function_network(vtree,
                                                                                   resources);
diff --git a/source/blender/functions2/intern/vtree_multi_function_network/mappings.h b/source/blender/functions2/intern/vtree_multi_function_network/mappings.h
index e3a479824f6..166e039b674 100644
--- a/source/blender/functions2/intern/vtree_multi_function_network/mappings.h
+++ b/source/blender/functions2/intern/vtree_multi_function_network/mappings.h
@@ -2,14 +2,14 @@
 
 #include "BLI_map.h"
 #include "BLI_string_map.h"
-#include "BLI_owned_resources.h"
+#include "BLI_resource_collector.h"
 
 #include "FN_vtree_multi_function_network.h"
 
 namespace FN {
 
 using BLI::Map;
-using BLI::OwnedResources;
+using BLI::ResourceCollector;
 using BLI::StringMap;
 
 struct VTreeMultiFunctionMappings;
diff --git a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
index 64e0e502559..89eea67bf7c 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
+++ b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
@@ -45,7 +45,7 @@ void MOD_functiondeform_do(FunctionDeformModifierData *fdmd,
   vtree_builder.add_all_of_node_tree(btree);
   auto vtree = vtree_builder.build();
 
-  BLI::OwnedResources resources;
+  BLI::Res

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list