Main Page   Class Hierarchy   Compound List   File List   Compound Members  

dbFieldDescriptor Class Reference

#include <class.h>

List of all members.

Public Types

enum  FieldAttributes

Public Methods

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, bool insert)
void markUpdatedFields (byte *dst, byte *src)
void fetchRecordFields (byte *dst, byte *src)
void adjustReferences (byte *record, size_t base, size_t size, long shift)
dbFieldDescriptor * find (const char *name)
dbFieldDescriptor * getFirstComponent ()
dbFieldDescriptor * getNextComponent (dbFieldDescriptor *field)
dbFieldDescriptor & operator, (dbFieldDescriptor &field)
dbFieldDescriptor & adjustOffsets (long offs)
 dbFieldDescriptor (char const *name, size_t offs, size_t size, int indexType, char const *inverse=NULL, dbFieldDescriptor *components=NULL)
 dbFieldDescriptor (char const *name)
 ~dbFieldDescriptor ()

Public Attributes

dbFieldDescriptor * next
dbFieldDescriptor * prev
dbFieldDescriptor * nextField
dbFieldDescriptor * nextHashedField
dbFieldDescriptor * nextIndexedField
dbFieldDescriptor * nextInverseField
int fieldNo
char * name
char * longName
char * refTableName
dbTableDescriptorrefTable
dbTableDescriptordefTable
dbFieldDescriptor * inverseRef
char * inverseRefName
int type
int appType
int indexType
int dbsOffs
int appOffs
dbFieldDescriptor * components
oid_t hashTable
oid_t tTree
size_t dbsSize
size_t appSize
size_t alignment
dbUDTComparator comparator
int oldDbsType
int oldDbsOffs
int oldDbsSize
dbAnyMethodTrampolinemethod
void(* arrayAllocator )(dbAnyArray *array, void *data, size_t length)


Detailed Description

Descriptor of table field


Member Enumeration Documentation

enum dbFieldDescriptor::FieldAttributes
 

Attributes of the field


Constructor & Destructor Documentation

dbFieldDescriptor::dbFieldDescriptor char const *    name,
size_t    offs,
size_t    size,
int    indexType,
char const *    inverse = NULL,
dbFieldDescriptor *    components = NULL
 

Field descriptor constructor

Parameters:
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 const *    name
 

Constructor of dummy field descriptor

Parameters:
name  name of the field

dbFieldDescriptor::~dbFieldDescriptor  
 

Field descriptor destructor


Member Function Documentation

dbFieldDescriptor& dbFieldDescriptor::adjustOffsets long    offs
 

Adjust offsets within application objects for descriptors of base classes.

void dbFieldDescriptor::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.

Parameters:
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.

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.

Parameters:
base  address of the application object
offs  offset of the end of varying part of the record
Returns:
size 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.

Parameters:
base  address of the application object
offs  offset of the end of varying part of the record
Returns:
size 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.

Parameters:
dst  destination for converted field
src  original field
offs  offset of varying part
offs  offset of the end of varying part of the record
Returns:
size 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.

Parameters:
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
Returns:
size of the record

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.

Parameters:
dst  pointer to the application object into which record is extract
src  image of the object in the database

dbFieldDescriptor* dbFieldDescriptor::find const char *    name
 

Find component with specified name (for structures only)

Parameters:
name  component name
Returns:
descriptor of the field or NULL if not found

dbFieldDescriptor* dbFieldDescriptor::getFirstComponent   [inline]
 

Get first component of the field (for structures only)

Returns:
first component of the structure

dbFieldDescriptor* dbFieldDescriptor::getNextComponent dbFieldDescriptor *    field [inline]
 

Get next component within the scope

Returns:
next component within the scope

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.

Parameters:
dst  old image of the record in the database
src  updated application object

dbFieldDescriptor& dbFieldDescriptor::operator, dbFieldDescriptor &    field [inline]
 

Redefined ',' operator used to form list of components

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.

Parameters:
field  list of the fields in one scope
base  pointer inside database
size  [in/out] size of the record
Returns:
offset of last field

size_t dbFieldDescriptor::storeRecordFields byte *    dst,
byte *    src,
size_t    offs,
bool    insert
 

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.

Parameters:
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)
Returns:
size of the record


Member Data Documentation

size_t dbFieldDescriptor::alignment
 

Alignment of the field (for structures it is equal to the maximum required alignment of it's components

int dbFieldDescriptor::appOffs
 

Offset to the field in application

size_t dbFieldDescriptor::appSize
 

Size of the object in application

int dbFieldDescriptor::appType
 

Type of the field in application

void(* dbFieldDescriptor::arrayAllocator)(dbAnyArray* array, void* data, size_t length)
 

Allocator of array components

dbUDTComparator dbFieldDescriptor::comparator
 

Comparator for user defined types

dbFieldDescriptor* dbFieldDescriptor::components
 

Subcomponents of the field (for structures and arrays)

int dbFieldDescriptor::dbsOffs
 

Offset to the field in database

size_t dbFieldDescriptor::dbsSize
 

Size of the record in database

dbTableDescriptor* dbFieldDescriptor::defTable
 

Definition of the table to which this field belongs

int dbFieldDescriptor::fieldNo
 

Column number

oid_t dbFieldDescriptor::hashTable
 

Hash table (for fields which are indexed by means of hash table)

int dbFieldDescriptor::indexType
 

Type of field index (bit combination of constants defined in dbIndexType)

dbFieldDescriptor* dbFieldDescriptor::inverseRef
 

Inverse reference (for reference fields only)

char* dbFieldDescriptor::inverseRefName
 

Inverse reference name (for reference fields only)

char* dbFieldDescriptor::longName
 

Compound name of field, for example "coord.x"

dbAnyMethodTrampoline* dbFieldDescriptor::method
 

Trampoline used to invoke class method from SubSQL (for method components only)

char* dbFieldDescriptor::name
 

Name of the field

dbFieldDescriptor* dbFieldDescriptor::next
 

Next file within scope

dbFieldDescriptor* dbFieldDescriptor::nextField
 

Next field in the list of all fields in the table

dbFieldDescriptor* dbFieldDescriptor::nextHashedField
 

Next field in the list of all hashed fields in the table

dbFieldDescriptor* dbFieldDescriptor::nextIndexedField
 

Next field in the list of all indexed fields in the table

dbFieldDescriptor* dbFieldDescriptor::nextInverseField
 

Next field in the list of all relation fields in the table

int dbFieldDescriptor::oldDbsOffs
 

Old offset of the field in database (before schema evaluation)

int dbFieldDescriptor::oldDbsSize
 

Old size of the field in database (before schema evaluation)

int dbFieldDescriptor::oldDbsType
 

Old type of the field in database (before schema evaluation)

dbFieldDescriptor* dbFieldDescriptor::prev
 

Previous field within scope

dbTableDescriptor* dbFieldDescriptor::refTable
 

Referenced table (for reference fields only)

char* dbFieldDescriptor::refTableName
 

Name of referenced table (for reference fields only)

oid_t dbFieldDescriptor::tTree
 

T-Tree (for fields which are indexed by means of T-Ttree)

int dbFieldDescriptor::type
 

Type of the field in the database (dbField::FieldTypes)


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