--- parser3/src/include/pa_array.h 2001/01/27 15:21:05 1.2 +++ parser3/src/include/pa_array.h 2001/01/29 10:15:14 1.5 @@ -1,5 +1,5 @@ /* - $Id: pa_array.h,v 1.2 2001/01/27 15:21:05 paf Exp $ + $Id: pa_array.h,v 1.5 2001/01/29 10:15:14 paf Exp $ */ /* @@ -50,6 +50,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,16 +62,11 @@ private: Chunk::Row *link_row; private: - // last chank allocated count - int curr_chunk_rows; - // array size int fused_rows; - int cache_index; - Chunk::Row *cache_row; - int cache_countdown; - Chunk::Row *cache_link_row; + int cache_chunk_base; + Chunk *cache_chunk; private: // new&constructors made private to enforce factory manufacturing at pool @@ -85,18 +84,14 @@ private: bool chunk_is_full() { return append_here == link_row; } - void expand(); + void expand(int chunk_rows); public: int size() { return fused_rows; } Array& operator += (Item src); - - /* - void put(int index, Item item); - Item get(int index); - */ Item& operator [] (int index); + Array& operator += (Array& src); private: //disabled