9 #ifndef _DynArray_h_incl_ 10 #define _DynArray_h_incl_ 12 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) // 3 idents I've seen 14 #else // Non-Windows compilation 15 #error "STOP: This version of DynArray requires the HeapAlloc API" 35 #if USE_DYNARRAY_LIMIT 37 #define MAX_DYNITEM 262144L // Limit items pointer block to 1 MB (2 MB on x64) 43 typedef bool (CALLBACK *
DYN_ITEMFUNC)( PVOID Item, PVOID UserData );
68 PVOID operator +=( PVOID Item ) {
return Insert( Item ); }
71 PVOID Insert( PVOID Item );
76 PVOID InsertAt(
DWORD Index, PVOID Item );
87 PVOID Push( PVOID Item );
91 virtual void DeleteItem( PVOID & Item );
96 virtual void DeleteAll(
void );
99 void Delete( PVOID& Item );
100 void Delete(
DWORD Index );
104 PVOID Remove( PVOID Item );
105 PVOID Remove(
DWORD Index );
110 LONG IndexOf( PVOID Item )
const;
113 PVOID At(
DWORD Index )
const;
116 PVOID FirstThat(
DYN_ITEMFUNC Match, PVOID userData )
const;
123 PVOID LastThat(
DYN_ITEMFUNC Match, PVOID userData )
const;
126 bool ForEach(
DYN_ITEMFUNC Action, PVOID userData )
const;
144 static void* __alloc(
size_t bytes );
145 static void* __realloc(
void* blk,
size_t bytes );
146 static void* __free(
void* blk );
163 PVOID operator +=( PVOID Item ) {
return Insert( Item ); }
166 virtual PVOID KeyOf( PVOID Item );
170 virtual short Compare( PVOID Key1, PVOID Key2 );
179 bool Search( PVOID Key,
DWORD& Index );
186 PVOID Insert( PVOID Item );
193 #endif //ndef _DynArray_h_incl_
#define END_NAMESPACE(name)
PVOID operator[](DWORD Index) const
bool(CALLBACK * DYN_ITEMFUNC)(PVOID Item, PVOID UserData)
#define BEGIN_NAMESPACE(name)
class DynArray * PDynArray
PVOID operator -=(PVOID Item)
class SortDynArray * PSortDynArray