Main Page | Class Hierarchy | Class List | File List | Class Members

dbFieldDescriptor Class Reference

#include <class.h>

List of all members.

Public Types

enum  FieldAttributes { ComponentOfArray = 0x01, HasArrayComponents = 0x02, OneToOneMapping = 0x04, Updated = 0x08 }

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, bool insert)
void markUpdatedFields (byte *dst, byte *src)
void fetchRecordFields (byte *dst, byte *src)
dbFieldDescriptorfind (const char_t *name)
dbFieldDescriptorgetFirstComponent ()
dbFieldDescriptorgetNextComponent (dbFieldDescriptor *field)
dbFieldDescriptoroperator, (dbFieldDescriptor &field)
void * operator new (size_t size)
void operator delete (void *p)
dbFieldDescriptoradjustOffsets (long 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

dbFieldDescriptornext
dbFieldDescriptorprev
dbFieldDescriptornextField
dbFieldDescriptornextHashedField
dbFieldDescriptornextIndexedField
dbFieldDescriptornextInverseField
int fieldNo
char_t * name
char_t * longName
char_t * refTableName
dbTableDescriptorrefTable
dbTableDescriptordefTable
dbFieldDescriptorinverseRef
char_t * inverseRefName
int type
int appType
int indexType
int dbsOffs
int appOffs
dbFieldDescriptorcomponents
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
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_t const *  name,
size_t  offs,
size_t  size,
int  indexType,
char_t 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_t 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.

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_t *  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

oid_t dbFieldDescriptor::bTree
 

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

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 (currently not used)

int dbFieldDescriptor::indexType
 

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

dbFieldDescriptor* dbFieldDescriptor::inverseRef
 

Inverse reference (for reference fields only)

char_t* dbFieldDescriptor::inverseRefName
 

Inverse reference name (for reference fields only)

char_t* 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_t* 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_t* dbFieldDescriptor::refTableName
 

Name of referenced table (for reference fields only)

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 Thu Nov 24 23:14:30 2005 for GigaBASE by doxygen 1.3.5