you may find some useful hints about optimizing wxArray memory usage. As for executable size, all
wxArray functions are inline, so they do not take {\it any space at all}.
-wxWindows has three different kinds of array. All of them derive from
+wxWidgets has three different kinds of array. All of them derive from
wxBaseArray class which works with untyped data and can not be used directly.
The standard macros WX\_DEFINE\_ARRAY(), WX\_DEFINE\_SORTED\_ARRAY() and
WX\_DEFINE\_OBJARRAY() are used to define a new class deriving from it. The
all of wxArray's functions are inline, so it costs strictly nothing to define as
many array types as you want (either in terms of the executable size or the
speed) as long as at least one of them is defined and this is always the case
-because wxArrays are used by wxWindows internally. This class has one serious
+because wxArrays are used by wxWidgets internally. This class has one serious
limitation: it can only be used for storing integral types (bool, char, short,
int, long and their unsigned variants) or pointers (of any kind). An attempt
to use with objects of sizeof() greater than sizeof(long) will provoke a
runtime assertion failure, however declaring a wxArray of floats will not (on
the machines where sizeof(float) <= sizeof(long)), yet it will {\bf not} work,
please use wxObjArray for storing floats and doubles (NB: a more efficient
-wxArrayDouble class is scheduled for the next release of wxWindows).
+wxArrayDouble class is scheduled for the next release of wxWidgets).
wxSortedArray is a wxArray variant which should be used when searching in the
array is a frequently used operation. It requires you to define an additional
just to write
\begin{verbatim}
-WX_DEFINE_ARRAY(MyDirectory *, ArrayOfDirectories);
-WX_DEFINE_SORTED_ARRAY(MyFile *, ArrayOfFiles);
+WX_DEFINE_ARRAY(int, ArrayOfDirectories);
+WX_DEFINE_SORTED_ARRAY(int, ArrayOfFiles);
\end{verbatim}
+i.e. there is only one {\tt DEFINE} macro and no need for separate
+{\tt DECLARE} one.
+
+
\wxheading{See also:}
\helpref{Container classes overview}{wxcontaineroverview}, \helpref{wxList}{wxlist}
\helpref{WX\_DEFINE\_EXPORTED\_OBJARRAY}{wxdefineobjarray}\\
\helpref{WX\_DEFINE\_USER\_EXPORTED\_OBJARRAY}{wxdefineobjarray}
+To slightly complicate the matters even further, the operator $->$ defined by
+default for the array iterators by these macros only makes sense if the array
+element type is not a pointer itself and, although it still works, this
+provokes warnings from some compilers and to avoid them you should use the
+{\tt \_PTR} versions of the macros above. For example, to define an array of
+pointers to {\tt double} you should use
+
+\begin{verbatim}
+WX_DEFINE_ARRAY_PTR(double *, MyArrayOfDoublePointers);
+\end{verbatim}
+
\membersection{Constructors and destructors}
Array classes are 100\% C++ objects and as such they have the appropriate copy
\func{}{WX\_DEFINE\_USER\_EXPORTED\_ARRAY}{\param{}{T}, \param{}{name}, \param{}{exportspec}}
This macro defines a new array class named {\it name} and containing the
-elements of type {\it T}. The second form is used when compiling wxWindows as
+elements of type {\it T}. The second form is used when compiling wxWidgets as
a DLL under Windows and array needs to be visible outside the DLL. The third is
needed for exporting an array from a user DLL.
WX_DEFINE_ARRAY(MyClass *, wxArrayOfMyClass);
\end{verbatim}
-Note that wxWindows predefines the following standard array classes: wxArrayInt,
+Note that wxWidgets predefines the following standard array classes: wxArrayInt,
wxArrayLong and wxArrayPtrVoid.
\membersection{WX\_DEFINE\_SORTED\_ARRAY}\label{wxdefinesortedarray}
\func{}{WX\_DEFINE\_SORTED\_USER\_EXPORTED\_ARRAY}{\param{}{T}, \param{}{name}}
This macro defines a new sorted array class named {\it name} and containing
-the elements of type {\it T}. The second form is used when compiling wxWindows as
+the elements of type {\it T}. The second form is used when compiling wxWidgets as
a DLL under Windows and array needs to be visible outside the DLL. The third is
needed for exporting an array from a user DLL.
\func{}{WX\_DECLARE\_USER\_EXPORTED\_OBJARRAY}{\param{}{T}, \param{}{name}}
This macro declares a new object array class named {\it name} and containing
-the elements of type {\it T}. The second form is used when compiling wxWindows as
+the elements of type {\it T}. The second form is used when compiling wxWidgets as
a DLL under Windows and array needs to be visible outside the DLL. The third is
needed for exporting an array from a user DLL.