]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dynarray.h
adding overlay implementation for core graphics
[wxWidgets.git] / include / wx / dynarray.h
index 18c1d42702aa29390b3991ea6824353a06b61eae..81c12e84b5fba0ea4e2c8586ba7c23d4bf3c95ec 100644 (file)
@@ -226,7 +226,8 @@ protected:                                                          \
   void pop_back() { RemoveAt(size() - 1); }                         \
   void push_back(const value_type& v) { Add(v); }                   \
   void reserve(size_type n) { if(n > m_nSize) Realloc(n); }         \
-  void resize(size_type n, value_type v = value_type());            \
+  void resize(size_type n, value_type v = value_type())             \
+    { SetCount(n, v); }                                             \
                                                                     \
   iterator begin() { return m_pItems; }                             \
   iterator end() { return m_pItems + m_nCount; }                    \
@@ -400,8 +401,8 @@ public:                                                               \
       { reverse_iterator tmp = *this; --m_ptr; return tmp; }          \
     itor& operator--() { ++m_ptr; return *this; }                     \
     const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\
-    bool operator ==(const itor& it) { return m_ptr == it.m_ptr; }    \
-    bool operator !=(const itor& it) { return m_ptr != it.m_ptr; }    \
+    bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\
+    bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\
   };                                                                  \
                                                                       \
   class const_reverse_iterator                                        \
@@ -433,8 +434,8 @@ public:                                                               \
       { itor tmp = *this; --m_ptr; return tmp; }                      \
     itor& operator--() { ++m_ptr; return *this; }                     \
     const itor operator--(int) { itor tmp = *this; ++m_ptr; return tmp; }\
-    bool operator ==(const itor& it) { return m_ptr == it.m_ptr; }    \
-    bool operator !=(const itor& it) { return m_ptr != it.m_ptr; }    \
+    bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }\
+    bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }\
   };                                                                  \
                                                                       \
   name(size_type n, const_reference v) { assign(n, v); }              \
@@ -472,7 +473,8 @@ public:                                                               \
   reverse_iterator rend() { return reverse_iterator(begin() - 1); }   \
   const_reverse_iterator rend() const;                                \
   void reserve(size_type n) { base::reserve(n); };                    \
-  void resize(size_type n, value_type v = value_type());              \
+  void resize(size_type n, value_type v = value_type())               \
+    { base::resize(n, v); }                                           \
 }
 
 #define _WX_PTROP pointer operator->() const { return m_ptr; }
@@ -957,6 +959,7 @@ WX_DECLARE_USER_EXPORTED_BASEARRAY(double, wxBaseArrayDouble, WXDLLIMPEXP_BASE);
 
 WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(short, wxArrayShort, class WXDLLIMPEXP_BASE);
 WX_DEFINE_USER_EXPORTED_ARRAY_INT(int, wxArrayInt, class WXDLLIMPEXP_BASE);
+WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(double, wxArrayDouble, class WXDLLIMPEXP_BASE);
 WX_DEFINE_USER_EXPORTED_ARRAY_LONG(long, wxArrayLong, class WXDLLIMPEXP_BASE);
 WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE);
 
@@ -967,10 +970,10 @@ WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE
 // append all element of one array to another one
 #define WX_APPEND_ARRAY(array, other)                                         \
     {                                                                         \
-        size_t count = (other).size();                                        \
-        for ( size_t n = 0; n < count; n++ )                                  \
+        size_t wxAAcnt = (other).size();                                      \
+        for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ )                    \
         {                                                                     \
-            (array).push_back((other)[n]);                                    \
+            (array).push_back((other)[wxAAn]);                                \
         }                                                                     \
     }
 
@@ -982,10 +985,10 @@ WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE
 //     count on it)!
 #define WX_CLEAR_ARRAY(array)                                                 \
     {                                                                         \
-        size_t count = (array).size();                                        \
-        for ( size_t n = 0; n < count; n++ )                                  \
+        size_t wxAAcnt = (array).size();                                      \
+        for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ )                    \
         {                                                                     \
-            delete (array)[n];                                                \
+            delete (array)[wxAAn];                                            \
         }                                                                     \
                                                                               \
         (array).clear();                                                      \