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

OOF_ctreeBackend Class Reference
[OOFILE Database backend for Faircom's ctree-Plus ISAM engine.OOFILE Implementation Classes]

#include <oofctrex.h>

Inheritance diagram for OOF_ctreeBackend:

Inheritance graph
[legend]
Collaboration diagram for OOF_ctreeBackend:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implement the backend for Faircom's c-tree Plus ISAM engine including locking and indexed searches.

Using the ISAM mode of c-tree Plus means that the maintenance of keys is automatic - as fields are updated, c-tree will update keys affected (a given field update may affect multiple keys due to compound fields, or keys defined with different constraints). The schema generation in OOF_ctreeBackend generates schema resources (DODA) in the c-tree files matching the Faircom standard so external tools and ODBC drivers can access OOFILE files.

Todo:
OOFILE mapping of date and time fields is currently to a numeric c-tree field, not Faircom dates.
Note:
relationship information is additional OOFILE meta-info so is not stored in the DODA.

private ctors mean // can only be manufactured by a dbConnect subclass, eg our friend dbConnect_ctree.


public search functions

virtual bool gotoRecord (unsigned long)
virtual bool search (const dbQueryClause *qClause)
virtual unsigned long recordNumberMatching (const dbQueryClause *qClause, bool *outFoundIt=0) const
virtual bool checkDuplicate (const dbQueryClause *)
virtual bool searchSelection (const dbQueryClause *)
virtual bool searchEqual (const dbField *, const char *, bool matchEntireKey=true)
virtual bool searchEqual (const dbField *, const VOID *)
virtual void invert ()

recordwise access

virtual void start ()
virtual void next ()
virtual unsigned long countAll () const

data access

virtual void newRecord ()
 Sets up a new record ready to enter data On exit the state is: Selection state is aboutToDirty Selection Set record state to New Set dirty to false Clear buffer Append new record to selection.

virtual void deleteRecord ()
virtual void unloadRecord ()
virtual void saveRecord ()
 Save current main record and any cached dirty records.


reflective operators

virtual unsigned long sequenceNumber () const

locking

virtual void lockRecord ()
virtual void unlockRecord ()

transactions

virtual void beginTransaction (COUNT tMode=0)
virtual void abortTransaction (COUNT rMode=0)
virtual void commitTransaction (COUNT rMode=0)

OID generation

virtual oidT currentOID ()
virtual oidT oidOfRecord (unsigned long)

selection manipulation

virtual unsigned long recordNumber () const
virtual unsigned long recordNumberOfOID (oidT inOID)
 Implement dbTable::recordNumberOfOID.

virtual void selectAll ()
virtual void selectNone ()
virtual void difference_with (const OOF_tableBackend *)
virtual void difference_with (const dbSelection &)
virtual void intersection_with (const OOF_tableBackend *)
virtual void intersection_with (const dbSelection &)
virtual void union_with (const OOF_tableBackend *)
virtual void union_with (const dbSelection &)
virtual void union_with_no_overlap (const OOF_tableBackend *)
virtual void union_with_no_overlap (const dbSelection &)

public search functions

virtual bool searchEqual (const dbField *, const void *)
virtual bool searchSelContainsAnyDelimited (const dbField *schField, const char *schStr, char delim)
virtual bool searchSelContainsAnyOf (const dbField *schField, const char **schStrs, unsigned long count)
virtual bool searchSelContainsAllDelimited (const dbField *schField, const char *schStr, char delim)
virtual bool searchSelContainsAllOf (const dbField *schField, const char **schStrs, unsigned long count)
virtual bool loadRelatedContextJoiningFromTo (const dbField *, const dbField *)
 Implements relationships via searching.


field-level data access

virtual bool readBool (const dbField *) const
 Assumes bools stored as unsigned short, 0==false.

virtual short readShort (const dbField *) const
virtual long readLong (const dbField *) const
virtual double readDouble (const dbField *) const
virtual const char * readChars (const dbField *) const
virtual oofString readString (const dbField *) const
 Copy field data into a string.

virtual void writeBool (bool, const dbField *)
 Encode bool as short to be decoded by readBool.

virtual void writeShort (short, const dbField *)
virtual void writeLong (long, const dbField *)
virtual void writeDouble (double, const dbField *)
virtual void writeChars (const char *, long numChars, long maxLen, const dbField *, long startIndex=0)
virtual void writeBytes (const char *inBuf, long inLen, const dbField *inField)
virtual char * getByteWriteAddress (unsigned long, const dbField *)

recordwise access

virtual bool atFirst () const
virtual bool atLast () const
virtual bool atRelative (unsigned long) const
virtual void prev ()
virtual bool more () const
virtual unsigned long count () const
void gotoBOF ()

record-level data access

virtual void unloadCache ()
virtual void revertRecord ()
virtual void pack ()

sorting public interface

virtual void setSortOrder (dbSorter *adoptSorter)
virtual dbSortersorter () const
virtual void sortSelectionNow (fieldNumT)
virtual void sortSelectionNow (const dbSorter *)
virtual void sortSelectionInverseNow (fieldNumT)

reflective operators

virtual unsigned long fieldDataLen (const dbField *) const
virtual bool fieldIsDirty (fieldNumT) const
virtual bool isNewRecord () const
virtual unsigned int numIndexes () const
virtual unsigned int numFiles () const
virtual unsigned long blobPointerReferenceSize () const
virtual bool allSelected () const
virtual bool contains (oidT) const

getting & saving selections as lightweight objects

virtual dbSelection currentSelection () const
virtual dbSelection makeEmptySelection () const
virtual void setSelection (const dbSelection &)
virtual void setSelection (const OOF_Selection *)

selection of specific contexts

virtual bool selectJustOID (oidT)
virtual void selectJustCurrent ()

transactions

virtual void beginTransaction (short tMode)
virtual void abortTransaction (short rMode)
virtual void commitTransaction (short rMode)

record-level data access

bool isDirty () const
void markDirty ()

reflective operators

void fieldHasDefaultCalculator (dbField *)
void fieldHasStoredCalculator (dbField *)
dbTabletable () const
dbFieldfield (fieldNumT) const

Ken's wildcard header bits

enum  OOF_wctype {
  prefix, single, multiple, singlefinal,
  multiplefinal
}

Non-Indexed searches

bool SearchEqualNonIndexed (const dbField *, const char *, bool matchEntireKey=true)
bool SearchEqualNonIndexed (const dbField *, const void *)
bool SearchWordNonIndexed (const dbField *, const char *, bool startsWith=false)
bool SearchNotEqualNonIndexed (const dbField *, const char *, bool matchEntireKey=true)
bool SearchNotEqualNonIndexed (const dbField *, const void *)
bool SearchBetweenNonIndexed (const dbField *, const char *, const char *)
bool SearchBetweenNonIndexed (const dbField *, const void *, const void *)
bool SearchOutsideNonIndexed (const dbField *, const char *, const char *)
bool SearchOutsideNonIndexed (const dbField *, const void *, const void *)
bool SearchComparativeNonIndexed (const dbField *, const char *, dbQueryClause::BinaryQueryOps)
bool SearchComparativeNonIndexed (const dbField *, const void *, dbQueryClause::BinaryQueryOps)
bool SearchSelectionTrinaryFieldToLiterals (const dbQueryTrinary *)

Non-Indexed wildcard Searches

bool SearchEqualNonIndexedWildcard (const dbField *schField, const char *schStr, bool matchEntireKey=true)
bool SearchNotEqualNonIndexedWildcard (const dbField *schField, const char *schStr, bool matchEntireKey=true)

Sort implementations

void SortSelectionNow (const dbUlong *theFld)
void SortSelectionNow (const dbLong *theFld)
void SortSelectionNow (const dbUshort *theFld)
void SortSelectionNow (const dbShort *theFld)
void SortSelectionNow (const dbReal *theFld)
void SortSelectionNow (const dbChar *theFld)
void SortSelectionNow (const dbText *theFld)
void SortSelectionNow (const dbField *theFld, unsigned long fixedBinaryLength)
void SortSelectionInverseNow (const dbUlong *theFld)
void SortSelectionInverseNow (const dbLong *theFld)
void SortSelectionInverseNow (const dbUshort *theFld)
void SortSelectionInverseNow (const dbShort *theFld)
void SortSelectionInverseNow (const dbReal *theFld)
void SortSelectionInverseNow (const dbChar *theFld)
void SortSelectionInverseNow (const dbText *theFld)
void SortSelectionInverseNow (const dbField *theFld, unsigned long fixedBinaryLength)
void SubSort (const dbSorter *theSorter, const unsigned long level, unsigned long *theData, const unsigned long count)
 Now we're sorting at the recursive level of partitioning in a nested sort !


Public Types

enum  { kDataExtendSize = 0, kIndexExtendSize = 0 }
enum  { kCtreeKeySeqenceAddonLength = 4 }
enum  ERecordState { eNew, eLoaded, eUnloaded }

Public Member Functions

virtual ~OOF_ctreeBackend ()
virtual OOF_tableBackendclone (dbTable::selSharingT, dbTable *) const
virtual void buildSchema (bool rebuilding=false)
virtual void addIndices (const char *newIDXname)
virtual void suppressIndices ()
virtual void rebuild ()
virtual void open ()
virtual void close ()
virtual void deleteStorage ()
virtual void createTableInConnection (const dbConnect *)
virtual bool openTableInConnection (const dbConnect *, const bool createIfMissing=false)
virtual void setFileExtensions (const char *dataExt, const char *indexExt)
virtual void loadBlob (const dbBLOB *)
virtual void describeState (std::ostream &) const
virtual void ignoreDuplicateRecords ()
virtual void noticeDuplicateRecords ()
virtual bool reloadRecord ()
virtual bool isRecordLoaded () const
virtual void setBlobLength (fieldNumT, unsigned long len)
virtual bool addOIDtoSelection (oidT)
virtual void dropRecordFromSelection (unsigned long)
void describeInvariant (std::ostream &) const
 debugging

void copyFrom (const OOF_recordBufferedContext *)
virtual void copyFrom (const OOF_recordBufferedContext &)
unsigned long currentOffset () const
 operator unsigned long () const
bool operator== (unsigned long) const
bool operator== (const OOF_recordBufferedContext &) const
bool isNew () const
char * buffer () const

Static Public Member Functions

OOF_fieldTypes MapCtreeDODATypeToFieldType (const COUNT t)

Static Public Attributes

long sFileMode = SHARED | PERMANENT
long sTransMode = TRNLOG|ENABLE
long sTransReleaseMode = ctKEEP_OUT

Protected Types


Protected Member Functions

virtual void BuildBackendtables (bool rebuilding)
 backend construction

virtual bool CanUseIndex (const dbField *theFld, dbQueryClause::BinaryQueryOps=dbQueryClause::equals) const
void * GetFieldWriteDest (const dbField *)
void * GetFieldReadFrom (fieldNumT) const
bool Invariant (const char *optionalComment=0) const
 Check combination of member variables defining Invariant state.

oofString InvariantDescription () const
unsigned long state () const
unsigned long PadFieldWidthForAlignment (const dbField *fld) const
unsigned int FieldAlignsTo (const dbField *) const
virtual void CachingContextChange ()
virtual void ContextChange ()
bool IgnoringDuplicateRecords () const
unsigned long BlobLenFromBuffer (const dbField *, const char *theirBuffer) const
unsigned long BlobLenFromBuffer (fieldNumT, const char *theirBuffer) const
unsigned long BlobPosFromBuffer (const dbField *fld, const char *theirBuffer) const
unsigned long BlobPosFromBuffer (fieldNumT, const char *theirBuffer) const
void SetBlobLenInBuffer (fieldNumT, unsigned long len, const char *theirBuffer) const
void SetBlobPosInBuffer (fieldNumT, unsigned long pos, const char *theirBuffer) const
bool MaybeLoadRecordFromCache (unsigned long offset)
bool CommonSimpleDelete ()
void AdoptBuffer (OOF_recordBufferedContext *)
void DonateBlobBodiesTo (OOF_recordBufferedContext *)
void CacheDirtyCurrentRecord ()
void ResetBlobs ()
bool tableCachesDirtyRecords () const
void AllocBuffer ()

Protected Attributes

COUNT mBlobFilNo
COUNT mISAMdatno
dbConnect_ctreemConnection
OOF_recordSelection mSelection
OOF_recordFieldEntrymFieldBufMap
unsigned int * mFieldBufMapRefCount
unsigned short mNumFiles
unsigned short mNumIndexes
unsigned short mOverheadLeadingBytes
OOF_ExpandableLongArraymBlobFieldNums
OOF_recordCachemDirtyRecordCache
bool mIgnoreDuplicateRecords
OOF_Dictionary mFields
dbTablemTable
bool mDirty
bool mHasDefaultCalculators
bool mHasStoredCalculators
ERecordState mRecordState
unsigned long mCurrLoadedRecOffset
unsigned long mRecBufLen
char * mBuffer
OOF_ExpandableLongArraymBlobFieldBodies
OOF_dirtyFieldMap mDirtyMap

Friends

void dbConnect_ctree::SetupConnection (const OOF_String &)
OOF_tableBackenddbConnect_ctree::MakeTableBackend (dbTable *)
void dbTable::ContextChange ()
class OOF_recordCacheCopier
class OOF_simpleRecordBackend
class dbTable


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
kDataExtendSize 
kIndexExtendSize 

anonymous enum
 

Enumeration values:
kCtreeKeySeqenceAddonLength 

enum OOF_recordBufferedContext::ERecordState [inherited]
 

Enumeration values:
eNew 
eLoaded 
eUnloaded 

enum OOF_simpleRecordBackend::OOF_wctype [protected, inherited]
 

Enumeration values:
prefix 
single 
multiple 
singlefinal 
multiplefinal 


Constructor & Destructor Documentation

OOF_ctreeBackend::~OOF_ctreeBackend  )  [virtual]
 


Member Function Documentation

void OOF_simpleRecordBackend::abortTransaction short  rMode  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::abortTransaction COUNT  rMode = 0  )  [virtual]
 

void OOF_ctreeBackend::addIndices const char *  newIDXname  )  [virtual]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::addOIDtoSelection oidT   )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::AdoptBuffer OOF_recordBufferedContext  )  [protected, inherited]
 

void OOF_recordBufferedContext::AllocBuffer  )  [protected, inherited]
 

bool OOF_simpleRecordBackend::allSelected  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::atFirst  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::atLast  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::atRelative unsigned  long  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::beginTransaction short  tMode  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::beginTransaction COUNT  tMode = 0  )  [virtual]
 

unsigned long OOF_simpleRecordBackend::BlobLenFromBuffer fieldNumT  ,
const char *  theirBuffer
const [protected, inherited]
 

unsigned long OOF_simpleRecordBackend::BlobLenFromBuffer const dbField ,
const char *  theirBuffer
const [inline, protected, inherited]
 

unsigned long OOF_simpleRecordBackend::blobPointerReferenceSize  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

unsigned long OOF_simpleRecordBackend::BlobPosFromBuffer fieldNumT  ,
const char *  theirBuffer
const [protected, inherited]
 

unsigned long OOF_simpleRecordBackend::BlobPosFromBuffer const dbField fld,
const char *  theirBuffer
const [inline, protected, inherited]
 

char * OOF_recordBufferedContext::buffer  )  const [inline, inherited]
 

void OOF_ctreeBackend::BuildBackendtables bool  rebuilding  )  [protected, virtual]
 

backend construction

Implements OOF_simpleRecordBackend.

void OOF_ctreeBackend::buildSchema bool  rebuilding = false  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

void OOF_simpleRecordBackend::CacheDirtyCurrentRecord  )  [protected, inherited]
 

void OOF_simpleRecordBackend::CachingContextChange  )  [protected, virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_ctreeBackend::CanUseIndex const dbField theFld,
dbQueryClause::BinaryQueryOps  = dbQueryClause::equals
const [protected, virtual]
 

Reimplemented from OOF_simpleRecordBackend.

bool OOF_ctreeBackend::checkDuplicate const dbQueryClause  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

OOF_tableBackend * OOF_ctreeBackend::clone dbTable::selSharingT  ,
dbTable
const [virtual]
 

Implements OOF_simpleRecordBackend.

void OOF_ctreeBackend::close  )  [virtual]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::commitTransaction short  rMode  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::commitTransaction COUNT  rMode = 0  )  [virtual]
 

bool OOF_simpleRecordBackend::CommonSimpleDelete  )  [protected, inherited]
 

bool OOF_simpleRecordBackend::contains oidT   )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::ContextChange  )  [protected, virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_recordBufferedContext::copyFrom const OOF_recordBufferedContext  )  [virtual, inherited]
 

void OOF_recordBufferedContext::copyFrom const OOF_recordBufferedContext  )  [inline, inherited]
 

unsigned long OOF_simpleRecordBackend::count  )  const [virtual, inherited]
 

See also:
countAll

Implements OOF_tableBackend.

unsigned long OOF_ctreeBackend::countAll  )  const [virtual]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::createTableInConnection const dbConnect  )  [virtual]
 

Implements OOF_tableBackend.

unsigned long OOF_recordBufferedContext::currentOffset  )  const [inline, inherited]
 

oidT OOF_simpleRecordBackend::currentOID  )  [virtual, inherited]
 

Implements OOF_tableBackend.

dbSelection OOF_simpleRecordBackend::currentSelection  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::deleteRecord  )  [virtual]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::deleteStorage  )  [virtual]
 

Reimplemented from OOF_tableBackend.

void OOF_simpleRecordBackend::describeInvariant std::ostream &   )  const [virtual, inherited]
 

debugging

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::describeState std::ostream &   )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::difference_with const dbSelection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::difference_with const OOF_tableBackend  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::DonateBlobBodiesTo OOF_recordBufferedContext  )  [protected, inherited]
 

void OOF_simpleRecordBackend::dropRecordFromSelection unsigned  long  )  [virtual, inherited]
 

Implements OOF_tableBackend.

dbField * OOF_tableBackend::field fieldNumT   )  const [inline, inherited]
 

unsigned int OOF_simpleRecordBackend::FieldAlignsTo const dbField  )  const [protected, inherited]
 

unsigned long OOF_simpleRecordBackend::fieldDataLen const dbField  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_tableBackend::fieldHasDefaultCalculator dbField  )  [inline, inherited]
 

void OOF_tableBackend::fieldHasStoredCalculator dbField  )  [inline, inherited]
 

bool OOF_simpleRecordBackend::fieldIsDirty fieldNumT   )  const [virtual, inherited]
 

Implements OOF_tableBackend.

char * OOF_simpleRecordBackend::getByteWriteAddress unsigned  long,
const dbField
[virtual, inherited]
 

Implements OOF_tableBackend.

void * OOF_simpleRecordBackend::GetFieldReadFrom fieldNumT   )  const [protected, inherited]
 

void * OOF_simpleRecordBackend::GetFieldWriteDest const dbField  )  [protected, inherited]
 

void OOF_simpleRecordBackend::gotoBOF  )  [inline, inherited]
 

bool OOF_ctreeBackend::gotoRecord unsigned  long  )  [virtual]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::ignoreDuplicateRecords  )  [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::IgnoringDuplicateRecords  )  const [inline, protected, inherited]
 

void OOF_simpleRecordBackend::intersection_with const dbSelection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::intersection_with const OOF_tableBackend  )  [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::Invariant const char *  optionalComment = 0  )  const [protected, inherited]
 

Check combination of member variables defining Invariant state.

Used to guard against changes to code allowing backend to enter illegal states.

Note:
If you define a filename OOF_INVARIANT_DUMP_NAME this will dump a very comprehensive log of all OOFILE execution, as Invariant is called on entry and exit from most backend methods that affect the database.
Todo:
change code checking for some states to work on Intel byte order

oofString OOF_simpleRecordBackend::InvariantDescription  )  const [protected, inherited]
 

void OOF_ctreeBackend::invert  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

bool OOF_tableBackend::isDirty  )  const [inline, inherited]
 

bool OOF_recordBufferedContext::isNew  )  const [inline, inherited]
 

bool OOF_simpleRecordBackend::isNewRecord  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::isRecordLoaded  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::loadBlob const dbBLOB  )  [virtual]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::loadRelatedContextJoiningFromTo const dbField fldFrom,
const dbField fldTo
[virtual, inherited]
 

Implements relationships via searching.

Changes the current selection

Parameters:
fldFrom supplies the value to be searched for.
fldTo is a field probably on the current table, which is the target of the search
Returns:
true if finds any records Always changes the current selection, like search().

Implements OOF_tableBackend.

void OOF_ctreeBackend::lockRecord  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

dbSelection OOF_simpleRecordBackend::makeEmptySelection  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

OOF_fieldTypes OOF_ctreeBackend::MapCtreeDODATypeToFieldType const COUNT  t  )  [static]
 

void OOF_tableBackend::markDirty  )  [inline, inherited]
 

bool OOF_simpleRecordBackend::MaybeLoadRecordFromCache unsigned long  offset  )  [protected, inherited]
 

bool OOF_simpleRecordBackend::more  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::newRecord  )  [virtual]
 

Sets up a new record ready to enter data On exit the state is: Selection state is aboutToDirty Selection Set record state to New Set dirty to false Clear buffer Append new record to selection.

Set current loaded record offset to point to new appended record.

Reimplemented from OOF_simpleRecordBackend.

void OOF_ctreeBackend::next  )  [virtual]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::noticeDuplicateRecords  )  [virtual, inherited]
 

Implements OOF_tableBackend.

unsigned int OOF_simpleRecordBackend::numFiles  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

unsigned int OOF_simpleRecordBackend::numIndexes  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

oidT OOF_simpleRecordBackend::oidOfRecord unsigned  long  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::open  )  [virtual]
 

bool OOF_ctreeBackend::openTableInConnection const dbConnect theDB_,
const bool  createIfMissing = false
[virtual]
 

Returns:
true if open, false if create
Exceptions:
oofE_CtreeISAMError if !createIfMissing and fail to open

Implements OOF_tableBackend.

OOF_recordBufferedContext::operator unsigned long  )  const [inline, inherited]
 

bool OOF_recordBufferedContext::operator== const OOF_recordBufferedContext  )  const [inherited]
 

bool OOF_recordBufferedContext::operator== unsigned  long  )  const [inline, inherited]
 

void OOF_simpleRecordBackend::pack  )  [virtual, inherited]
 

Implements OOF_tableBackend.

Reimplemented in OOF_dbaseBackend.

unsigned long OOF_simpleRecordBackend::PadFieldWidthForAlignment const dbField fld  )  const [protected, inherited]
 

void OOF_simpleRecordBackend::prev  )  [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::readBool const dbField inField  )  const [virtual, inherited]
 

Assumes bools stored as unsigned short, 0==false.

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

const char * OOF_simpleRecordBackend::readChars const dbField inField  )  const [virtual, inherited]
 

Returns:
pointer to area expected to remain allocated, maybe null.

Implements OOF_tableBackend.

double OOF_simpleRecordBackend::readDouble const dbField inField  )  const [virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

long OOF_simpleRecordBackend::readLong const dbField inField  )  const [virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

short OOF_simpleRecordBackend::readShort const dbField inField  )  const [virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

oofString OOF_simpleRecordBackend::readString const dbField  )  const [virtual, inherited]
 

Copy field data into a string.

Implements OOF_tableBackend.

void OOF_ctreeBackend::rebuild  )  [virtual]
 

Implements OOF_tableBackend.

unsigned long OOF_simpleRecordBackend::recordNumber  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

unsigned long OOF_ctreeBackend::recordNumberMatching const dbQueryClause qClause,
bool *  outFoundIt = 0
const [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

unsigned long OOF_simpleRecordBackend::recordNumberOfOID oidT  inOID  )  [virtual, inherited]
 

Implement dbTable::recordNumberOfOID.

Returns:
zero-based record number or ULONG_MAX if not found
Todo:
abstract the allRecs case so can implement efficiently in c-tree.

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::reloadRecord  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::ResetBlobs  )  [protected, inherited]
 

void OOF_simpleRecordBackend::revertRecord  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::saveRecord  )  [virtual]
 

Save current main record and any cached dirty records.

Broadcasts to related records and other listeners so may re-dirty records in the process. Loops creating OOF_recordCacheCopier dependant on our dbTable which will repeatedly pull items out of the cache and get the table to save them. This yo-yoing is necessary to get the table to broadcast changes, in case the cached records have dependancies such as relationships hanging off them.

Reimplemented from OOF_simpleRecordBackend.

bool OOF_ctreeBackend::search const dbQueryClause qClause  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

bool OOF_simpleRecordBackend::SearchBetweenNonIndexed const dbField ,
const void *  ,
const void * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchBetweenNonIndexed const dbField ,
const char *  ,
const char * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchComparativeNonIndexed const dbField ,
const void *  ,
dbQueryClause::BinaryQueryOps 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchComparativeNonIndexed const dbField ,
const char *  ,
dbQueryClause::BinaryQueryOps 
[protected, inherited]
 

bool OOF_simpleRecordBackend::searchEqual const dbField ,
const void * 
[virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_ctreeBackend::searchEqual const dbField ,
const VOID * 
[virtual]
 

bool OOF_ctreeBackend::searchEqual const dbField ,
const char *  ,
bool  matchEntireKey = true
[virtual]
 

Reimplemented from OOF_simpleRecordBackend.

bool OOF_simpleRecordBackend::SearchEqualNonIndexed const dbField ,
const void * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchEqualNonIndexed const dbField ,
const char *  ,
bool  matchEntireKey = true
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchEqualNonIndexedWildcard const dbField schField,
const char *  schStr,
bool  matchEntireKey = true
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchNotEqualNonIndexed const dbField ,
const void * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchNotEqualNonIndexed const dbField ,
const char *  ,
bool  matchEntireKey = true
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchNotEqualNonIndexedWildcard const dbField schField,
const char *  schStr,
bool  matchEntireKey = true
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchOutsideNonIndexed const dbField ,
const void *  ,
const void * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::SearchOutsideNonIndexed const dbField ,
const char *  ,
const char * 
[protected, inherited]
 

bool OOF_simpleRecordBackend::searchSelContainsAllDelimited const dbField schField,
const char *  schStr,
char  delim
[virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::searchSelContainsAllOf const dbField schField,
const char **  schStrs,
unsigned long  count
[virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::searchSelContainsAnyDelimited const dbField schField,
const char *  schStr,
char  delim
[virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::searchSelContainsAnyOf const dbField schField,
const char **  schStrs,
unsigned long  count
[virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_ctreeBackend::searchSelection const dbQueryClause  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

bool OOF_simpleRecordBackend::SearchSelectionTrinaryFieldToLiterals const dbQueryTrinary  )  [protected, inherited]
 

bool OOF_simpleRecordBackend::SearchWordNonIndexed const dbField ,
const char *  ,
bool  startsWith = false
[protected, inherited]
 

void OOF_simpleRecordBackend::selectAll  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::selectJustCurrent  )  [virtual, inherited]
 

Implements OOF_tableBackend.

bool OOF_simpleRecordBackend::selectJustOID oidT  inOID  )  [virtual, inherited]
 

Parameters:
inOID record address, zero is accepted but causes selectNone() dbTable::selectJustOID will react similarly to zero oidT.
Todo:
validate that inOID is valid existing record

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::selectNone  )  [virtual, inherited]
 

Implements OOF_tableBackend.

unsigned long OOF_ctreeBackend::sequenceNumber  )  const [virtual]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::setBlobLength fieldNumT  ,
unsigned long  len
[virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::SetBlobLenInBuffer fieldNumT  ,
unsigned long  len,
const char *  theirBuffer
const [protected, inherited]
 

void OOF_simpleRecordBackend::SetBlobPosInBuffer fieldNumT  ,
unsigned long  pos,
const char *  theirBuffer
const [protected, inherited]
 

void OOF_ctreeBackend::setFileExtensions const char *  dataExt,
const char *  indexExt
[virtual]
 

Reimplemented from OOF_simpleRecordBackend.

void OOF_simpleRecordBackend::setSelection const OOF_Selection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::setSelection const dbSelection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::setSortOrder dbSorter adoptSorter  )  [virtual, inherited]
 

Implements OOF_tableBackend.

dbSorter * OOF_simpleRecordBackend::sorter  )  const [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbField theFld,
unsigned long  fixedBinaryLength
[protected, inherited]
 

Bug:
Needs implementing by copying bytes or generating a comparison object. like SortSelectionNow(const dbField* theFld, unsigned long fixedBinaryLength)

Todo:
reimplement fixedBinary SortSelectionInverseNow without binaryContents()

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbText theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbChar theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbReal theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbShort theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbUshort theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbLong theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionInverseNow const dbUlong theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::sortSelectionInverseNow fieldNumT   )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::SortSelectionNow const dbField theFld,
unsigned long  fixedBinaryLength
[protected, inherited]
 

Bug:
Needs implementing by copying bytes or generating a comparison object. Alternatives considered: 1) backend is Abstract Factory for byte copier and field comparer 2) need a readBytes interface for dbFixedBinary, and rewrite this sort for dbFixedBinary alone

Todo:
reimplement fixedBinary SortSelectionNow without binaryContents()

void OOF_simpleRecordBackend::SortSelectionNow const dbText theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbChar theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbReal theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbShort theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbUshort theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbLong theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::SortSelectionNow const dbUlong theFld  )  [protected, inherited]
 

void OOF_simpleRecordBackend::sortSelectionNow const dbSorter theSorter  )  [virtual, inherited]
 

Ken's comments on how the sort works
start by sorting and partitioning the base field
This could use som heuristics if the field in indexed, since ctree does some of this good stuff for us - for now, we just use a non-indexed case..

At least we could get ctree to put the fields in the correct order for us ! But later - let's get it working for now !

Warning:
Don't shortcut the process by using direct copyBlah accessors on these fields. Although it seems less efficient to be using the (dbUlong*)theField instead of readLong(theField) there is one important difference in that the field-level method also allows for calculated or non-persistent fields.

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::sortSelectionNow fieldNumT   )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::start  )  [virtual]
 

Implements OOF_tableBackend.

unsigned long OOF_simpleRecordBackend::state  )  const [protected, inherited]
 

void OOF_simpleRecordBackend::SubSort const dbSorter theSorter,
const unsigned long  level,
unsigned long *  theData,
const unsigned long  count
[protected, inherited]
 

Now we're sorting at the recursive level of partitioning in a nested sort !

We have a pseudo-selection in the form of a fixed array of unsigned longs (which are record pointers) and we will simply rearrange them within the storage passed to us

NOTE: The array passed to us with have the records in current record order ie: We will only be jumping forward

I hope this doesn't screw up Andy's Selection Stuff ! : )

Author:
Ken Taylor

void OOF_ctreeBackend::suppressIndices  )  [virtual]
 

Implements OOF_tableBackend.

dbTable * OOF_tableBackend::table  )  const [inline, inherited]
 

bool OOF_tableBackend::tableCachesDirtyRecords  )  const [inline, protected, inherited]
 

void OOF_simpleRecordBackend::union_with const dbSelection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::union_with const OOF_tableBackend  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::union_with_no_overlap const dbSelection  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::union_with_no_overlap const OOF_tableBackend  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::unloadCache  )  [virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_ctreeBackend::unloadRecord  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

void OOF_ctreeBackend::unlockRecord  )  [virtual]
 

Reimplemented from OOF_simpleRecordBackend.

void OOF_simpleRecordBackend::writeBool bool  inNum,
const dbField inField
[virtual, inherited]
 

Encode bool as short to be decoded by readBool.

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::writeBytes const char *  inBuf,
long  inLen,
const dbField inField
[virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::writeChars const char *  ,
long  numChars,
long  maxLen,
const dbField ,
long  startIndex = 0
[virtual, inherited]
 

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::writeDouble double  inNum,
const dbField inField
[virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::writeLong long  inNum,
const dbField inField
[virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.

void OOF_simpleRecordBackend::writeShort short  inNum,
const dbField inField
[virtual, inherited]
 

Warning:
relies on backend returning fields aligned to processor-legal boundaries
Todo:
add assertion testing return address is legally aligned

Implements OOF_tableBackend.


Friends And Related Function Documentation

OOF_tableBackend* dbConnect_ctree::MakeTableBackend dbTable  )  [friend]
 

void dbConnect_ctree::SetupConnection const OOF_String  )  [friend]
 

friend class dbTable [friend, inherited]
 

void dbTable::ContextChange  )  [friend]
 

friend class OOF_recordCacheCopier [friend, inherited]
 

friend class OOF_simpleRecordBackend [friend, inherited]
 


Member Data Documentation

OOF_ExpandableLongArray* OOF_recordBufferedContext::mBlobFieldBodies [protected, inherited]
 

OOF_ExpandableLongArray* OOF_simpleRecordBackend::mBlobFieldNums [protected, inherited]
 

COUNT OOF_ctreeBackend::mBlobFilNo [protected]
 

char* OOF_recordBufferedContext::mBuffer [protected, inherited]
 

dbConnect_ctree* OOF_ctreeBackend::mConnection [protected]
 

unsigned long OOF_recordBufferedContext::mCurrLoadedRecOffset [protected, inherited]
 

bool OOF_tableBackend::mDirty [protected, inherited]
 

OOF_dirtyFieldMap OOF_recordBufferedContext::mDirtyMap [protected, inherited]
 

OOF_recordCache* OOF_simpleRecordBackend::mDirtyRecordCache [protected, inherited]
 

OOF_recordFieldEntry* OOF_simpleRecordBackend::mFieldBufMap [protected, inherited]
 

unsigned int* OOF_simpleRecordBackend::mFieldBufMapRefCount [protected, inherited]
 

OOF_Dictionary OOF_tableBackend::mFields [protected, inherited]
 

bool OOF_tableBackend::mHasDefaultCalculators [protected, inherited]
 

bool OOF_tableBackend::mHasStoredCalculators [protected, inherited]
 

bool OOF_simpleRecordBackend::mIgnoreDuplicateRecords [protected, inherited]
 

COUNT OOF_ctreeBackend::mISAMdatno [protected]
 

unsigned short OOF_simpleRecordBackend::mNumFiles [protected, inherited]
 

unsigned short OOF_simpleRecordBackend::mNumIndexes [protected, inherited]
 

unsigned short OOF_simpleRecordBackend::mOverheadLeadingBytes [protected, inherited]
 

unsigned long OOF_recordBufferedContext::mRecBufLen [protected, inherited]
 

ERecordState OOF_recordBufferedContext::mRecordState [protected, inherited]
 

OOF_recordSelection OOF_simpleRecordBackend::mSelection [protected, inherited]
 

dbTable* OOF_tableBackend::mTable [protected, inherited]
 

long OOF_ctreeBackend::sFileMode = SHARED | PERMANENT [static]
 

long OOF_ctreeBackend::sTransMode = TRNLOG|ENABLE [static]
 

long OOF_ctreeBackend::sTransReleaseMode = ctKEEP_OUT [static]
 


The documentation for this class was generated from the following files:
Generated on Thu Jan 1 21:32:10 2004 for OOFILE by doxygen 1.3.5