Main Page   Class Hierarchy   Compound List   File List   Compound Members  

dbTableDescriptor Class Reference

#include <class.h>

List of all members.

Public Methods

dbTableDescriptor * getNextTable ()
dbFieldDescriptorfindSymbol (char const *name)
dbFieldDescriptorfind (char const *name)
dbFieldDescriptorgetFirstField ()
int getLastValueOfAutoincrementCount () const
dbFieldDescriptorgetNextField (dbFieldDescriptor *field)
char * getName ()
size_t size ()
void setFlags ()
bool equal (dbTable *table)
bool match (dbTable *table, bool confirmDeleteColumns)
void checkRelationship ()
dbDatabasegetDatabase ()
void storeInDatabase (dbTable *table)
 dbTableDescriptor (dbTable *table)
 dbTableDescriptor (char 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

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

Protected Attributes

dbTableDescriptor * next
dbTableDescriptor * nextDbTable
char * name
oid_t tableId
dbFieldDescriptorcolumns
dbFieldDescriptorhashedFields
dbFieldDescriptorindexedFields
dbFieldDescriptorinverseFields
dbFieldDescriptorfirstField
dbFieldDescriptor ** nextFieldLink
dbDatabasedb
bool fixedDatabase
bool isStatic
size_t appSize
size_t fixedSize
size_t nFields
size_t nColumns
int4 autoincrementCount
dbTableDescriptor * cloneOf


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 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  original table descriptor (for cloned descriptors)

dbTableDescriptor::~dbTableDescriptor  
 

Table descriptor destructor


Member Function Documentation

dbFieldDescriptor* dbTableDescriptor::buildFieldsList dbTable   table,
char 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 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 const *    name
 

Find field with specified name

dbFieldDescriptor* dbTableDescriptor::findSymbol char 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* 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 applciation object

int4 dbTableDescriptor::autoincrementCount [protected]
 

Autoincremented counter for this table

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.

dbFieldDescriptor* dbTableDescriptor::columns [protected]
 

List of table columns

dbDatabase* dbTableDescriptor::db [protected]
 

Attached database

dbFieldDescriptor* dbTableDescriptor::firstField [protected]
 

List of all fields

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 T-Ttree

int dbTableDescriptor::initialAutoincrementCount [static]
 

Initial value for autoincrement count. To take effect, this value should be assigned before database open.

dbFieldDescriptor* dbTableDescriptor::inverseFields [protected]
 

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

bool dbTableDescriptor::isStatic [protected]
 

Table descriptor is static object created by one of REGISTER macros

char* 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::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

oid_t dbTableDescriptor::tableId [protected]
 

Indetifier of table object in the database


The documentation for this class was generated from the following file:
Generated on Mon Oct 23 13:23:59 2006 for FastDB by doxygen1.2.18