Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dbConnect_FServ Class Reference
[OOFILE Database backend for Faircom Server.]

#include <oofFsrv.h>

Inheritance diagram for dbConnect_FServ:

Inheritance graph
[legend]
Collaboration diagram for dbConnect_FServ:

Collaboration graph
[legend]
List of all members.

Detailed Description

Connection that manufactures OOF_fservBackend backends.

Works with either a single c-tree superfile or group of files in a directory.

Todo:
rename to dbConnect_fserv


Public Types

enum  eLockingStates { noLocking, readLocking, writeLocking }

Public Member Functions

 dbConnect_FServ (bool isTemporary=false)
virtual ~dbConnect_FServ ()
virtual void newConnection (const char *connectionName)
virtual void openConnection (const char *connectionName)
virtual bool openOrCreateConnection (const char *connectionName)
void buildConnectionSchemaFromFile (const char *connectionName)
virtual void newConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
virtual void openConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
virtual bool openOrCreateConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
virtual void newConnection (const FSSpec &)
virtual void openConnection (const FSSpec &)
virtual void close ()
virtual void deleteStorage ()
virtual bool usesSeparateStorageFiles () const
void useSeparateFiles ()
void useExclusiveAccess ()
bool isReadLocked () const
bool isWriteLocked () const
void resetLocks ()
bool isFileOnServer (const char *) const
void blobsHaveBeenFound ()
long allocBlobFilNo ()
void activateConnection ()
short uerr_cod () const
short sysiocod () const
short isam_err () const
virtual void exitLocking ()
virtual void enterWriteLocking ()
virtual void enterReadLocking ()
OOF_String makeTableName (const char *) const
virtual oofString name () const
void gotoDatabaseDir () const
oofDirectorydatabaseDirectory () const
const oofStringconnectionName () const
void attachTable (dbTable *)
dbTabletable (unsigned int) const
dbTabletable (const char *)
unsigned int numTables () const
bool isOpen () const
bool inDeclarativePhase () const
 Connection has been declared but not opened or created.

virtual void describe (std::ostream &) const
 Provide human-readable information about object.

virtual void writeOOFSchema ()
virtual void readOOFSchema (const oofString &schemaFileName)
 Reads & parses oofSchema from the file schemaFileName.

virtual void stats (std::ostream &)
void dumpData (std::ostream &)
void extract (std::ostream &os)
void copyAllFrom (dbConnect *)
void deleteAll ()
void generateTestData (unsigned long maxRecs=10000, bool generateRandom=true, unsigned long seedOrCount=0)
void schemaFileExt (const oofString &)
void suspendSorting () const
void resumeSorting () const
oofWordParsergetDefaultWordParser ()
void setDefaultWordParser (oofWordParser *inParser)
bool hidden () const
void hide (bool hideIt=true)

Static Public Member Functions

dbConnectcurrentlyConstructing ()
bool fileExists (const char *fName)
bool underConstruction ()
void raise (std::ostream &, bool terminateAfterMsg=true)
void raise (const char *, bool terminateAfterMsg=true)
void truncateTrailingSpaces (bool willTruncate=true)
bool willTruncateTrailingSpaces ()

Static Public Attributes

long sFileMode

Protected Types


Protected Member Functions

void BuildConnectionSchemas ()
void FinishNewConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
void FinishOpenConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
bool FinishOpenOrCreateConnection (const char *connectionName, dbUser *optionalLoginInfo=0)
void MakeAllTablesValid () const
 Final step in construction, can use tables against database after this.

void InitOpenOrCreateState ()
void OpenOrCreateStateTransition (bool inOpenedOrCreated)
 Manage state transitions for FinishOpenOrCreateConnection.

virtual void WriteOOFSchemaFile ()
 Write the oofschema out to the schema file.

virtual oofString MakeSchemaFileName ()
 produce a file name for schema file.

oofString MakeOOFSchemaString ()
 Produce a string containing the oofschema with the length of the schema string aphended to the end.


Protected Attributes

bool mHasBlobs
bool mUseSuperfile
eLockingStates mLockingState
int mReadLockApplications
int mWriteLockApplications
long mSuperFilNo
long mBlobFilNo
char mFServInstanceName [32]
void * mFServVars
unsigned int mNumFiles
unsigned int mNumIndexes
OOF_Dictionary mTables
oofString mConnectionName
oofString mSchemaFileName
bool mOpen
bool mTempDatabase
bool mInDeclarativePhase
oofWordParsermDefaultPrototypeParser
oofDirectorymDatabaseDir
bool mHidden

Static Protected Attributes

unsigned long sConnectionsOpened
dbConnect_FServsActiveConnection
dbConnectsCurrentlyConstructing
 this static gets zeroed in dbTable::postCloneTableCleanup() this is how we avoid passing dbTable pointers around all the time when creating fields particularly in user constructors when it would clutter things up a LOT!

bool sTruncateTrailingSpaces = false
oofString sSchemaFileExt = "osc"


Member Enumeration Documentation

enum dbConnect_FServ::eLockingStates
 

Enumeration values:
noLocking 
readLocking 
writeLocking 


Constructor & Destructor Documentation

dbConnect_FServ::dbConnect_FServ bool  isTemporary = false  ) 
 

virtual dbConnect_FServ::~dbConnect_FServ  )  [virtual]
 


Member Function Documentation

void dbConnect_FServ::activateConnection  ) 
 

long dbConnect_FServ::allocBlobFilNo  ) 
 

void dbConnect::attachTable dbTable  )  [inherited]
 

void dbConnect_FServ::blobsHaveBeenFound  ) 
 

void dbConnect_FServ::buildConnectionSchemaFromFile const char *  connectionName  ) 
 

void dbConnect_FServ::BuildConnectionSchemas  )  [protected]
 

virtual void dbConnect_FServ::close  )  [virtual]
 

Implements dbConnect.

const oofString & dbConnect::connectionName  )  const [inline, inherited]
 

void dbConnect::copyAllFrom dbConnect  )  [inherited]
 

dbConnect * dbConnect::currentlyConstructing  )  [inline, static, inherited]
 

oofDirectory * dbConnect::databaseDirectory  )  const [inline, inherited]
 

void dbConnect::deleteAll  )  [inherited]
 

virtual void dbConnect_FServ::deleteStorage  )  [virtual]
 

Reimplemented from dbConnect.

void dbConnect::describe std::ostream &  os  )  const [virtual, inherited]
 

Provide human-readable information about object.

Overriden to provide much more detail particularly for dbTable::describe() which provides full schema.

Reimplemented from OOF_PublicBase.

void dbConnect::dumpData std::ostream &   )  [inherited]
 

virtual void dbConnect_FServ::enterReadLocking  )  [virtual]
 

Implements dbConnect.

virtual void dbConnect_FServ::enterWriteLocking  )  [virtual]
 

Implements dbConnect.

virtual void dbConnect_FServ::exitLocking  )  [virtual]
 

Implements dbConnect.

void dbConnect::extract std::ostream &  os  )  [inline, inherited]
 

bool dbConnect::fileExists const char *  fName  )  [static, inherited]
 

void dbConnect_FServ::FinishNewConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[protected]
 

void dbConnect_FServ::FinishOpenConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[protected]
 

bool dbConnect_FServ::FinishOpenOrCreateConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[protected]
 

void dbConnect::generateTestData unsigned long  maxRecs = 10000,
bool  generateRandom = true,
unsigned long  seedOrCount = 0
[inherited]
 

oofWordParser * dbConnect::getDefaultWordParser  )  [inherited]
 

void dbConnect::gotoDatabaseDir  )  const [inherited]
 

bool OOF_PublicBase::hidden  )  const [inline, inherited]
 

void OOF_PublicBase::hide bool  hideIt = true  )  [inline, inherited]
 

bool dbConnect::inDeclarativePhase  )  const [inline, inherited]
 

Connection has been declared but not opened or created.

Only one connection at a time can be in this state.

Todo:
cope if declare 2nd connections before opening either, which is legal.

void dbConnect::InitOpenOrCreateState  )  [protected, inherited]
 

short dbConnect_FServ::isam_err  )  const
 

bool dbConnect_FServ::isFileOnServer const char *   )  const
 

bool dbConnect::isOpen  )  const [inline, inherited]
 

bool dbConnect_FServ::isReadLocked  )  const [inline]
 

bool dbConnect_FServ::isWriteLocked  )  const [inline]
 

void dbConnect::MakeAllTablesValid  )  const [protected, inherited]
 

Final step in construction, can use tables against database after this.

Note:
resets dbTable::sCurrentlyConstructing to detect fields declared outside tables

oofString dbConnect::MakeOOFSchemaString  )  [protected, inherited]
 

Produce a string containing the oofschema with the length of the schema string aphended to the end.

The length is used as an offset in dbConnect_rampBackend to find the schema beginning

oofString dbConnect::MakeSchemaFileName  )  [protected, virtual, inherited]
 

produce a file name for schema file.

If a file name exists for the data base use it with the extension sSchemaFileExt (default "osc") else use the connection name with sSchemaFileExt appended.

Todo:
rewrite

OOF_String dbConnect_FServ::makeTableName const char *   )  const
 

oofString dbConnect::name  )  const [virtual, inherited]
 

Reimplemented from OOF_PublicBase.

virtual void dbConnect_FServ::newConnection const FSSpec &   )  [virtual]
 

Implements dbConnect.

virtual void dbConnect_FServ::newConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[virtual]
 

virtual void dbConnect_FServ::newConnection const char *  connectionName  )  [virtual]
 

Implements dbConnect.

unsigned int dbConnect::numTables  )  const [inline, inherited]
 

virtual void dbConnect_FServ::openConnection const FSSpec &   )  [virtual]
 

Implements dbConnect.

virtual void dbConnect_FServ::openConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[virtual]
 

virtual void dbConnect_FServ::openConnection const char *  connectionName  )  [virtual]
 

Implements dbConnect.

virtual bool dbConnect_FServ::openOrCreateConnection const char *  connectionName,
dbUser optionalLoginInfo = 0
[virtual]
 

virtual bool dbConnect_FServ::openOrCreateConnection const char *  connectionName  )  [virtual]
 

void dbConnect::OpenOrCreateStateTransition bool  inOpenedVSCreated  )  [protected, inherited]
 

Manage state transitions for FinishOpenOrCreateConnection.

Parameters:
inOpenedVSCreated is true if just created file, false if opened

void dbConnect::raise const char *  ,
bool  terminateAfterMsg = true
[static, inherited]
 

void dbConnect::raise std::ostream &  ,
bool  terminateAfterMsg = true
[static, inherited]
 

void dbConnect::readOOFSchema const oofString schemaFileName  )  [virtual, inherited]
 

Reads & parses oofSchema from the file schemaFileName.

Populates the dbConnect::sCurrentlyConstructing connection with extra tables.

Todo:
make a version that takes oofFileRef

void dbConnect_FServ::resetLocks  ) 
 

void dbConnect::resumeSorting  )  const [inherited]
 

void dbConnect::schemaFileExt const oofString  )  [inherited]
 

void dbConnect::setDefaultWordParser oofWordParser inParser  )  [inherited]
 

void dbConnect::stats std::ostream &   )  [virtual, inherited]
 

void dbConnect::suspendSorting  )  const [inherited]
 

short dbConnect_FServ::sysiocod  )  const
 

dbTable * dbConnect::table const char *   )  [inherited]
 

dbTable * dbConnect::table unsigned  int  )  const [inherited]
 

void dbConnect::truncateTrailingSpaces bool  willTruncate = true  )  [inline, static, inherited]
 

short dbConnect_FServ::uerr_cod  )  const
 

bool dbConnect::underConstruction  )  [inline, static, inherited]
 

void dbConnect_FServ::useExclusiveAccess  ) 
 

void dbConnect_FServ::useSeparateFiles  ) 
 

virtual bool dbConnect_FServ::usesSeparateStorageFiles  )  const [virtual]
 

Reimplemented from dbConnect.

bool dbConnect::willTruncateTrailingSpaces  )  [inline, static, inherited]
 

void dbConnect::writeOOFSchema  )  [virtual, inherited]
 

Reimplemented in dbConnect_ctree, dbConnect_ram, and dbConnect_ramp.

void dbConnect::WriteOOFSchemaFile  )  [protected, virtual, inherited]
 

Write the oofschema out to the schema file.

Note:
temporarily changes current directory whilst writing file.


Member Data Documentation

long dbConnect_FServ::mBlobFilNo [protected]
 

oofString dbConnect::mConnectionName [protected, inherited]
 

oofDirectory* dbConnect::mDatabaseDir [protected, inherited]
 

oofWordParser* dbConnect::mDefaultPrototypeParser [protected, inherited]
 

char dbConnect_FServ::mFServInstanceName[32] [protected]
 

void* dbConnect_FServ::mFServVars [protected]
 

bool dbConnect_FServ::mHasBlobs [protected]
 

bool OOF_PublicBase::mHidden [protected, inherited]
 

bool dbConnect::mInDeclarativePhase [protected, inherited]
 

eLockingStates dbConnect_FServ::mLockingState [protected]
 

unsigned int dbConnect_FServ::mNumFiles [protected]
 

unsigned int dbConnect_FServ::mNumIndexes [protected]
 

bool dbConnect::mOpen [protected, inherited]
 

int dbConnect_FServ::mReadLockApplications [protected]
 

oofString dbConnect::mSchemaFileName [protected, inherited]
 

long dbConnect_FServ::mSuperFilNo [protected]
 

OOF_Dictionary dbConnect::mTables [protected, inherited]
 

bool dbConnect::mTempDatabase [protected, inherited]
 

bool dbConnect_FServ::mUseSuperfile [protected]
 

int dbConnect_FServ::mWriteLockApplications [protected]
 

dbConnect_FServ* dbConnect_FServ::sActiveConnection [static, protected]
 

unsigned long dbConnect_FServ::sConnectionsOpened [static, protected]
 

dbConnect * dbConnect::sCurrentlyConstructing [static, protected, inherited]
 

this static gets zeroed in dbTable::postCloneTableCleanup() this is how we avoid passing dbTable pointers around all the time when creating fields particularly in user constructors when it would clutter things up a LOT!

Warning:
this is NOT thread-safe - do not construct tables in simultaneous threads

long dbConnect_FServ::sFileMode [static]
 

oofString dbConnect::sSchemaFileExt = "osc" [static, protected, inherited]
 

bool dbConnect::sTruncateTrailingSpaces = false [static, protected, inherited]
 


The documentation for this class was generated from the following file:
Generated on Thu Jan 1 21:31:50 2004 for OOFILE by doxygen 1.3.5