# 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 table describes methods specialized for the Struct subclass:

in compare( Value * x ) | Compare the current Value of this Struct with the argument `x` and return 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 ) | Get the component of this Struct with the specified index
int nComponents( void ) | Get the number of components in this Struct
size_t serialize( char * buf , size_t & size ) | Serialize the current Struct to the specified buffer
void set( int index, Value * val ) | Set the new Value of the component of this Struct with the specified index
Struct* source( void ) | Get 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 ) | Serialize 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 ) | Get the Value type
Value * updateAt( int index ) | Get the structure or array element with the specified index for update; returns the Value of the component that will be updated