The C++ Field Class

The Field class represents a field in a database record (object or instance of a database class).

For an overview see page C++ Classes

The Field methods are listed below.

size_t calculateStructAlignment( void )
Calculates the struct alignment.
Iterator <Field>* components( void )
Gets a field iterator for a struct Field.
Field* element( void )
Gets a field descriptor for an element of an array (vector) Field.
Type elementType( void )
Gets the type of an element of an array (vector) Field.
Field* findField( String * name )
Finds the component in this struct Field by name.
int fixedSize( void )
Gets the size of fixed arrays (note: for fixed-size array Fields only).
Value* get( Struct rec )
Gets the value of this Field: the record or structure containing this Field (in most cases rec is just a table record—even for components or columns of this record having type struct. For components of array of struct elements, rec should be the StructValue returned for this array element).
bool isAutoGenerated( void )
Checks if this Field is an autogenerated column and should not be considered in a “natural” join.
String* name( void )
Gets the name of this Field.
String* referencedTableName( void )
Gets the name of this referenced table if this is a reference Field (note that this method is only for reference Fields).
Field* scope( void )
Gets the scope of the Field if it’s part of a struct or array field; returns the struct or array Field of which this Field is a component, or NULL if this Field is not a component of any struct or array.
size_t serialize( char * buf , size_t & size )
Serializes the current Field value to the specified buffer.
void set( Struct * rec, Value * val )
Sets the new Value of this Field.
Table* set( void )
Gets the Table this Field belongs to.
Type type( void )
Gets the type of this Field.
Value* update( Struct * rec )
Gets the struct or array Value of this Field for update.