[Bf-blender-cvs] [a1ba33090b1] functions: rename SmallMap to Map

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


Commit: a1ba33090b1f5afdc1d864e6dc2dd368061f4077
Author: Jacques Lucke
Date:   Mon Jul 22 17:10:42 2019 +0200
Branches: functions
https://developer.blender.org/rBa1ba33090b1f5afdc1d864e6dc2dd368061f4077

rename SmallMap to Map

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

M	source/blender/blenkernel/BKE_node_tree.hpp
M	source/blender/blenkernel/intern/node_tree.cpp
M	source/blender/blenlib/BLI_composition.hpp
R098	source/blender/blenlib/BLI_small_map.hpp	source/blender/blenlib/BLI_map.hpp
M	source/blender/blenlib/BLI_multimap.hpp
M	source/blender/blenlib/BLI_string_map.hpp
M	source/blender/blenlib/BLI_task.hpp
M	source/blender/blenlib/CMakeLists.txt
M	source/blender/functions/backends/llvm/build_ir_body.hpp
M	source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
M	source/blender/functions/core/data_flow_graph.hpp
M	source/blender/functions/core/data_flow_graph_builder.hpp
M	source/blender/functions/frontends/data_flow_nodes/builder.cpp
M	source/blender/functions/frontends/data_flow_nodes/builder.hpp
M	source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
M	source/blender/functions/frontends/data_flow_nodes/graph_generation.hpp
M	source/blender/functions/frontends/data_flow_nodes/inserters.hpp
M	source/blender/functions/functions/auto_vectorization.cpp
M	source/blender/functions/functions/lists.cpp
M	source/blender/functions/functions/switch.cpp
M	source/blender/simulations/bparticles/particles_container.hpp
M	source/blender/simulations/bparticles/world_state.hpp
R098	tests/gtests/blenlib/BLI_small_map_test.cc	tests/gtests/blenlib/BLI_map_test.cc
M	tests/gtests/blenlib/BLI_small_vector_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 dd9953a8c04..5e8ea5320fc 100644
--- a/source/blender/blenkernel/BKE_node_tree.hpp
+++ b/source/blender/blenkernel/BKE_node_tree.hpp
@@ -4,7 +4,7 @@
 
 #include "BLI_string_ref.hpp"
 #include "BLI_array_ref.hpp"
-#include "BLI_small_map.hpp"
+#include "BLI_map.hpp"
 #include "BLI_small_vector.hpp"
 #include "BLI_listbase_wrapper.hpp"
 #include "BLI_multimap.hpp"
@@ -16,9 +16,9 @@ namespace BKE {
 
 using BLI::ArrayRef;
 using BLI::ListBaseWrapper;
+using BLI::Map;
 using BLI::MonotonicAllocator;
 using BLI::MultiMap;
-using BLI::SmallMap;
 using BLI::SmallVector;
 using BLI::StringRef;
 using BLI::StringRefNull;
@@ -115,7 +115,7 @@ class IndexedNodeTree {
   SmallVector<bNode *> m_original_nodes;
   SmallVector<bNodeLink *> m_original_links;
   SmallVector<bNode *> m_actual_nodes;
-  SmallMap<bNodeSocket *, bNode *> m_node_by_socket;
+  Map<bNodeSocket *, bNode *> m_node_by_socket;
   MultiMap<bNodeSocket *, SocketWithNode> m_direct_links;
   MultiMap<bNodeSocket *, SocketWithNode> m_links;
   MultiMap<std::string, bNode *> m_nodes_by_idname;
diff --git a/source/blender/blenkernel/intern/node_tree.cpp b/source/blender/blenkernel/intern/node_tree.cpp
index 4c332b18838..ca58c52c1ec 100644
--- a/source/blender/blenkernel/intern/node_tree.cpp
+++ b/source/blender/blenkernel/intern/node_tree.cpp
@@ -106,7 +106,7 @@ ArrayRef<SingleOriginLink> IndexedNodeTree::single_origin_links() const
 
 void VirtualNodeTree::add_all_of_tree(bNodeTree *btree)
 {
-  SmallMap<bNode *, VirtualNode *> node_mapping;
+  Map<bNode *, VirtualNode *> node_mapping;
   for (bNode *bnode : BKE::bNodeList(btree->nodes)) {
     VirtualNode *vnode = this->add_bnode(btree, bnode);
     node_mapping.add_new(bnode, vnode);
diff --git a/source/blender/blenlib/BLI_composition.hpp b/source/blender/blenlib/BLI_composition.hpp
index a59b929b992..ee6673203b5 100644
--- a/source/blender/blenlib/BLI_composition.hpp
+++ b/source/blender/blenlib/BLI_composition.hpp
@@ -8,7 +8,7 @@
  * over multiple inheritance.
  */
 
-#include "BLI_small_map.hpp"
+#include "BLI_map.hpp"
 
 namespace BLI {
 
@@ -66,7 +66,7 @@ class Composition {
     return T::free_self;
   }
 
-  BLI::SmallMap<uint64_t, Entry> m_elements;
+  BLI::Map<uint64_t, Entry> m_elements;
 };
 
 } /* namespace BLI */
diff --git a/source/blender/blenlib/BLI_small_map.hpp b/source/blender/blenlib/BLI_map.hpp
similarity index 98%
rename from source/blender/blenlib/BLI_small_map.hpp
rename to source/blender/blenlib/BLI_map.hpp
index e9abc133b2d..e4341b6e73a 100644
--- a/source/blender/blenlib/BLI_small_map.hpp
+++ b/source/blender/blenlib/BLI_map.hpp
@@ -30,7 +30,7 @@
 
 namespace BLI {
 
-template<typename K, typename V, uint N = 4> class SmallMap {
+template<typename K, typename V, uint N = 4> class Map {
  private:
   struct Entry {
     K key;
@@ -51,7 +51,7 @@ template<typename K, typename V, uint N = 4> class SmallMap {
   /**
    * Create an empty map.
    */
-  SmallMap() = default;
+  Map() = default;
 
   /**
    * Insert a key-value pair in the map, when the key does not exist.
diff --git a/source/blender/blenlib/BLI_multimap.hpp b/source/blender/blenlib/BLI_multimap.hpp
index c3cffe8a2bf..1e2fa6ada9a 100644
--- a/source/blender/blenlib/BLI_multimap.hpp
+++ b/source/blender/blenlib/BLI_multimap.hpp
@@ -2,7 +2,7 @@
 
 /* A multimap is a map that allows storing multiple values per key. */
 
-#include "BLI_small_map.hpp"
+#include "BLI_map.hpp"
 #include "BLI_array_ref.hpp"
 
 namespace BLI {
@@ -20,7 +20,7 @@ template<typename K, typename V, uint N = 4> class MultiMap {
     }
   };
 
-  SmallMap<K, Entry, N> m_map;
+  Map<K, Entry, N> m_map;
   SmallVector<V, N> m_elements;
 
  public:
@@ -122,7 +122,7 @@ template<typename K, typename V, uint N = 4> class MultiMap {
     return m_map.contains(key);
   }
 
-  typename SmallMap<K, Entry>::KeysReturnT keys() const
+  typename Map<K, Entry>::KeysReturnT keys() const
   {
     return m_map.keys();
   }
diff --git a/source/blender/blenlib/BLI_string_map.hpp b/source/blender/blenlib/BLI_string_map.hpp
index 32e705fe9a7..457f335ad89 100644
--- a/source/blender/blenlib/BLI_string_map.hpp
+++ b/source/blender/blenlib/BLI_string_map.hpp
@@ -26,14 +26,14 @@
 
 #pragma once
 
-#include "BLI_small_map.hpp"
+#include "BLI_map.hpp"
 #include "BLI_string_ref.hpp"
 
 namespace BLI {
 
 template<typename V> class StringMap {
  private:
-  SmallMap<std::string, V> m_map;
+  Map<std::string, V> m_map;
 
  public:
   StringMap() = default;
diff --git a/source/blender/blenlib/BLI_task.hpp b/source/blender/blenlib/BLI_task.hpp
index d4fae935159..e339dca1df2 100644
--- a/source/blender/blenlib/BLI_task.hpp
+++ b/source/blender/blenlib/BLI_task.hpp
@@ -4,7 +4,7 @@
 
 #include "BLI_task.h"
 #include "BLI_array_ref.hpp"
-#include "BLI_small_map.hpp"
+#include "BLI_map.hpp"
 #include "BLI_range.hpp"
 
 namespace BLI {
@@ -77,7 +77,7 @@ static void parallel_array_elements(ArrayRef<T> array,
     ArrayRef<T> array;
     ProcessElement &process_element;
     CreateThreadLocal &create_thread_local;
-    SmallMap<int, LocalData> thread_locals;
+    Map<int, LocalData> thread_locals;
     std::mutex thread_locals_mutex;
   } data = {array, process_element, create_thread_local, {}, {}};
 
diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt
index 54d95398ed5..69b478b91fd 100644
--- a/source/blender/blenlib/CMakeLists.txt
+++ b/source/blender/blenlib/CMakeLists.txt
@@ -252,7 +252,7 @@ set(SRC
   intern/BLI_range.cpp
   BLI_shared.hpp
   BLI_small_vector.hpp
-  BLI_small_map.hpp
+  BLI_map.hpp
   BLI_multimap.hpp
   BLI_set.hpp
   BLI_set_vector.hpp
diff --git a/source/blender/functions/backends/llvm/build_ir_body.hpp b/source/blender/functions/backends/llvm/build_ir_body.hpp
index 3cd7cacbbed..b4d6fa2f236 100644
--- a/source/blender/functions/backends/llvm/build_ir_body.hpp
+++ b/source/blender/functions/backends/llvm/build_ir_body.hpp
@@ -15,7 +15,7 @@ class BuildIRSettings {
   }
 };
 
-using FunctionIRCache = SmallMap<void *, llvm::Function *>;
+using FunctionIRCache = Map<void *, llvm::Function *>;
 
 class CodeInterface {
  private:
diff --git a/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp b/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
index b379b33d36e..9634386e189 100644
--- a/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
+++ b/source/blender/functions/backends/llvm/fgraph_ir_generation.cpp
@@ -10,7 +10,7 @@ class BuildGraphIR : public LLVMBuildIRBody {
   DataFlowGraph *m_graph;
   Set<DFGraphSocket> m_required_sockets;
 
-  using SocketValueMap = SmallMap<DFGraphSocket, llvm::Value *>;
+  using SocketValueMap = Map<DFGraphSocket, llvm::Value *>;
   using FunctionDFGB_SocketSet = Set<DFGraphSocket>;
 
  public:
diff --git a/source/blender/functions/core/data_flow_graph.hpp b/source/blender/functions/core/data_flow_graph.hpp
index 6305a48551a..c87192c20f7 100644
--- a/source/blender/functions/core/data_flow_graph.hpp
+++ b/source/blender/functions/core/data_flow_graph.hpp
@@ -190,9 +190,9 @@ class DataFlowGraph : public RefCountedBase {
   ~DataFlowGraph();
 
   struct ToBuilderMapping {
-    SmallMap<DFGB_Node *, uint> node_indices;
-    SmallMap<DFGB_Socket, uint> input_socket_indices;
-    SmallMap<DFGB_Socket, uint> output_socket_indices;
+    Map<DFGB_Node *, uint> node_indices;
+    Map<DFGB_Socket, uint> input_socket_indices;
+    Map<DFGB_Socket, uint> output_socket_indices;
 
     DFGraphSocket map_socket(DFGB_Socket dfgb_socket)
     {
diff --git a/source/blender/functions/core/data_flow_graph_builder.hpp b/source/blender/functions/core/data_flow_graph_builder.hpp
index faa428f9580..a1a7b95021f 100644
--- a/source/blender/functions/core/data_flow_graph_builder.hpp
+++ b/source/blender/functions/core/data_flow_graph_builder.hpp
@@ -189,7 +189,7 @@ class DataFlowGraphBuilder {
 
  private:
   Set<DFGB_Node *> m_nodes;
-  SmallMap<DFGB_Socket, DFGB_Socket> m_input_origins;
+  Map<DFGB_Socket, DFGB_Socket> m_input_origins;
   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/functions/frontends/data_flow_nodes/builder.cpp b/source/blender/functions/frontends/data_flow_nodes/builder.cpp
index c111de1ae35..4c4fd45267f 100644
--- a/source/blender/functions/frontends/data_flow_nodes/builder.cpp
+++ b/source/blender/functions/frontends/data_flow_nodes/builder.cpp
@@ -30,7 +30,7 @@ namespace DataFlowNodes {
 
 BTreeGraphBuilder::BTreeGraphBuilder(VirtualNodeTree &vtree,
                                      DataFlowGraphBuilder &graph,
-                                     SmallMap<VirtualSocket *, DFGB_Socket> &socket_map)
+                                     Map<VirtualSocket *, DFGB_Socket> &socket_map)
     : m_graph(graph),
       m_vtree(vtree),
       m_socket_map(socket_map),
diff --git a/source/blender/functions/frontends/data_flow_nodes/builder.hpp b/source/blender/functions/frontends/data_flow_nodes/builder.hpp
index af69b70d7dc..2e06248a393 100644
--- a/source/blender/functions/frontends/data_flow_nodes/builder.hpp
+++ b/source/blender/functions/frontends/data_flow_nodes/builder.hpp
@@ -21,14 +21,14 @@ class BTreeGraphBuilder {
  private:
   DataFlowGraphBuilder &m_graph;
   VirtualNodeTree &m_vtree;
-  SmallMap<VirtualSocket *, DFGB_Socket> &m_socket_map;
+  Map<VirtualSocket *, DFGB_Socket> &m_socket_map;
   StringMap<SharedType> &m_type_by_idname;
   StringMap<SharedType> &m_type_by_data_type;
 
  public:
   BTreeGraphBuilder(VirtualNodeTree &vtree,
                     DataFlowGraphBuilder &graph,
-                    SmallMap<VirtualSocket *, DFGB_Socket> &socket_map);
+                    Map<VirtualSocket *, DFGB_Socket> &socket_map);
 
   /* Insert Function */
   DFGB_Node *insert_function(SharedFunction &fn);
diff --git a/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp b/source/blender/functions/frontends/data_flow_nodes/graph_generation.cpp
index 42bfa5e72eb..f259b5f68e3 100644
--- a/source/blender/function

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list