[Bf-blender-cvs] [6a63774f435] functions: rename SmallMultiMap to MultiMap

Jacques Lucke noreply at git.blender.org
Mon Jul 22 18:13:29 CEST 2019


Commit: 6a63774f435380a690f4f469726356e76115c829
Author: Jacques Lucke
Date:   Mon Jul 22 17:07:58 2019 +0200
Branches: functions
https://developer.blender.org/rB6a63774f435380a690f4f469726356e76115c829

rename SmallMultiMap to MultiMap

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

M	source/blender/blenkernel/BKE_node_tree.hpp
M	source/blender/blenkernel/intern/node_tree.cpp
R096	source/blender/blenlib/BLI_small_multimap.hpp	source/blender/blenlib/BLI_multimap.hpp
M	source/blender/blenlib/CMakeLists.txt
M	source/blender/functions/backends/dependencies/dependencies-c.cpp
M	source/blender/functions/backends/dependencies/dependencies.hpp
M	source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
M	source/blender/functions/core/data_flow_graph_builder.hpp
M	source/blender/simulations/bparticles/node_frontend.cpp
R096	tests/gtests/blenlib/BLI_small_multimap_test.cc	tests/gtests/blenlib/BLI_multimap_test.cc
M	tests/gtests/blenlib/CMakeLists.txt

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

diff --git a/source/blender/blenkernel/BKE_node_tree.hpp b/source/blender/blenkernel/BKE_node_tree.hpp
index 5af7f6b1f44..dd9953a8c04 100644
--- a/source/blender/blenkernel/BKE_node_tree.hpp
+++ b/source/blender/blenkernel/BKE_node_tree.hpp
@@ -7,7 +7,7 @@
 #include "BLI_small_map.hpp"
 #include "BLI_small_vector.hpp"
 #include "BLI_listbase_wrapper.hpp"
-#include "BLI_small_multimap.hpp"
+#include "BLI_multimap.hpp"
 #include "BLI_monotonic_allocator.hpp"
 
 #include "RNA_access.h"
@@ -17,8 +17,8 @@ namespace BKE {
 using BLI::ArrayRef;
 using BLI::ListBaseWrapper;
 using BLI::MonotonicAllocator;
+using BLI::MultiMap;
 using BLI::SmallMap;
-using BLI::SmallMultiMap;
 using BLI::SmallVector;
 using BLI::StringRef;
 using BLI::StringRefNull;
@@ -116,9 +116,9 @@ class IndexedNodeTree {
   SmallVector<bNodeLink *> m_original_links;
   SmallVector<bNode *> m_actual_nodes;
   SmallMap<bNodeSocket *, bNode *> m_node_by_socket;
-  SmallMultiMap<bNodeSocket *, SocketWithNode> m_direct_links;
-  SmallMultiMap<bNodeSocket *, SocketWithNode> m_links;
-  SmallMultiMap<std::string, bNode *> m_nodes_by_idname;
+  MultiMap<bNodeSocket *, SocketWithNode> m_direct_links;
+  MultiMap<bNodeSocket *, SocketWithNode> m_links;
+  MultiMap<std::string, bNode *> m_nodes_by_idname;
   SmallVector<SingleOriginLink> m_single_origin_links;
 };
 
@@ -133,7 +133,7 @@ class VirtualNodeTree {
   SmallVector<VirtualNode *> m_nodes;
   SmallVector<VirtualLink *> m_links;
   SmallVector<VirtualSocket *> m_inputs_with_links;
-  SmallMultiMap<std::string, VirtualNode *> m_nodes_by_idname;
+  MultiMap<std::string, VirtualNode *> m_nodes_by_idname;
 
  public:
   void add_all_of_tree(bNodeTree *btree);
diff --git a/source/blender/blenkernel/intern/node_tree.cpp b/source/blender/blenkernel/intern/node_tree.cpp
index f643431912f..4c332b18838 100644
--- a/source/blender/blenkernel/intern/node_tree.cpp
+++ b/source/blender/blenkernel/intern/node_tree.cpp
@@ -201,7 +201,7 @@ void VirtualNodeTree::freeze_and_index()
 BLI_NOINLINE void VirtualNodeTree::initialize_direct_links()
 {
   /* TODO(jacques): reserve */
-  SmallMultiMap<VirtualSocket *, VirtualSocket *> connections;
+  MultiMap<VirtualSocket *, VirtualSocket *> connections;
   for (VirtualLink *link : m_links) {
     connections.add(link->m_from, link->m_to);
     connections.add(link->m_to, link->m_from);
diff --git a/source/blender/blenlib/BLI_small_multimap.hpp b/source/blender/blenlib/BLI_multimap.hpp
similarity index 96%
rename from source/blender/blenlib/BLI_small_multimap.hpp
rename to source/blender/blenlib/BLI_multimap.hpp
index 0ee0ae29968..c3cffe8a2bf 100644
--- a/source/blender/blenlib/BLI_small_multimap.hpp
+++ b/source/blender/blenlib/BLI_multimap.hpp
@@ -7,7 +7,7 @@
 
 namespace BLI {
 
-template<typename K, typename V, uint N = 4> class SmallMultiMap {
+template<typename K, typename V, uint N = 4> class MultiMap {
  private:
   struct Entry {
     uint offset;
@@ -24,7 +24,7 @@ template<typename K, typename V, uint N = 4> class SmallMultiMap {
   SmallVector<V, N> m_elements;
 
  public:
-  SmallMultiMap() = default;
+  MultiMap() = default;
 
   uint key_amount() const
   {
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 31046946401..54d95398ed5 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -253,7 +253,7 @@ set(SRC
   BLI_shared.hpp
   BLI_small_vector.hpp
   BLI_small_map.hpp
-  BLI_small_multimap.hpp
+  BLI_multimap.hpp
   BLI_set.hpp
   BLI_set_vector.hpp
   BLI_stack.hpp
diff --git a/source/blender/functions/backends/dependencies/dependencies-c.cpp b/source/blender/functions/backends/dependencies/dependencies-c.cpp
index 3301a778d49..89dd66b1263 100644
--- a/source/blender/functions/backends/dependencies/dependencies-c.cpp
+++ b/source/blender/functions/backends/dependencies/dependencies-c.cpp
@@ -19,8 +19,8 @@ void FN_function_update_dependencies(FnFunction fn_c, struct DepsNodeHandle *dep
   Function *fn = unwrap(fn_c);
   DepsBody *body = fn->body<DepsBody>();
   if (body) {
-    SmallMultiMap<uint, ID *> input_ids;
-    SmallMultiMap<uint, ID *> output_ids;
+    MultiMap<uint, ID *> input_ids;
+    MultiMap<uint, ID *> output_ids;
     DependencyComponents components;
 
     FunctionDepsBuilder builder(input_ids, output_ids, components);
diff --git a/source/blender/functions/backends/dependencies/dependencies.hpp b/source/blender/functions/backends/dependencies/dependencies.hpp
index 44ed37dbb6b..868e14fc08e 100644
--- a/source/blender/functions/backends/dependencies/dependencies.hpp
+++ b/source/blender/functions/backends/dependencies/dependencies.hpp
@@ -14,13 +14,13 @@ struct DependencyComponents {
 
 class FunctionDepsBuilder {
  private:
-  const SmallMultiMap<uint, ID *> &m_input_ids;
-  SmallMultiMap<uint, ID *> &m_output_ids;
+  const MultiMap<uint, ID *> &m_input_ids;
+  MultiMap<uint, ID *> &m_output_ids;
   DependencyComponents &m_dependency_components;
 
  public:
-  FunctionDepsBuilder(const SmallMultiMap<uint, ID *> &input_ids,
-                      SmallMultiMap<uint, ID *> &output_ids,
+  FunctionDepsBuilder(const MultiMap<uint, ID *> &input_ids,
+                      MultiMap<uint, ID *> &output_ids,
                       DependencyComponents &dependency_components)
       : m_input_ids(input_ids),
         m_output_ids(output_ids),
diff --git a/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp b/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
index c59445a337d..49e3db2e43d 100644
--- a/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
+++ b/source/blender/functions/backends/dependencies/fgraph_dependencies.cpp
@@ -42,7 +42,7 @@ class FGraphDependencies : public DepsBody {
         return {};
       }
       else {
-        SmallMultiMap<uint, ID *> input_ids;
+        MultiMap<uint, ID *> input_ids;
 
         for (uint i = 0; i < fn->input_amount(); i++) {
           input_ids.add_multiple_new(
@@ -51,7 +51,7 @@ class FGraphDependencies : public DepsBody {
                                           parent_builder));
         }
 
-        SmallMultiMap<uint, ID *> output_ids;
+        MultiMap<uint, ID *> output_ids;
         FunctionDepsBuilder builder(input_ids, output_ids, parent_builder.dependency_components());
         body->build_deps(builder);
         return output_ids.lookup_default(m_graph->index_of_output(socket));
diff --git a/source/blender/functions/core/data_flow_graph_builder.hpp b/source/blender/functions/core/data_flow_graph_builder.hpp
index d1bd6b3e874..faa428f9580 100644
--- a/source/blender/functions/core/data_flow_graph_builder.hpp
+++ b/source/blender/functions/core/data_flow_graph_builder.hpp
@@ -13,7 +13,7 @@
 #include "BLI_optional.hpp"
 #include "BLI_set_vector.hpp"
 #include "BLI_monotonic_allocator.hpp"
-#include "BLI_small_multimap.hpp"
+#include "BLI_multimap.hpp"
 
 namespace FN {
 
@@ -190,7 +190,7 @@ class DataFlowGraphBuilder {
  private:
   Set<DFGB_Node *> m_nodes;
   SmallMap<DFGB_Socket, DFGB_Socket> m_input_origins;
-  SmallMultiMap<DFGB_Socket, DFGB_Socket> m_output_targets;
+  MultiMap<DFGB_Socket, DFGB_Socket> m_output_targets;
   MonotonicAllocator<sizeof(DFGB_Node) * 4> m_node_allocator;
   std::unique_ptr<MonotonicAllocator<>> m_source_info_allocator;
 
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index db2cec21416..2381d9b7982 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -1,5 +1,5 @@
 #include "BLI_timeit.hpp"
-#include "BLI_small_multimap.hpp"
+#include "BLI_multimap.hpp"
 
 #include "node_frontend.hpp"
 #include "inserters.hpp"
@@ -7,7 +7,7 @@
 
 namespace BParticles {
 
-using BLI::SmallMultiMap;
+using BLI::MultiMap;
 
 static bool is_particle_type_node(VirtualNode *vnode)
 {
@@ -56,7 +56,7 @@ std::unique_ptr<StepDescription> step_description_from_node_tree(VirtualNodeTree
 
   BuildContext ctx = {data_graph, step_builder, world_state};
 
-  SmallMultiMap<std::string, Force *> forces;
+  MultiMap<std::string, Force *> forces;
   for (auto item : get_force_builders().items()) {
     for (VirtualNode *vnode : vtree.nodes_with_idname(item.key)) {
       for (VirtualSocket *linked : vnode->output(0)->links()) {
diff --git a/tests/gtests/blenlib/BLI_small_multimap_test.cc b/tests/gtests/blenlib/BLI_multimap_test.cc
similarity index 96%
rename from tests/gtests/blenlib/BLI_small_multimap_test.cc
rename to tests/gtests/blenlib/BLI_multimap_test.cc
index db7943e76b3..48a8c6af147 100644
--- a/tests/gtests/blenlib/BLI_small_multimap_test.cc
+++ b/tests/gtests/blenlib/BLI_multimap_test.cc
@@ -1,9 +1,9 @@
 #include "testing/testing.h"
-#include "BLI_small_multimap.hpp"
+#include "BLI_multimap.hpp"
 
 using namespace BLI;
 
-using IntMultiMap = SmallMultiMap<int, int>;
+using IntMultiMap = MultiMap<int, int>;
 
 TEST(multimap, DefaultConstructor)
 {
diff --git a/tests/gtests/blenlib/CMakeLists.txt b/tests/gtests/blenlib/CMakeLists.txt
index 21acf1083cc..bdb3565fbc8 100644
--- a/tests/gtests/blenlib/CMakeLists.txt
+++ b/tests/gtests/blenlib/CMakeLists.txt
@@ -69,7 +69,7 @@ BLENDER_TEST(BLI_set "bf_blenlib")
 BLENDER_TEST(BLI_set_vector "bf_blenlib")
 BLENDER_TEST(BLI_stack_cpp "bf_blenlib")
 BLENDER_TEST(BLI_small_map "bf_blenlib")
-BLENDER_TEST(BLI_small_multimap "bf_blenlib")
+BLENDER_TEST(BLI_multimap "bf_blenlib")
 BLENDER_TEST(BLI_stack "bf_blenlib")
 BLENDER_TEST(BLI_string "bf_blenlib")
 BLENDER_TEST(BLI_string_ref "bf_blenlib")



More information about the Bf-blender-cvs mailing list