The C++ Struct Class

The Struct class is provided for handling compound structure Values.

For an overview see page C++ Classes

Note that Struct inherits from Value, which implements many of its methods. The following list describes methods specialized for the Struct subclass:

int compare( Value * x )
Compares the current Value of this Struct with the argument x and returns an integer value indicating the result of the comparison: a negative integer value if this is less than x, zero if they are equal, and a positive integer value if this is greater than x.
Value * get( int index )
Gets the component of this Struct with the specified index.
int nComponents( void )
Gets the number of components in this Struct.
size_t serialize( char * buf , size_t & size )
Serializes the current Struct to the specified buffer.
void set( int index, Value * val )
Sets the new Value of the component of this Struct with the specified index.
Struct* source( void )
Gets a pointer to the underlying database Struct; this method may be used to distinguish tuples created by an SQL select statement from Struct and Record instances corresponding to database records.
size_t toString( char * buf , size_t & size )
Serializes the current Value to the specified buffer; only size bytes are copied (note that if the terminating null does not fit in size bytes, the resulting buffer will NOT be null-terminated).
Type type( void )
Gets the Value type.
Value * updateAt( int index )
Gets the structure or array element with the specified index for update; returns the Value of the component that will be updated.