#include <class.h>
Public Member Functions | |
| dbTableDescriptor * | getNextTable () |
| Get next table in database. | |
| dbFieldDescriptor * | findSymbol (char const *name) |
| Find field with specified symbol name. | |
| dbFieldDescriptor * | find (char const *name) |
| Find field with specified name. | |
| dbFieldDescriptor * | getFirstField () |
| Get first record field. | |
| int | getLastValueOfAutoincrementCount () const |
| Get last value of autoincrement counter used for this table. | |
| dbFieldDescriptor * | getNextField (dbFieldDescriptor *field) |
| Get next field. | |
| char * | getName () |
| Get table name. | |
| size_t | size () |
| Get size of instance of the class in an application. | |
| void | setFlags () |
| Set fields flags. | |
| bool | equal (dbTable *table) |
| Check whether table descriptor in the database is the same as table appplication table descriptor. | |
| bool | match (dbTable *table, bool confirmDeleteColumns) |
| Check whether fprmats of table descriptor in the database and in application is compatible. | |
| void | checkRelationship () |
| Check consuistency of declared realations (check that referenced table actually contains declared inverse reference field). | |
| dbDatabase * | getDatabase () |
| Get reference to associated database. | |
| void | storeInDatabase (dbTable *table) |
| Save table descriptor in the database. | |
| dbTableDescriptor (dbTable *table) | |
| Construct table descriptor using information stored in database. | |
| dbTableDescriptor (char const *tableName, dbDatabase *db, size_t objSize, describeFunc func, dbTableDescriptor *original=NULL) | |
| Constructor of application table descriptor. | |
| ~dbTableDescriptor () | |
| Table descriptor destructor. | |
Static Public Member Functions | |
| static void | cleanup () |
| Remove all table descriptors except static ones. | |
Static Public Attributes | |
| static int | initialAutoincrementCount |
| Initial value for autoincrement count. | |
Protected Types | |
| typedef dbFieldDescriptor *(* | describeFunc )() |
| Function returning list of record fields descriptors. | |
Protected Member Functions | |
| dbTableDescriptor * | clone () |
| Clone table descriptor. | |
| size_t | totalNamesLength () |
| Calculate total length of all names in table descriptor. | |
| int | calculateFieldsAttributes (dbFieldDescriptor *fieldsList, char const *prefix, int offs, int indexMask, int &attr) |
| Recursively set field attributes. | |
| dbFieldDescriptor * | buildFieldsList (dbTable *table, char const *prefix, int prefixLen, int &attr) |
| Read table definiton from the database and build fields list. | |
Protected Attributes | |
| dbTableDescriptor * | next |
| Chain of all tables in application. | |
| dbTableDescriptor * | nextDbTable |
| Chain of all tables associated with database. | |
| char * | name |
| Name of the table. | |
| oid_t | tableId |
| Indetifier of table object in the database. | |
| dbFieldDescriptor * | columns |
| List of table columns. | |
| dbFieldDescriptor * | hashedFields |
| List of hashed fields. | |
| dbFieldDescriptor * | indexedFields |
| List of fields indexed by T-Ttree. | |
| dbFieldDescriptor * | inverseFields |
| List of related fields (fields, for which inverse references exist). | |
| dbFieldDescriptor * | firstField |
| List of all fields. | |
| dbFieldDescriptor ** | nextFieldLink |
| Pointer of next field of the last field (used for list construction). | |
| dbDatabase * | db |
| Attached database. | |
| bool | fixedDatabase |
| Database staticly attached to the table (by means of REGISTER_IN macro). | |
| bool | isStatic |
| Table descriptor is static object created by one of REGISTER macros. | |
| size_t | appSize |
| Size of tghe correspondent applciation object. | |
| size_t | fixedSize |
| Size of fixed part of the records (without string and array bodies). | |
| size_t | nFields |
| Number of fields in the table. | |
| size_t | nColumns |
| Number of columns in the table. | |
| int4 | autoincrementCount |
| Autoincremented counter for this table. | |
| dbTableDescriptor * | cloneOf |
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. | |
| describeFunc | describeComponentsFunc |
Static Protected Attributes | |
| static dbTableDescriptor * | chain |
Friends | |
| class | dbCompiler |
| class | dbDatabase |
| class | dbReplicatedDatabase |
| class | dbTable |
| class | dbAnyCursor |
| class | dbSubSql |
| class | dbHashTable |
| class | dbTtreeNode |
| class | dbRtreePage |
| class | dbServer |
| class | dbColumnBinding |
| class | dbFieldDescriptor |
| class | dbAnyContainer |
| class | dbCLI |
| class | dbSelection |
typedef dbFieldDescriptor*(* describeFunc)() [protected] |
Function returning list of record fields descriptors.
| dbTableDescriptor | ( | dbTable * | table | ) |
Construct table descriptor using information stored in database.
| table | pointer to database table descriptor |
| dbTableDescriptor | ( | char const * | tableName, | |
| dbDatabase * | db, | |||
| size_t | objSize, | |||
| describeFunc | func, | |||
| dbTableDescriptor * | original = NULL | |||
| ) |
Constructor of application table descriptor.
| 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 | ( | ) |
Table descriptor destructor.
| dbTableDescriptor * clone | ( | ) | [protected] |
Clone table descriptor.
| size_t totalNamesLength | ( | ) | [protected] |
Calculate total length of all names in table descriptor.
| int calculateFieldsAttributes | ( | dbFieldDescriptor * | fieldsList, | |
| char const * | prefix, | |||
| int | offs, | |||
| int | indexMask, | |||
| int & | attr | |||
| ) | [protected] |
Recursively set field attributes.
| 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 |
| dbFieldDescriptor * buildFieldsList | ( | dbTable * | table, | |
| char const * | prefix, | |||
| int | prefixLen, | |||
| int & | attr | |||
| ) | [protected] |
Read table definiton from the database and build fields list.
| 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 |
| dbTableDescriptor* getNextTable | ( | ) | [inline] |
Get next table in database.
| dbFieldDescriptor * findSymbol | ( | char const * | name | ) |
Find field with specified symbol name.
| dbFieldDescriptor * find | ( | char const * | name | ) |
Find field with specified name.
| dbFieldDescriptor* getFirstField | ( | ) | [inline] |
Get first record field.
| int getLastValueOfAutoincrementCount | ( | ) | const [inline] |
Get last value of autoincrement counter used for this table.
| dbFieldDescriptor* getNextField | ( | dbFieldDescriptor * | field | ) | [inline] |
Get next field.
| field | current field |
| char* getName | ( | ) | [inline] |
Get table name.
| size_t size | ( | ) | [inline] |
Get size of instance of the class in an application.
| void setFlags | ( | ) |
Set fields flags.
This method is called after loading table descriptor from database.
| bool equal | ( | dbTable * | table | ) |
Check whether table descriptor in the database is the same as table appplication table descriptor.
| table | database table descriptor |
true if two table descriptors are equal | bool 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
| table | database table descriptor | |
| confirmDeleteColumns | whether deletion of columns in allowed from non empty table |
true if no reformatting is needed | void checkRelationship | ( | ) |
Check consuistency of declared realations (check that referenced table actually contains declared inverse reference field).
This method also resolve references between table.
| dbDatabase* getDatabase | ( | ) | [inline] |
Get reference to associated database.
| void storeInDatabase | ( | dbTable * | table | ) |
Save table descriptor in the database.
| table | place where to store table descriptor |
| void cleanup | ( | ) | [static] |
Remove all table descriptors except static ones.
friend class dbCompiler [friend] |
friend class dbDatabase [friend] |
friend class dbReplicatedDatabase [friend] |
friend class dbTable [friend] |
friend class dbAnyCursor [friend] |
friend class dbSubSql [friend] |
friend class dbHashTable [friend] |
friend class dbTtreeNode [friend] |
friend class dbRtreePage [friend] |
friend class dbServer [friend] |
friend class dbColumnBinding [friend] |
friend class dbFieldDescriptor [friend] |
friend class dbAnyContainer [friend] |
friend class dbCLI [friend] |
friend class dbSelection [friend] |
dbTableDescriptor* next [protected] |
Chain of all tables in application.
dbTableDescriptor * chain [static, protected] |
dbTableDescriptor* nextDbTable [protected] |
Chain of all tables associated with database.
char* name [protected] |
Name of the table.
dbFieldDescriptor* columns [protected] |
List of table columns.
dbFieldDescriptor* hashedFields [protected] |
List of hashed fields.
dbFieldDescriptor* indexedFields [protected] |
List of fields indexed by T-Ttree.
dbFieldDescriptor* inverseFields [protected] |
List of related fields (fields, for which inverse references exist).
dbFieldDescriptor* firstField [protected] |
List of all fields.
dbFieldDescriptor** nextFieldLink [protected] |
Pointer of next field of the last field (used for list construction).
dbDatabase* db [protected] |
Attached database.
bool fixedDatabase [protected] |
Database staticly attached to the table (by means of REGISTER_IN macro).
bool isStatic [protected] |
Table descriptor is static object created by one of REGISTER macros.
size_t appSize [protected] |
Size of tghe correspondent applciation object.
size_t fixedSize [protected] |
Size of fixed part of the records (without string and array bodies).
size_t nFields [protected] |
Number of fields in the table.
size_t nColumns [protected] |
Number of columns in the table.
int4 autoincrementCount [protected] |
Autoincremented counter for this table.
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.
describeFunc describeComponentsFunc [protected] |
int initialAutoincrementCount [static] |
Initial value for autoincrement count.
To take effect, this value should be assigned before database open.