#ifndef __DATABASE_H__ #define __DATABASE_H__ #include "database-types.h" #include "database-segment.h" #include "database-internal.h" class Database : public Base { public: Database() : start(0), end(0), currentId(1) { } ~Database() { while(start) delete start; } DatabaseCell * getStart() { return start; } DatabaseCell * getEnd() { return end; } void setStart(DatabaseCell * newStart) { start = newStart; } void setEnd(DatabaseCell * newEnd) { end = newEnd; } Segment * getSegment(Uint32 id) { DatabaseCell * cursor; for (cursor = start; start; cursor = cursor->getNext()) if (cursor->getId() == id) return cursor->getSegment(); return 0; } Uint32 GetNextSegId() { return currentId++; } private: DatabaseCell * start, * end; Uint32 currentId; }; #endif