//=========================================================================== // Class declarations for StringStore and Pool. // A. Fischer, June 4, 2000 file: sstore.hpp // Modified by M. Fischer, October 8, 2009 //=========================================================================== #pragma once #include "tools.hpp" #define MAXLETS 1000 // Pool size. //=========================================================================== class Pool { friend class StringStore; private: char letters[MAXLETS]; // Memory behind stringarray. Pool* prev; // Previous StringStore, for deallocation. Pool( Pool* pv = NULL ) { prev = pv; } ~Pool(){} }; //=========================================================================== class StringStore { private: Pool* current; // Pool that is currently being filled. int remain; // Space remaining in current Pool. int next; // Subscript of next available slot. public: //------------------------------------------------- StringStore( int rem = MAXLETS ): current(new Pool), remain(rem), next(0) {} ~StringStore(); const_cstring put( const_cstring s, int len ); };