home *** CD-ROM | disk | FTP | other *** search
- #ifndef H_OOFctree
- #define H_OOFctree
-
- // OOFILE c-tree Plus backend implementation
- // EXPORTED header - this is the one included in client programs
-
- #include "oof1.hpp"
- #include "oof3.hpp" // non-numeric fields
- #include "oof4.hpp" // numeric fields
-
- #ifdef __CW55__
- // conflicts with defs in string.h if extern "C" these
- #include "ctstdr.h"
- #include "ctifil.h"
- #else
- extern "C" {
- #include "ctstdr.h"
- #include "ctifil.h"
- }
- #endif
-
- #include "oofoptn.hpp"
-
-
- class dbConnect_ctree : public dbConnect {
- public:
- enum eLockingStates {noLocking, readLocking, writeLocking};
-
- dbConnect_ctree() :
- mHasBlobs(false),
- mUseSuperfile(true),
- mLockingState(noLocking),
- mReadLockApplications(0),
- mWriteLockApplications(0)
- {
- };
-
- virtual ~dbConnect_ctree();
-
- virtual void newConnection(const OOF_String& connectionName);
- virtual void openConnection(const OOF_String& connectionName);
-
- // special settings specific to this concrete connection
- void useSeparateFiles();
-
- bool isReadLocked() const;
- bool isWriteLocked() const;
-
- // interchange with OOF_tableBackend_ctree
- void blobsHaveBeenFound();
- COUNT allocBlobFilNo();
-
- // locking
- virtual void exitLocking();
- virtual void enterWriteLocking();
- virtual void enterReadLocking();
-
- // utility
- OOF_String makeTableName(const char*) const;
-
- private:
- void SetLockingStyle(eLockingStates);
- virtual OOF_tableBackend *MakeTableBackend(const OOF_Dictionary& tablesfields, const OOF_String& tableName);
- virtual void SetupConnection(const OOF_String& connectionName);
- void OpenMySpecialTables(const OOF_String& connectionName);
- void CreateMySpecialTables(const OOF_String& connectionName);
-
-
-
- // data storage
- bool mHasBlobs, mUseSuperfile;
- eLockingStates mLockingState;
- int mReadLockApplications, mWriteLockApplications;
- COUNT mSuperFilNo, mBlobFilNo;
-
- public:
- static COUNT sFileMode;
- };
- ostream& operator<<(ostream& os, dbConnect_ctree& connect);
-
-
- // include inline definitions
- #include "oofctree.inl"
-
- #endif