Represents a struct of members. Each member has an associated data type. More...
Public Member Functions | |
uint32_t | get_num_fields () |
Provides access to the number of fields held by a STRUCT or UNION DynamicType object. More... | |
DynamicType * | get_field (uint32_t n) |
Provides access to a field held by a STRUCT or UNION DynamicType object. More... | |
const char * | get_field_name (uint32_t n) |
Provides access to the name of a field held by a STRUCT or UNION DynamicType object. More... | |
unsigned char | get_field_key (uint32_t n) |
Provides access to the 'key' indication for a field held by a STRUCT DynamicType object. More... | |
DDS::ReturnCode_t | set_num_fields (uint32_t n) |
Defines the number of fields held by a STRUCT or UNION DynamicType object. More... | |
DDS::ReturnCode_t | set_field (uint32_t n, const char *field_name, DynamicType *e, unsigned char key) |
Assigns a value to a field of a STRUCT or UNION DynamicType object. More... | |
Public Member Functions inherited from CDX::DynamicType | |
virtual TypeCodeKind | get_type () |
Provides access to the 'type' of the DynamicType object. Applicable to any DynamicType. More... | |
Represents a struct of members. Each member has an associated data type.
DynamicType* CDX::StructDynamicType::get_field | ( | uint32_t | n | ) |
Provides access to a field held by a STRUCT or UNION DynamicType object.
This is applicable for a STRUCT or UNION DynamicType object. For a STRUCT or UNION, this returns a field held in the data structure.
DynamicType | the number of data fields in the STRUCT or UNION 't'. |
unsigned char CDX::StructDynamicType::get_field_key | ( | uint32_t | n | ) |
Provides access to the 'key' indication for a field held by a STRUCT DynamicType object.
This is applicable for a STRUCT DynamicType object. For a STRUCT, this returns an indication that field 'n' is (or is not) a key in the data structure.
unsigned_char | if non-zero, the field at index 'n' is a key field. if zero, the field at index 'n' is not a key field. |
const char* CDX::StructDynamicType::get_field_name | ( | uint32_t | n | ) |
Provides access to the name of a field held by a STRUCT or UNION DynamicType object.
This is applicable for a STRUCT or UNION DynamicType object. For a STRUCT or UNION, this returns the name of a field held in the data structure.
const_char_* | field name of field 'n' in STRUCT or UNION 't'. |
uint32_t CDX::StructDynamicType::get_num_fields | ( | ) |
Provides access to the number of fields held by a STRUCT or UNION DynamicType object.
This is applicable for a STRUCT or UNION DynamicType object. For a STRUCT, this returns the number of fields held in the structure. For a UNION, this returns the number of fields contained by the UNION where a field is selectable by one or more case labels.
uint32_t | the number of data fields in the STRUCT or UNION 't'. |
DDS::ReturnCode_t CDX::StructDynamicType::set_field | ( | uint32_t | n, |
const char * | field_name, | ||
DynamicType * | e, | ||
unsigned char | key | ||
) |
Assigns a value to a field of a STRUCT or UNION DynamicType object.
The 'nth' field of the struct or union is assigned the provided field_name, type e. The key parameter is used only for STRUCT types. If key is non-zero, then the field is added to the 'key set' for this data type. This routine makes a copy of the 'field_name' argument.
BAD_PARAMETER | if 't' is not of type STRUCT or UNION. |
OUT_OF_MEMORY | if memory allocation (to hold a copy of field_name) fails. |
OK | upon success. |
DDS::ReturnCode_t CDX::StructDynamicType::set_num_fields | ( | uint32_t | n | ) |
Defines the number of fields held by a STRUCT or UNION DynamicType object.
BAD_PARAMETER | if 't' is not of type STRUCT or UNION. |
OK | upon success. |