--- parser3/src/include/pa_array.h 2003/02/17 12:13:43 1.57.2.24 +++ parser3/src/include/pa_array.h 2003/02/21 10:55:43 1.57.2.25 @@ -8,17 +8,18 @@ #ifndef PA_ARRAY_H #define PA_ARRAY_H -static const char* IDENT_ARRAY_Y="$Date: 2003/02/17 12:13:43 $"; +static const char* IDENT_ARRAY_H="$Date: 2003/02/21 10:55:43 $"; -#include "pa_pool.h" +// includes + +#include "pa_memory.h" #include "pa_exception.h" -template class Array_iterator; +// forwards -/** - Simple Array. +template class Array_iterator; -*/ +/// Simple Array template class Array: public PA_Object { friend class Array_iterator; @@ -74,11 +75,11 @@ public: /// append other Array portion to this one. starting from offset Array& append(const Array& src, int offset=0, int limit=0) { - if(!(offset>=0 && offset CharPtr; - -/** - Pool mechanizm allows users not to free up allocated memory, - leaving that problem to 'pools'. -*/ -class Pool: public Array { -public: - char *malloc(size_t size) { - CharPtr result=CharPtr((char *)Array::malloc(size)); - *this += result; - return result.get(); - } - - char *copy(const char* buf, size_t size=0) { - if(!size) - size=strlen(buf)+1; - - char *result=malloc(size); - memcpy(result, buf, size); - return result; - } - - char *format_integer(int value); -}; - -inline void *operator new[] (size_t size, Pool& pool) { - return pool.malloc(size); -} /// handy array iterator template class Array_iterator {