-//@{
- /**
- This macro generates a new array class. It is intended for storage of simple
- types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
- <BR>
- NB: it has only inline functions => takes no space at all
- <BR>
-
- @memo declare and define array class 'name' containing elements of type 'T'
- */
-#define WX_DEFINE_ARRAY(T, name) \
- typedef T _A##name; \
- _WX_DEFINE_ARRAY(_A##name, name, class)
-
- /**
- This macro does the same as WX_DEFINE_ARRAY except that the array will be
- sorted with the specified compare function.
- */
-#define WX_DEFINE_SORTED_ARRAY(T, name) \
- typedef T _A##name; \
- _WX_DEFINE_SORTED_ARRAY(_A##name, name, class)
-
- /**
- This macro generates a new objarrays class which owns the objects it
- contains, i.e. it will delete them when it is destroyed. An element is of
- type T*, but arguments of type T& are taken (see below!) and T& is
- returned. <BR>
- Don't use this for simple types such as "int" or "long"!
- You _may_ use it for "double" but it's awfully inefficient.
- <BR>
- <BR>
- Note on Add/Insert functions:
- <BR>
- 1) function(T*) gives the object to the array, i.e. it will delete the
- object when it's removed or in the array's dtor
- <BR>
- 2) function(T&) will create a copy of the object and work with it
- <BR>
- <BR>
- Also:
- <BR>
- 1) Remove() will delete the object after removing it from the array
- <BR>
- 2) Detach() just removes the object from the array (returning pointer to it)
- <BR>
- <BR>
- NB1: Base type T should have an accessible copy ctor if Add(T&) is used,
- <BR>
- NB2: Never ever cast a array to it's base type: as dtor is <B>not</B> virtual
- it will provoke memory leaks
- <BR>
- <BR>
- some functions of this class are not inline, so it takes some space to
- define new class from this template.
-
- @memo declare objarray class 'name' containing elements of type 'T'
- */
-#define WX_DECLARE_OBJARRAY(T, name) \
- typedef T _L##name; \
- _WX_DECLARE_OBJARRAY(_L##name, name, class)
-
- /**
- To use an objarray class you must
- <ll>
- <li>#include "dynarray.h"
- <li>WX_DECLARE_OBJARRAY(element_type, list_class_name)
- <li>#include "arrimpl.cpp"
- <li>WX_DEFINE_OBJARRAY(list_class_name) // same as above!
- </ll>
- <BR><BR>
- This is necessary because at the moment of DEFINE_OBJARRAY class
- element_type must be fully defined (i.e. forward declaration is not
- enough), while WX_DECLARE_OBJARRAY may be done anywhere. The separation of
- two allows to break cicrcular dependencies with classes which have member
- variables of objarray type.
-
- @memo define (must include arrimpl.cpp!) objarray class 'name'
- */
-#define WX_DEFINE_OBJARRAY(name) "don't forget to include arrimpl.cpp!"
-//@}
-
-// these macros do the same thing as the WX_XXX ones above, but should be used
-// inside the library for user visible classes because otherwise they wouldn't
-// be visible from outside (when using wxWindows as DLL under Windows)
-#define WX_DEFINE_EXPORTED_ARRAY(T, name) \
- typedef T _A##name; \
- _WX_DEFINE_ARRAY(_A##name, name, class WXDLLEXPORT)
-
-#define WX_DEFINE_SORTED_EXPORTED_ARRAY(T, name) \
- typedef T _A##name; \
- _WX_DEFINE_SORTED_ARRAY(_A##name, name, class WXDLLEXPORT)
-
-#define WX_DECLARE_EXPORTED_OBJARRAY(T, name) \
- typedef T _L##name; \
- _WX_DECLARE_OBJARRAY(_L##name, name, class WXDLLEXPORT)
+#define WX_DEFINE_SORTED_ARRAY_CMP(T, cmpfunc, name) \
+ WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP(T, cmpfunc, name, \
+ wxARRAY_DEFAULT_EXPORT)
+
+#define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP(T, cmpfunc, name) \
+ WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP(T, cmpfunc, name, WXDLLEXPORT)
+
+#define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP(T, cmpfunc, name, expmode) \
+ typedef T _wxArray##name; \
+ _WX_DEFINE_SORTED_ARRAY(_wxArray##name, name, = cmpfunc, class expmode)