#include <class.h>
List of all members.
Public Member Functions |
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 () |
oid_t | getId () |
bool | equal (dbTable *table, bool ignoreIndices=false) |
bool | match (dbTable *table, bool confirmDeleteColumns, bool preserveExistedIndices, bool isEmpty) |
bool | checkRelationship () |
dbDatabase * | getDatabase () |
void | storeInDatabase (dbTable *table) |
void | setFlags () |
void | link () |
void | unlink () |
| dbTableDescriptor (dbTable *table) |
| dbTableDescriptor (char_t const *tableName, dbDatabase *db, size_t objSize, describeFunc func, dbTableDescriptor *original=NULL) |
| ~dbTableDescriptor () |
Static Public Member Functions |
static dbMutex & | getChainMutex () |
static void | cleanup () |
Static Public Attributes |
static int | initialAutoincrementCount |
Protected Types |
typedef dbFieldDescriptor *(* | describeFunc )() |
Protected Member Functions |
size_t | totalNamesLength () |
void | calculateFieldsAttributes (dbFieldDescriptor *fieldsList, char_t const *prefix, int offs, int indexMask, int &attr, size_t &dbsAlignment, size_t &appAlignment) |
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 |
int | attr |
describeFunc | describeComponentsFunc |
dbTableDescriptor * | collisionChain |
Static Protected Attributes |
static dbTableDescriptor * | chain |
static dbMutex * | chainMutex |
Friends |
class | dbCompiler |
class | dbDatabase |
class | dbReplicatedDatabase |
class | dbTable |
class | dbAnyCursor |
class | dbSubSql |
class | dbParallelQueryContext |
class | dbServer |
class | dbSession |
class | dbAnyContainer |
class | dbColumnBinding |
class | dbFieldDescriptor |
class | dbSelection |
class | dbTableIterator |
class | dbCLI |
class | dbFileTransactionLogger |
Detailed Description
Table descriptor
Member Typedef Documentation
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 |
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
void dbTableDescriptor::calculateFieldsAttributes |
( |
dbFieldDescriptor * |
fieldsList, |
|
|
char_t const * |
prefix, |
|
|
int |
offs, |
|
|
int |
indexMask, |
|
|
int & |
attr, |
|
|
size_t & |
dbsAlignment, |
|
|
size_t & |
appAlignment | |
|
) |
| | [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
- Parameters:
-
| dbsAlignment | maximal alignment of the fields in the database |
| appAlignment | maximal alignment of the fields in the application |
bool dbTableDescriptor::checkRelationship |
( |
|
) |
|
Check consuistency of declared realations (check that referenced table actually contains declared inverse reference field). This method also resolve references between table.
static void dbTableDescriptor::cleanup |
( |
|
) |
[static] |
Remove all table descriptors except static ones
bool dbTableDescriptor::equal |
( |
dbTable * |
table, |
|
|
bool |
ignoreIndices = false | |
|
) |
| | |
Check whether table descriptor in the database is the same as table appplication table descriptor
- Parameters:
-
| table | database table descriptor |
| ignoreIndices | ignore presence of indices during comparison |
- Returns:
true
if two table descriptors are equal
Find field with specified name
Find field with specified symbol name
dbDatabase* dbTableDescriptor::getDatabase |
( |
|
) |
[inline] |
Get reference to associated database
- Returns:
- database to which this table is assigned
Get first record field
- Returns:
- descriptor of first record field
oid_t dbTableDescriptor::getId |
( |
|
) |
[inline] |
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 next field
- Parameters:
-
- Returns:
- next field after the current in table fields list
References dbFieldDescriptor::next.
Get next table in database
bool dbTableDescriptor::match |
( |
dbTable * |
table, |
|
|
bool |
confirmDeleteColumns, |
|
|
bool |
preserveExistedIndices, |
|
|
bool |
isEmpty | |
|
) |
| | |
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 |
| preserveExistedIndices | preserve existed indices |
| isEmpty | table is empty |
- 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 of tghe correspondent application object
Autoincremented counter for this table
Selection to hold OID of batch inserted records
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.
Collision chain of table's hash table
Identifer of the first (oldest) row in the table
Database staticly attached to the table (by means of REGISTER_IN macro)
Referenced by dbDatabase::assign().
Size of fixed part of the records (without string and array bodies)
List of fields indexed by B-Ttree
Initial value for autoincrement conunt
List of related fields (fields, for which inverse references exist)
If table contains batch inserted records
Table descriptor is static object created by one of REGISTER macros
Identifer of the last (most recently inerted) row in the table
Number of columns in the table
Chain of all tables in application
Next table with batch inserted records
Chain of all tables associated with database
Pointer of next field of the last field (used for list construction)
Number of fields in the table
Number of the rows in the table
ID of transaction when this table descriptor was last refreshed
The documentation for this class was generated from the following file: