--- parser3/src/include/pa_array.h 2001/01/27 15:00:04 1.1 +++ parser3/src/include/pa_array.h 2001/01/29 12:00:45 1.6 @@ -1,5 +1,5 @@ /* - $Id: pa_array.h,v 1.1 2001/01/27 15:00:04 paf Exp $ + $Id: pa_array.h,v 1.6 2001/01/29 12:00:45 paf Exp $ */ /* @@ -33,6 +33,13 @@ public: CR_GROW_PERCENT=60 }; +public: + + int size() { return fused_rows; } + Array& operator += (Item src); + Item& operator [] (int index); + Array& operator += (Array& src); + private: friend Pool; @@ -50,6 +57,10 @@ private: } *head; // the head chunk of the chunk chain + // last allocated chunk + // helps appending Arrays + Chunk *tail; + // next append would write to this record Chunk::Row *append_here; @@ -58,12 +69,12 @@ private: Chunk::Row *link_row; private: - // last chank allocated count - int curr_chunk_rows; - // array size int fused_rows; + int cache_chunk_base; + Chunk *cache_chunk; + private: // new&constructors made private to enforce factory manufacturing at pool void *operator new(size_t size, Pool *apool); @@ -80,17 +91,12 @@ private: bool chunk_is_full() { return append_here == link_row; } - void expand(); + void expand(int chunk_rows); private: //disabled Array& operator = (Array& src) { return *this; } Array(Array& src) {} - -public: - - int size() { return fused_rows; } - Array& operator += (Item src); }; #endif