home *** CD-ROM | disk | FTP | other *** search
- #ifndef H_OOF2
- #define H_OOF2
-
- // COPYRIGHT 1994 A.D. Software, All rights reserved
-
- // backend parent layer of OOFILE database
-
- // NOTE inline definitions included at end of this header file
-
- #include "oof1.hpp"
-
- // forward declarations
- class OOF_bit;
- class dbField;
- class dbBLOB;
- class dbTable;
-
- class dbRelChain;
- class dbRelHalf;
- class dbRelRefBase;
- class dbRelationship;
- class OOF_relChainList;
-
-
- class OOF_Context
- {
- public:
- virtual ~OOF_Context() {};
- };
-
-
- class OOF_ExpandableLongArray { // this would be a good candidate to template-ize
- public:
- OOF_ExpandableLongArray(unsigned long defaultValue, unsigned long numSlots=0, unsigned int expandBySlots=4);
- OOF_ExpandableLongArray(const OOF_ExpandableLongArray& rhs);
- ~OOF_ExpandableLongArray();
-
- OOF_ExpandableLongArray& operator=(const OOF_ExpandableLongArray&);
- void copyContents(const OOF_ExpandableLongArray&);
-
- // access protocol
- void append(unsigned long);
- void deleteCell(unsigned long index);
- void deleteAllCells();
- unsigned long& operator[](unsigned long index);
- unsigned long value(unsigned long index) const;
- unsigned long& item(unsigned long index);
-
-
- // iterator protocol
- void start();
- bool more();
- void next();
- unsigned long count() const;
- unsigned long& operator()();
-
- protected:
- enum {kSlotSize=sizeof(unsigned long)};
- void ExpandToInclude(unsigned long indexToCover);
- void CreateArrayRefCount();
- void DeleteBits();
-
- // data storage
- unsigned long *mBits; // owned
- unsigned long mDefaultValue;
- unsigned long mNextFreeEntry, mNumSlots, mInternalIter;
- unsigned int mExpansionChunk;
- int* mArrayRefCount; // owned
-
- };
-
-
- // include inline definitions
- #include "oof2.inl"
-
- #endif