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 ) Calculate the struct alignment
Iterator <Field>* components( void ) Get a field iterator for a struct Field
Field* element( void ) Get a field descriptor for an element of an array (vector) Field
Type elementType( void ) Get the type of an element of an array (vector) Field
Field* findField( String * name ) Find the component in this struct Field by name.
int fixedSize( void ) Get the size of fixed arrays (Note: for fixed-size array Fields only)
Value* get( Struct rec ) Get 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 Struct Value returned for this array element)
bool isAutoGenerated( void ) Check if this Field is an autogenerated column and should not be considered in a “natural” join
String* name( void ) Get the name of this Field
String* referencedTableName( void ) Get the name of this referenced table if this is a reference Field (Note that this method is only for reference Fields)
Field* scope( void ) Get 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 ) Serialize the current Field value to the specified buffer
void set( Struct * rec, Value * val ) Set the new Value of this Field
Table* set( void ) Get the Table this Field belongs to
Type type( void ) Get the Type of this Field
Value* update( Struct * rec ) Get the struct or array Value of this Field for update