///////////////////////////////////////////////////////////////////////////////
-// Name: dynarray.cpp
+// Name: src/common/dynarray.cpp
// Purpose: implementation of wxBaseArray class
// Author: Vadim Zeitlin
// Modified by:
// headers
// ============================================================================
+// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
- #pragma hdrstop
+ #pragma hdrstop
#endif
-#include "wx/dynarray.h"
-#include "wx/intl.h"
+#ifndef WX_PRECOMP
+ #include "wx/dynarray.h"
+ #include "wx/intl.h"
+#endif //WX_PRECOMP
#include <stdlib.h>
#include <string.h> // for memmove
wxDELETEA(m_pItems); \
} \
\
-/* pre-allocates memory (frees the previous data!) */ \
-void name::Alloc(size_t nSize) \
-{ \
- /* only if old buffer was not big enough */ \
- if ( nSize > m_nSize ) { \
- wxDELETEA(m_pItems); \
- m_nSize = 0; \
- m_pItems = new T[nSize]; \
- /* only alloc if allocation succeeded */ \
- if ( m_pItems ) { \
- m_nSize = nSize; \
- } \
- } \
- \
- m_nCount = 0; \
-} \
- \
/* minimizes the memory usage by freeing unused memory */ \
void name::Shrink() \
{ \
#endif
_WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid)
+_WX_DEFINE_BASEARRAY(char, wxBaseArrayChar)
_WX_DEFINE_BASEARRAY(short, wxBaseArrayShort)
_WX_DEFINE_BASEARRAY(int, wxBaseArrayInt)
_WX_DEFINE_BASEARRAY(long, wxBaseArrayLong)