#include <class.h>
Public Types | |
| enum | FieldAttributes { ComponentOfArray = 0x01, HasArrayComponents = 0x02, OneToOneMapping = 0x04, Updated = 0x08 } |
| Attributes of the field. More... | |
| enum | StoreMode { Insert, Update, Import } |
Public Member Functions | |
| size_t | calculateRecordSize (byte *base, size_t offs) |
| Calculate record size in the database. | |
| size_t | calculateNewRecordSize (byte *base, size_t offs) |
| Calculate record size after reformatting record according to the new definition of the application class. | |
| size_t | convertRecord (byte *dst, byte *src, size_t offs) |
| Convert of the feild to new format. | |
| int | sizeWithoutOneField (dbFieldDescriptor *field, byte *base, size_t &size) |
| Size of the record without one field. | |
| size_t | copyRecordExceptOneField (dbFieldDescriptor *field, byte *dst, byte *src, size_t offs) |
| Recursively copy record to new location except one field. | |
| size_t | storeRecordFields (byte *dst, byte *src, size_t offs, StoreMode mode) |
| Store record fields in the databases This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components. | |
| void | markUpdatedFields (byte *dst, byte *src) |
| Mask updated fields. | |
| void | fetchRecordFields (byte *dst, byte *src) |
| Fetch record from the database This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components. | |
| void | adjustReferences (byte *record, size_t base, size_t size, long shift) |
| Adjust references in all fetched records (current records in all opened cursors) when database was reallocated. | |
| dbFieldDescriptor * | find (const char *name) |
| Find component with specified name (for structures only). | |
| dbFieldDescriptor * | getFirstComponent () |
| Get first component of the field (for structures only). | |
| dbFieldDescriptor * | getNextComponent (dbFieldDescriptor *field) |
| Get next component within the scope. | |
| dbFieldDescriptor & | operator, (dbFieldDescriptor &field) |
| Redefined ',' operator used to form list of components. | |
| void * | operator new (size_t size EXTRA_DEBUG_NEW_PARAMS) |
| void | operator delete (void *p EXTRA_DEBUG_NEW_PARAMS) |
| dbFieldDescriptor & | adjustOffsets (long offs) |
| Adjust offsets within application objects for descriptors of base classes. | |
| dbFieldDescriptor (char const *name, size_t offs, size_t size, int indexType, char const *inverse=NULL, dbFieldDescriptor *components=NULL) | |
| Field descriptor constructor. | |
| dbFieldDescriptor (char const *name) | |
| Constructor of dummy field descriptor. | |
| ~dbFieldDescriptor () | |
| Field descriptor destructor. | |
Public Attributes | |
| dbFieldDescriptor * | next |
| Next file within scope. | |
| dbFieldDescriptor * | prev |
| Previous field within scope. | |
| dbFieldDescriptor * | nextField |
| Next field in the list of all fields in the table. | |
| dbFieldDescriptor * | nextHashedField |
| Next field in the list of all hashed fields in the table. | |
| dbFieldDescriptor * | nextIndexedField |
| Next field in the list of all indexed fields in the table. | |
| dbFieldDescriptor * | nextInverseField |
| Next field in the list of all relation fields in the table. | |
| int | fieldNo |
| Column number. | |
| char * | name |
| Name of the field. | |
| char * | longName |
| Compound name of field, for example "coord.x". | |
| char * | refTableName |
| Name of referenced table (for reference fields only). | |
| dbTableDescriptor * | refTable |
| Referenced table (for reference fields only). | |
| dbTableDescriptor * | defTable |
| Definition of the table to which this field belongs. | |
| dbFieldDescriptor * | inverseRef |
| Inverse reference (for reference fields only). | |
| char * | inverseRefName |
| Inverse reference name (for reference fields only). | |
| int | type |
| Type of the field in the database (dbField::FieldTypes). | |
| int | appType |
| Type of the field in application. | |
| int | indexType |
| Type of field index (bit combination of constants defined in dbIndexType). | |
| int | dbsOffs |
| Offset to the field in database. | |
| int | appOffs |
| Offset to the field in application. | |
| dbFieldDescriptor * | components |
| Subcomponents of the field (for structures and arrays). | |
| oid_t | hashTable |
| Hash table (for fields which are indexed by means of hash table). | |
| oid_t | tTree |
| T-Tree (for fields which are indexed by means of T-Ttree). | |
| size_t | dbsSize |
| Size of the record in database. | |
| size_t | appSize |
| Size of the object in application. | |
| size_t | alignment |
| Alignment of the field (for structures it is equal to the maximum required alignment of it's components. | |
| dbUDTComparator | comparator |
| Comparator for user defined types. | |
| int | attr |
| int | oldDbsType |
| Old type of the field in database (before schema evaluation). | |
| int | oldDbsOffs |
| Old offset of the field in database (before schema evaluation). | |
| int | oldDbsSize |
| Old size of the field in database (before schema evaluation). | |
| dbAnyMethodTrampoline * | method |
| Trampoline used to invoke class method from SubSQL (for method components only). | |
| void(* | arrayAllocator )(dbAnyArray *array, void *data, size_t length) |
| Allocator of array components. | |
| enum FieldAttributes |
| enum StoreMode |
| dbFieldDescriptor | ( | char const * | name, | |
| size_t | offs, | |||
| size_t | size, | |||
| int | indexType, | |||
| char const * | inverse = NULL, |
|||
| dbFieldDescriptor * | components = NULL | |||
| ) |
Field descriptor constructor.
| name | name of the field | |
| offs | offset of the field | |
| size | size of the field | |
| indexType | type of index used for this field | |
| inverse | name of inverse field | |
| components | comopnents of structure or array |
| dbFieldDescriptor | ( | char const * | name | ) |
Constructor of dummy field descriptor.
| name | name of the field |
| ~dbFieldDescriptor | ( | ) |
Field descriptor destructor.
| size_t calculateRecordSize | ( | byte * | base, | |
| size_t | offs | |||
| ) |
Calculate record size in the database.
This method performs interation through all components in one scope and recursively invokes itself for structure and array components. First time this method is invoked by table descriptor with offs equal to size of fixed part of the record.
| base | address of the application object | |
| offs | offset of the end of varying part of the record |
| size_t calculateNewRecordSize | ( | byte * | base, | |
| size_t | offs | |||
| ) |
Calculate record size after reformatting record according to the new definition of the application class.
This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components.
| base | address of the application object | |
| offs | offset of the end of varying part of the record |
Convert of the feild to new format.
This method is recursively invoked for array and structure components.
| dst | destination for converted field | |
| src | original field | |
| offs | offset of varying part | |
| offs | offset of the end of varying part of the record |
| int sizeWithoutOneField | ( | dbFieldDescriptor * | field, | |
| byte * | base, | |||
| size_t & | size | |||
| ) |
Size of the record without one field.
This method is used to implement automatically updated inverse references. This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components.
| field | list of the fields in one scope | |
| base | pointer inside database | |
| size | [in/out] size of the record |
| size_t copyRecordExceptOneField | ( | dbFieldDescriptor * | field, | |
| byte * | dst, | |||
| byte * | src, | |||
| size_t | offs | |||
| ) |
Recursively copy record to new location except one field.
This method is used for updating inverse references.
| field | list of the fields in one scope | |
| dst | destination where record should be copied | |
| src | source of the copy | |
| offs | offset to the end of varying part |
Store record fields in the databases This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components.
| dst | place in the database where record should be stored | |
| src | pointer to the application object | |
| offs | offset to the end of varying part | |
| insert | flag used to distringuish update fro insert (needed for autoincremented fields) |
Mask updated fields.
This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components.
| dst | old image of the record in the database | |
| src | updated application object |
Fetch record from the database This method performs interation thtough all components in one scope and recursively invoke itself for structure and array components.
| dst | pointer to the application object into which record is extract | |
| src | image of the object in the database |
| void adjustReferences | ( | byte * | record, | |
| size_t | base, | |||
| size_t | size, | |||
| long | shift | |||
| ) |
Adjust references in all fetched records (current records in all opened cursors) when database was reallocated.
| record | pointer to the application object which references should be adjusted | |
| base | new address of memory mapping | |
| size | database isze before extension | |
| shift | difference between old and new addresses of memory mapping obejct location. |
| dbFieldDescriptor * find | ( | const char * | name | ) |
Find component with specified name (for structures only).
| name | component name |
NULL if not found | dbFieldDescriptor* getFirstComponent | ( | ) | [inline] |
Get first component of the field (for structures only).
| dbFieldDescriptor* getNextComponent | ( | dbFieldDescriptor * | field | ) | [inline] |
Get next component within the scope.
| dbFieldDescriptor& operator, | ( | dbFieldDescriptor & | field | ) | [inline] |
Redefined ',' operator used to form list of components.
| void * operator new | ( | size_t size | EXTRA_DEBUG_NEW_PARAMS | ) |
| void operator delete | ( | void *p | EXTRA_DEBUG_NEW_PARAMS | ) |
| dbFieldDescriptor & adjustOffsets | ( | long | offs | ) |
Adjust offsets within application objects for descriptors of base classes.
Next file within scope.
Previous field within scope.
Next field in the list of all fields in the table.
Next field in the list of all hashed fields in the table.
Next field in the list of all indexed fields in the table.
Next field in the list of all relation fields in the table.
| int fieldNo |
Column number.
| char* name |
Name of the field.
| char* longName |
Compound name of field, for example "coord.x".
| char* refTableName |
Name of referenced table (for reference fields only).
Referenced table (for reference fields only).
Definition of the table to which this field belongs.
Inverse reference (for reference fields only).
| char* inverseRefName |
Inverse reference name (for reference fields only).
| int type |
Type of the field in the database (dbField::FieldTypes).
| int appType |
Type of the field in application.
| int indexType |
Type of field index (bit combination of constants defined in dbIndexType).
| int dbsOffs |
Offset to the field in database.
| int appOffs |
Offset to the field in application.
Subcomponents of the field (for structures and arrays).
| size_t dbsSize |
Size of the record in database.
| size_t appSize |
Size of the object in application.
| size_t alignment |
Alignment of the field (for structures it is equal to the maximum required alignment of it's components.
Comparator for user defined types.
| int attr |
| int oldDbsType |
Old type of the field in database (before schema evaluation).
| int oldDbsOffs |
Old offset of the field in database (before schema evaluation).
| int oldDbsSize |
Old size of the field in database (before schema evaluation).
Trampoline used to invoke class method from SubSQL (for method components only).
| void(* arrayAllocator)(dbAnyArray *array, void *data, size_t length) |
Allocator of array components.