1998-11-24 18:34:24 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2002-02-06 15:12:24 -05:00
|
|
|
// Name: wx/arrimpl.cpp
|
1998-11-24 18:34:24 -05:00
|
|
|
// Purpose: helper file for implementation of dynamic lists
|
|
|
|
// Author: Vadim Zeitlin
|
1999-10-04 16:15:38 -04:00
|
|
|
// Modified by:
|
1998-11-24 18:34:24 -05:00
|
|
|
// Created: 16.10.97
|
|
|
|
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
2010-07-13 09:29:13 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-11-24 18:34:24 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/*****************************************************************************
|
2018-06-01 12:08:55 -04:00
|
|
|
* Purpose: implements helper functions used by the template class used by *
|
1998-11-24 18:34:24 -05:00
|
|
|
* DECLARE_OBJARRAY macro and which couldn't be implemented inline *
|
|
|
|
* (because they need the full definition of type T in scope) *
|
|
|
|
* *
|
|
|
|
* Usage: 1) #include dynarray.h *
|
|
|
|
* 2) WX_DECLARE_OBJARRAY *
|
|
|
|
* 3) #include arrimpl.cpp *
|
|
|
|
* 4) WX_DEFINE_OBJARRAY *
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2018-06-01 12:08:55 -04:00
|
|
|
#undef WX_DEFINE_OBJARRAY
|
|
|
|
#define WX_DEFINE_OBJARRAY(name) \
|
|
|
|
name::value_type* \
|
|
|
|
wxObjectArrayTraitsFor##name::Clone(const name::value_type& item) \
|
1998-11-24 18:34:24 -05:00
|
|
|
{ \
|
2018-06-01 12:08:55 -04:00
|
|
|
return new name::value_type(item); \
|
1998-11-24 18:34:24 -05:00
|
|
|
} \
|
|
|
|
\
|
2018-06-01 12:08:55 -04:00
|
|
|
void wxObjectArrayTraitsFor##name::Free(name::value_type* p) \
|
1998-11-24 18:34:24 -05:00
|
|
|
{ \
|
2018-06-01 12:08:55 -04:00
|
|
|
delete p; \
|
1999-10-04 16:15:38 -04:00
|
|
|
}
|