[Bf-blender-cvs] [eb74be102e7] functions: Rename StridedArrayRef to MappedArrayRef

Jacques Lucke noreply at git.blender.org
Wed May 15 18:10:26 CEST 2019


Commit: eb74be102e7ff99e65170a7a9177b98fed27b56e
Author: Jacques Lucke
Date:   Wed May 15 18:03:08 2019 +0200
Branches: functions
https://developer.blender.org/rBeb74be102e7ff99e65170a7a9177b98fed27b56e

Rename StridedArrayRef to MappedArrayRef

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

M	source/blender/blenlib/BLI_array_ref.hpp
M	source/blender/blenlib/BLI_small_map.hpp

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

diff --git a/source/blender/blenlib/BLI_array_ref.hpp b/source/blender/blenlib/BLI_array_ref.hpp
index 35377f72821..af81fed9cf3 100644
--- a/source/blender/blenlib/BLI_array_ref.hpp
+++ b/source/blender/blenlib/BLI_array_ref.hpp
@@ -109,16 +109,15 @@ template<typename T> class ArrayRef {
   }
 };
 
-template<typename ArrayT, typename ValueT, ValueT (*GetValue)(ArrayT &item)>
-class StridedArrayRef {
+template<typename ArrayT, typename ValueT, ValueT (*GetValue)(ArrayT &item)> class MappedArrayRef {
  private:
   ArrayT *m_start = nullptr;
   uint m_size = 0;
 
  public:
-  StridedArrayRef() = default;
+  MappedArrayRef() = default;
 
-  StridedArrayRef(ArrayT *start, uint size) : m_start(start), m_size(size)
+  MappedArrayRef(ArrayT *start, uint size) : m_start(start), m_size(size)
   {
   }
 
@@ -129,11 +128,11 @@ class StridedArrayRef {
 
   class It {
    private:
-    StridedArrayRef m_array_ref;
+    MappedArrayRef m_array_ref;
     uint m_index;
 
    public:
-    It(StridedArrayRef array_ref, uint index) : m_array_ref(array_ref), m_index(index)
+    It(MappedArrayRef array_ref, uint index) : m_array_ref(array_ref), m_index(index)
     {
     }
 
diff --git a/source/blender/blenlib/BLI_small_map.hpp b/source/blender/blenlib/BLI_small_map.hpp
index fa802cadde7..6a10250f406 100644
--- a/source/blender/blenlib/BLI_small_map.hpp
+++ b/source/blender/blenlib/BLI_small_map.hpp
@@ -139,9 +139,9 @@ template<typename K, typename V, uint N = 4> class SmallMap {
     return entry.value;
   }
 
-  StridedArrayRef<Entry, V &, get_value_from_entry> values() const
+  MappedArrayRef<Entry, V &, get_value_from_entry> values() const
   {
-    return StridedArrayRef<Entry, V &, get_value_from_entry>(m_entries.begin(), m_entries.size());
+    return MappedArrayRef<Entry, V &, get_value_from_entry>(m_entries.begin(), m_entries.size());
   }
 
   static const K &get_key_from_entry(Entry &entry)
@@ -149,10 +149,10 @@ template<typename K, typename V, uint N = 4> class SmallMap {
     return entry.key;
   }
 
-  StridedArrayRef<Entry, const K &, get_key_from_entry> keys() const
+  MappedArrayRef<Entry, const K &, get_key_from_entry> keys() const
   {
-    return StridedArrayRef<Entry, const K &, get_key_from_entry>(m_entries.begin(),
-                                                                 m_entries.size());
+    return MappedArrayRef<Entry, const K &, get_key_from_entry>(m_entries.begin(),
+                                                                m_entries.size());
   }
 
   struct KeyValuePair {
@@ -169,10 +169,10 @@ template<typename K, typename V, uint N = 4> class SmallMap {
     return KeyValuePair(entry.key, entry.value);
   }
 
-  StridedArrayRef<Entry, KeyValuePair, get_key_value_pair_from_entry> items() const
+  MappedArrayRef<Entry, KeyValuePair, get_key_value_pair_from_entry> items() const
   {
-    return StridedArrayRef<Entry, KeyValuePair, get_key_value_pair_from_entry>(m_entries.begin(),
-                                                                               m_entries.size());
+    return MappedArrayRef<Entry, KeyValuePair, get_key_value_pair_from_entry>(m_entries.begin(),
+                                                                              m_entries.size());
   }
 };
 };  // namespace BLI



More information about the Bf-blender-cvs mailing list