#include <class.h>
Public Types | |
enum | FieldAttributes { ComponentOfArray = 0x01, HasArrayComponents = 0x02, OneToOneMapping = 0x04, Updated = 0x08, HasArrayOfArrayComponents = 0x10 } |
enum | StoreMode { Insert, Update, Import } |
Public Member Functions | |
size_t | calculateRecordSize (byte *base, size_t offs) |
size_t | calculateNewRecordSize (byte *base, size_t offs) |
size_t | convertRecord (byte *dst, byte *src, size_t offs) |
int | sizeWithoutOneField (dbFieldDescriptor *field, byte *base, size_t &size) |
size_t | copyRecordExceptOneField (dbFieldDescriptor *field, byte *dst, byte *src, size_t offs) |
size_t | storeRecordFields (byte *dst, byte *src, size_t offs, StoreMode mode) |
void | markUpdatedFields (byte *dst, byte *src) |
void | markUpdatedFields2 (byte *dst, byte *src) |
void | fetchRecordFields (byte *dst, byte *src) |
dbFieldDescriptor * | findSymbol (const char_t *name) |
dbFieldDescriptor * | find (const char_t *name) |
dbFieldDescriptor * | getFirstComponent () |
dbFieldDescriptor * | getNextComponent (dbFieldDescriptor *field) |
dbFieldDescriptor & | operator, (dbFieldDescriptor &field) |
void * | operator new (size_t size) |
void | operator delete (void *p) |
dbFieldDescriptor & | adjustOffsets (size_t offs) |
dbFieldDescriptor (char_t const *name, size_t offs, size_t size, int indexType, char_t const *inverse=NULL, dbFieldDescriptor *components=NULL) | |
dbFieldDescriptor (char_t const *name) | |
~dbFieldDescriptor () | |
Public Attributes | |
dbFieldDescriptor * | next |
dbFieldDescriptor * | prev |
dbFieldDescriptor * | nextField |
dbFieldDescriptor * | nextHashedField |
dbFieldDescriptor * | nextIndexedField |
dbFieldDescriptor * | nextInverseField |
int | fieldNo |
char_t * | name |
char_t * | longName |
char_t * | refTableName |
dbTableDescriptor * | refTable |
dbTableDescriptor * | defTable |
dbFieldDescriptor * | inverseRef |
char_t * | inverseRefName |
int | type |
int | appType |
int | indexType |
union { | |
bool Bool | |
int1 Int1 | |
int2 Int2 | |
int4 Int4 | |
db_int8 Db_Int8 | |
real4 Real4 | |
real8 Real8 | |
} | defaultValue |
int | dbsOffs |
int | appOffs |
dbFieldDescriptor * | components |
oid_t | hashTable |
oid_t | bTree |
size_t | dbsSize |
size_t | appSize |
size_t | alignment |
dbUDTComparator | comparator |
int | attr |
int | oldDbsType |
int | oldDbsOffs |
int | oldDbsSize |
dbAnyMethodTrampoline * | method |
void(* | arrayAllocator )(dbAnyArray *array, void *data, size_t length) |
Descriptor of table field
Attributes of the field
dbFieldDescriptor::dbFieldDescriptor | ( | char_t const * | name, | |
size_t | offs, | |||
size_t | size, | |||
int | indexType, | |||
char_t 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::dbFieldDescriptor | ( | char_t const * | name | ) |
Constructor of dummy field descriptor
name | name of the field |
dbFieldDescriptor::~dbFieldDescriptor | ( | ) |
Field descriptor destructor
dbFieldDescriptor& dbFieldDescriptor::adjustOffsets | ( | size_t | offs | ) |
Adjust offsets within application objects for descriptors of base classes.
size_t dbFieldDescriptor::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 |
size_t dbFieldDescriptor::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 dbFieldDescriptor::convertRecord | ( | byte * | dst, | |
byte * | src, | |||
size_t | offs | |||
) |
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 |
size_t dbFieldDescriptor::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 |
void dbFieldDescriptor::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.
dst | pointer to the application object into which record is extract | |
src | image of the object in the database |
Referenced by dbMethodTrampoline< T, R >::invoke().
dbFieldDescriptor* dbFieldDescriptor::find | ( | const char_t * | name | ) |
Find component with specified name (for structures only)
name | component name |
NULL
if not found dbFieldDescriptor* dbFieldDescriptor::findSymbol | ( | const char_t * | name | ) |
Find component with specified symbol name (for structures only)
name | component symbol name |
NULL
if not found dbFieldDescriptor* dbFieldDescriptor::getFirstComponent | ( | ) | [inline] |
Get first component of the field (for structures only)
dbFieldDescriptor* dbFieldDescriptor::getNextComponent | ( | dbFieldDescriptor * | field | ) | [inline] |
void dbFieldDescriptor::markUpdatedFields | ( | byte * | dst, | |
byte * | src | |||
) |
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 |
void dbFieldDescriptor::markUpdatedFields2 | ( | byte * | dst, | |
byte * | src | |||
) |
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 | new image of the record in the database |
dbFieldDescriptor& dbFieldDescriptor::operator, | ( | dbFieldDescriptor & | field | ) | [inline] |
int dbFieldDescriptor::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 dbFieldDescriptor::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.
dst | place in the database where record should be stored | |
src | pointer to the application object | |
offs | offset to the end of varying part | |
mode | Insert, Update or Import mode |
size_t dbFieldDescriptor::alignment |
Alignment of the field (for structures it is equal to the maximum required alignment of it's components
Offset to the field in application
size_t dbFieldDescriptor::appSize |
Size of the object in application
Type of the field in application
void(* dbFieldDescriptor::arrayAllocator)(dbAnyArray *array, void *data, size_t length) |
Allocator of array components
oid_t dbFieldDescriptor::bTree |
B-Tree (for fields which are indexed by means of T-Ttree)
dbUDTComparator dbFieldDescriptor::comparator |
Comparator for user defined types
Subcomponents of the field (for structures and arrays)
Referenced by dbMethodTrampoline< T, R >::invoke().
Offset to the field in database
size_t dbFieldDescriptor::dbsSize |
Size of the record in database
union { ... } dbFieldDescriptor::defaultValue |
Default value of the field (in case an existing scheme is extended)
Definition of the table to which this field belongs
Column number
Hash table (currently not used)
Type of field index (bit combination of constants defined in dbIndexType)
Inverse reference (for reference fields only)
Inverse reference name (for reference fields only)
char_t* dbFieldDescriptor::longName |
Compound name of field, for example "coord.x"
Trampoline used to invoke class method from SubSQL (for method components only)
char_t* dbFieldDescriptor::name |
Name of the field
Next file within scope
Referenced by getNextComponent(), dbTableDescriptor::getNextField(), and operator,().
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
Old offset of the field in database (before schema evaluation)
Old size of the field in database (before schema evaluation)
Old type of the field in database (before schema evaluation)
Previous field within scope
Referenced by operator,().
Referenced table (for reference fields only)
char_t* dbFieldDescriptor::refTableName |
Name of referenced table (for reference fields only)
Type of the field in the database (dbField::FieldTypes)