Main Page   Class Hierarchy   Compound List   File List   Compound Members  

dbTableDescriptor Class Reference

#include <class.h>

List of all members.

Public Methods

dbTableDescriptor * getNextTable ()
dbFieldDescriptor * findSymbol (char_t const *name)
dbFieldDescriptor * find (char_t const *name)
dbFieldDescriptor * getFirstField ()
int getLastValueOfAutoincrementCount () const
dbFieldDescriptor * getNextField (dbFieldDescriptor *field)
char_t * getName ()
size_t size ()
bool equal (dbTable *table)
bool match (dbTable *table, bool confirmDeleteColumns)
void checkRelationship ()
dbDatabase * getDatabase ()
void storeInDatabase (dbTable *table)
void setFlags ()
 dbTableDescriptor (dbTable *table)
 dbTableDescriptor (char_t const *tableName, dbDatabase *db, size_t objSize, describeFunc func, dbTableDescriptor *original=NULL)
 ~dbTableDescriptor ()

Static Public Methods

void cleanup ()

Static Public Attributes

int initialAutoincrementCount

Protected Types

typedef dbFieldDescriptor *(* describeFunc )()

Protected Methods

size_t totalNamesLength ()
int calculateFieldsAttributes (dbFieldDescriptor *fieldsList, char_t const *prefix, int offs, int indexMask, int &attr)
dbFieldDescriptor * buildFieldsList (dbTable *table, char_t const *prefix, int prefixLen, int &attr)
dbTableDescriptor * clone ()

Protected Attributes

dbTableDescriptor * next
dbTableDescriptor * nextDbTable
char_t * name
oid_t tableId
dbFieldDescriptor * columns
dbFieldDescriptor * hashedFields
dbFieldDescriptor * indexedFields
dbFieldDescriptor * inverseFields
dbFieldDescriptor * firstField
dbFieldDescriptor ** nextFieldLink
dbDatabase * db
bool fixedDatabase
bool isStatic
dbTableDescriptor * cloneOf
size_t appSize
size_t fixedSize
size_t nFields
size_t nColumns
oid_t firstRow
oid_t lastRow
size_t nRows
int4 autoincrementCount
dbTableDescriptor * nextBatch
bool isInBatch
dbSelection batch
int transactionId
dbTableDescriptor * collisionChain


Detailed Description

Table descriptor


Member Typedef Documentation

typedef dbFieldDescriptor*(* dbTableDescriptor::describeFunc)() [protected]
 

Function returning list of record fields descriptors


Constructor & Destructor Documentation

dbTableDescriptor::dbTableDescriptor (  dbTable *    table ) 
 

Construct table descriptor using information stored in database

Parameters:
table  pointer to database table descriptor

dbTableDescriptor::dbTableDescriptor (  char_t const *    tableName,
dbDatabase *    db,
size_t    objSize,
describeFunc    func,
dbTableDescriptor *    original = NULL
) 
 

Constructor of application table descriptor

Parameters:
tableName  name of the table
db  assigned database (may be NULL)
objSize  size of application object
func  function returninglist of field descriptors
original  roiginal table descriptor (for cloned descriptors)

dbTableDescriptor::~dbTableDescriptor (    ) 
 

Table descriptor destructor


Member Function Documentation

dbFieldDescriptor* dbTableDescriptor::buildFieldsList (  dbTable *    table,
char_t const *    prefix,
int    prefixLen,
int &    attr
)  [protected]
 

Read table definiton from the database and build fields list

Parameters:
table  databsae table descriptor
prefix  prefix for the field (in case of structures or arrays
prefixLen  length of the prefix
attr  attributes of the parent field
Returns:
pointer to the constructed list

int dbTableDescriptor::calculateFieldsAttributes (  dbFieldDescriptor *    fieldsList,
char_t const *    prefix,
int    offs,
int    indexMask,
int &    attr
)  [protected]
 

Recursively set field attributes.

Parameters:
fieldsList  list of record fields
prefix  prefix for the field (in case of structures or arrays this functions is invoked resursively for components of this structure or or array
offs  - offset in application class
indexMask  index mask for the structore containing the field
attr  attributes of the parent field
Returns:
alignment of the field

void dbTableDescriptor::checkRelationship (    ) 
 

Check consuistency of declared realations (check that referenced table actually contains declared inverse reference field). This method also resolve references between table.

void dbTableDescriptor::cleanup (    )  [static]
 

Remove all table descriptors except static ones

dbTableDescriptor* dbTableDescriptor::clone (    )  [protected]
 

Clone table descriptor

bool dbTableDescriptor::equal (  dbTable *    table ) 
 

Check whether table descriptor in the database is the same as table appplication table descriptor

Parameters:
table  database table descriptor
Returns:
true if two table descriptors are equal

dbFieldDescriptor* dbTableDescriptor::find (  char_t const *    name ) 
 

Find field with specified name

dbFieldDescriptor* dbTableDescriptor::findSymbol (  char_t const *    name ) 
 

Find field with specified symbol name

dbDatabase* dbTableDescriptor::getDatabase (    )  [inline]
 

Get reference to associated database

Returns:
database to which this table is assigned

dbFieldDescriptor* dbTableDescriptor::getFirstField (    )  [inline]
 

Get first record field

Returns:
descriptor of first record field

int dbTableDescriptor::getLastValueOfAutoincrementCount (    )  const [inline]
 

Get last value of autoincrement counter used for this table

Returns:
last value of autoincrement counter used for this table

char_t* dbTableDescriptor::getName (    )  [inline]
 

Get table name.

dbFieldDescriptor* dbTableDescriptor::getNextField (  dbFieldDescriptor *    field )  [inline]
 

Get next field

Parameters:
field  current field
Returns:
next field after the current in table fields list

dbTableDescriptor* dbTableDescriptor::getNextTable (    )  [inline]
 

Get next table in database

bool dbTableDescriptor::match (  dbTable *    table,
bool    confirmDeleteColumns
) 
 

Check whether fprmats of table descriptor in the database and in application is compatible. This method also prepares information for performing conversion of record to new format

Parameters:
table  database table descriptor
confirmDeleteColumns  whether deletion of columns in allowed from non empty table
Returns:
true if no reformatting is needed

void dbTableDescriptor::setFlags (    ) 
 

Set fields flags. This method is called after loading table descriptor from database.

size_t dbTableDescriptor::size (    )  [inline]
 

Get size of instance of the class in an application

void dbTableDescriptor::storeInDatabase (  dbTable *    table ) 
 

Save table descriptor in the database.

Parameters:
table  place where to store table descriptor

size_t dbTableDescriptor::totalNamesLength (    )  [protected]
 

Calculate total length of all names in table descriptor


Member Data Documentation

size_t dbTableDescriptor::appSize [protected]
 

Size of tghe correspondent application object

int4 dbTableDescriptor::autoincrementCount [protected]
 

Autoincremented counter for this table

dbSelection dbTableDescriptor::batch [protected]
 

Selection to hold OID of batch inserted records

dbTableDescriptor* dbTableDescriptor::cloneOf [protected]
 

When unassigned table descriptor is explicitly assigned to the database, new clone of descriptor is created and cloneOf field of this descriptor referes to original table descriptor.

dbTableDescriptor* dbTableDescriptor::collisionChain [protected]
 

Collision chain of table's hash table

dbFieldDescriptor* dbTableDescriptor::columns [protected]
 

List of table columns

dbDatabase* dbTableDescriptor::db [protected]
 

Attached database

dbFieldDescriptor* dbTableDescriptor::firstField [protected]
 

List of all fields

oid_t dbTableDescriptor::firstRow [protected]
 

Identifer of the first (oldest) row in the table

bool dbTableDescriptor::fixedDatabase [protected]
 

Database staticly attached to the table (by means of REGISTER_IN macro)

size_t dbTableDescriptor::fixedSize [protected]
 

Size of fixed part of the records (without string and array bodies)

dbFieldDescriptor* dbTableDescriptor::hashedFields [protected]
 

List of hashed fields

dbFieldDescriptor* dbTableDescriptor::indexedFields [protected]
 

List of fields indexed by B-Ttree

int dbTableDescriptor::initialAutoincrementCount [static]
 

Initial value for autoincrement conunt

dbFieldDescriptor* dbTableDescriptor::inverseFields [protected]
 

List of related fields (fields, for which inverse references exist)

bool dbTableDescriptor::isInBatch [protected]
 

If table contains batch inserted records

bool dbTableDescriptor::isStatic [protected]
 

Table descriptor is static object created by one of REGISTER macros

oid_t dbTableDescriptor::lastRow [protected]
 

Identifer of the last (most recently inerted) row in the table

char_t* dbTableDescriptor::name [protected]
 

Name of the table

size_t dbTableDescriptor::nColumns [protected]
 

Number of columns in the table

dbTableDescriptor* dbTableDescriptor::next [protected]
 

Chain of all tables in application

dbTableDescriptor* dbTableDescriptor::nextBatch [protected]
 

Next table with batch inserted records

dbTableDescriptor* dbTableDescriptor::nextDbTable [protected]
 

Chain of all tables associated with database

dbFieldDescriptor** dbTableDescriptor::nextFieldLink [protected]
 

Pointer of next field of the last field (used for list construction)

size_t dbTableDescriptor::nFields [protected]
 

Number of fields in the table

size_t dbTableDescriptor::nRows [protected]
 

Number of the rows in the table

oid_t dbTableDescriptor::tableId [protected]
 

Indetifier of table object in the database

int dbTableDescriptor::transactionId [protected]
 

ID of transaction when this table descriptor was last refreshed


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 21:46:05 2008 for GigaBASE by doxygen1.2.18