- This class should ideally be enclosed inside class BufferList, but that
- gave me an "internal gcc error".
- */
-class BufferStorage {
-#ifdef NEW_STORE
-public:
- ///
- typedef vector<Buffer *> Container;
- ///
- typedef Container::iterator iterator;
- ///
- bool empty() const { return container.empty(); }
- ///
- void release(Buffer * buf);
- ///
- Buffer * newBuffer(string const & s, LyXRC *, bool = false);
- ///
- Container::iterator begin() { return container.begin(); }
- ///
- Container::iterator end() { return container.end(); }
- ///
- Buffer * front() { return container.front(); }
- ///
- Buffer * operator[](int c) { return container[c]; }
- ///
- int size() const { return container.size(); }
-private:
- ///
- Container container;
-#else
-public:
- ///
- BufferStorage();
- ///
- bool empty();
- ///
- void release(Buffer * buf);
- ///
- Buffer* newBuffer(string const & s, LyXRC *, bool = false);
-private:
- enum {
- /** The max number of buffers there are possible to have
- loaded at the same time. (this only applies when we use an
- array)
- */
- NUMBER_OF_BUFFERS = 50
- };
-
- /** The Bufferlist is currently implemented as a static array.
- The buffers are new'ed and deleted as reqested.
- */
- Buffer *buffer[NUMBER_OF_BUFFERS];
- ///
- friend class BufferStorage_Iter;
-#endif
-};