DDS_DynamicType is an object that enhances CoreDX DDS with the facilities to process dynamic data types (in other words, data types that are not defined at compile time). More...
Related Functions | |
(Note that these are not member functions.) | |
DDS_TypeCodeKind | DDS_DynamicType_get_type (DDS_DynamicType t) |
Provides access to the 'type' of the DynamicType object. Applicable to any DynamicType. | |
unsigned char | DDS_DynamicType_get_octet (DDS_DynamicType t) |
Provides access to data held in an OCTET DynamicType object. | |
unsigned char | DDS_DynamicType_get_boolean (DDS_DynamicType t) |
Provides access to data held in an BOOLEAN DynamicType object. | |
char | DDS_DynamicType_get_char (DDS_DynamicType t) |
Provides access to data held in an CHAR DynamicType object. | |
int16_t | DDS_DynamicType_get_short (DDS_DynamicType t) |
Provides access to data held in an SHORT DynamicType object. | |
uint16_t | DDS_DynamicType_get_ushort (DDS_DynamicType t) |
Provides access to data held in an UNSIGNED SHORT DynamicType object. | |
int32_t | DDS_DynamicType_get_long (DDS_DynamicType t) |
Provides access to data held in an LONG DynamicType object. | |
uint32_t | DDS_DynamicType_get_ulong (DDS_DynamicType t) |
Provides access to data held in an UNSIGNED LONG DynamicType object. | |
int64_t | DDS_DynamicType_get_longlong (DDS_DynamicType t) |
Provides access to data held in an LONG LONG DynamicType object. | |
uint64_t | DDS_DynamicType_get_ulonglong (DDS_DynamicType t) |
Provides access to data held in an UNSIGNED LONG LONG DynamicType object. | |
float | DDS_DynamicType_get_float (DDS_DynamicType t) |
Provides access to data held in an FLOAT DynamicType object. | |
double | DDS_DynamicType_get_double (DDS_DynamicType t) |
Provides access to data held in an DOUBLE DynamicType object. | |
int32_t | DDS_DynamicType_enum_get_num_constants (DDS_DynamicType t) |
Provides access to the number of constants defined for this ENUM type. | |
void | DDS_DynamicType_EnumConstant_delete (DDS_DynamicType_EnumConstant_t *ec) |
Provides method to reclaim memory held by a DDS_DynamicType_EnumConstant_t. Use this to reclaim the memory returned by one of the following routines: DDS_DynamicType_enum_get_constant() DDS_DynamicType_enum_get_constant_by_name() DDS_DynamicType_enum_get_constant_by_value(). | |
DDS_DynamicType_EnumConstant_t * | DDS_DynamicType_enum_get_constant (DDS_DynamicType t, int32_t index) |
Provides access to a specific constant (name,value pair) within the ENUM type. | |
DDS_DynamicType_EnumConstant_t * | DDS_DynamicType_enum_get_constant_by_name (DDS_DynamicType t, const char *name) |
Provides access EnumConstant associated with an 'name' in the provided ENUM. | |
DDS_DynamicType_EnumConstant_t * | DDS_DynamicType_enum_get_constant_by_value (DDS_DynamicType t, uint32_t val) |
Provides access to the EnumConstant associated with a 'value' in the provided ENUM. | |
uint32_t | DDS_DynamicType_enum_get_value (DDS_DynamicType t) |
Provides access to the 'value' of an instance of type ENUM. | |
const char * | DDS_DynamicType_get_string (DDS_DynamicType t) |
Provides access to data held in an STRING DynamicType object. | |
uint32_t | DDS_DynamicType_get_max_length (DDS_DynamicType t) |
Provides access to the maximum length of a DynamicType object. | |
uint32_t | DDS_DynamicType_get_length (DDS_DynamicType t) |
Provides access to the length of data held in a DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_get_element_type (DDS_DynamicType t) |
Provides access to the type of the of data held in an ARRAY or SEQUENCE DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_get_element (DDS_DynamicType t, uint32_t n) |
Provides access to the a data element held in an ARRAY or SEQUENCE DynamicType object. | |
uint32_t | DDS_DynamicType_get_num_fields (DDS_DynamicType t) |
Provides access to the number of fields held by a STRUCT or UNION DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_get_field (DDS_DynamicType t, uint32_t n) |
Provides access to a field held by a STRUCT or UNION DynamicType object. | |
const char * | DDS_DynamicType_get_field_name (DDS_DynamicType t, uint32_t n) |
Provides access to the name of a field held by a STRUCT or UNION DynamicType object. | |
unsigned char | DDS_DynamicType_get_field_key (DDS_DynamicType t, uint32_t n) |
Provides access to the 'key' indication for a field held by a STRUCT DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_get_discriminator (DDS_DynamicType t) |
Provides access to the 'discriminator' type of a UNION DynamicType object. | |
int32_t | DDS_DynamicType_get_default_field (DDS_DynamicType t) |
Provides access to the 'default' field of a UNION DynamicType object. | |
uint32_t | DDS_DynamicType_get_field_num_labels (DDS_DynamicType t, uint32_t field) |
Provides access to the number of labels assigned to a field in the UNION DynamicType object. | |
int32_t | DDS_DynamicType_get_field_label (DDS_DynamicType t, uint32_t field, uint32_t label) |
Provides access to the number of labels assigned to a field in the UNION DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_get_selected_field (DDS_DynamicType t) |
Provides access to the selected field of a UNION DynamicType object. | |
DDS_DynamicType | DDS_DynamicType_alloc (DDS_TypeCodeKind type_code) |
Allocates and returns a DynamicType configured to hold the specified 'type_code' type. | |
DDS_DynamicType | DDS_DynamicType_alloc_basic (DDS_TypeCodeKind type_code) |
Allocates and returns a DynamicType configured to hold the specified 'type_code' basic type. | |
DDS_DynamicType | DDS_DynamicType_alloc_enum () |
Allocates and returns an ENUM DynamicType. | |
DDS_DynamicType | DDS_DynamicType_alloc_string () |
Allocates and returns a STRING DynamicType. | |
DDS_DynamicType | DDS_DynamicType_alloc_array () |
Allocates and returns an ARRAY DynamicType. | |
DDS_DynamicType | DDS_DynamicType_alloc_sequence () |
Allocates and returns a SEQUENCE DynamicType. | |
DDS_DynamicType | DDS_DynamicType_alloc_struct () |
Allocates and returns a STRUCT DynamicType. | |
DDS_DynamicType | DDS_DynamicType_alloc_union () |
Allocates and returns a UNION DynamicType. | |
void | DDS_DynamicType_free (DDS_DynamicType t) |
Reclaims all memory used by an allocated DynamicType object. | |
DDS_ReturnCode_t | DDS_DynamicType_set_octet (DDS_DynamicType t, unsigned char c) |
Assigns a value to the provided OCTET DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_boolean (DDS_DynamicType t, unsigned char c) |
Assigns a value to the provided BOOLEAN DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_char (DDS_DynamicType t, char c) |
Assigns a value to the provided CHAR DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_short (DDS_DynamicType t, short c) |
Assigns a value to the provided SHORT DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_ushort (DDS_DynamicType t, unsigned short c) |
Assigns a value to the provided USHORT DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_long (DDS_DynamicType t, long c) |
Assigns a value to the provided LONG DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_ulong (DDS_DynamicType t, unsigned long c) |
Assigns a value to the provided ULONG DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_longlong (DDS_DynamicType t, int64_t c) |
Assigns a value to the provided LONGLONG DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_ulonglong (DDS_DynamicType t, uint64_t c) |
Assigns a value to the provided ULONGLONG DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_float (DDS_DynamicType t, float c) |
Assigns a value to the provided FLOAT DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_double (DDS_DynamicType t, double c) |
Assigns a value to the provided DOUBLE DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_enum_set_num_constants (DDS_DynamicType t, int32_t num) |
Sets the number of constants defined by this ENUM type. | |
DDS_ReturnCode_t | DDS_DynamicType_enum_set_constant (DDS_DynamicType t, int32_t n, const char *name, uint32_t val) |
Assigns a 'name' to a 'value' in the provided ENUM DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_enum_set_value (DDS_DynamicType t, uint32_t val) |
Assigns a value to this instance of an ENUM. | |
DDS_ReturnCode_t | DDS_DynamicType_set_string (DDS_DynamicType t, const char *c) |
Assigns a value to the provided STRING DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_max_length (DDS_DynamicType t, uint32_t n) |
Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_length (DDS_DynamicType t, uint32_t n) |
Assigns a 'length' value to the provided ARRAY or SEQUENCE DynamicType. | |
DDS_ReturnCode_t | DDS_DynamicType_set_element_type (DDS_DynamicType t, DDS_DynamicType e) |
Defines the element type of an ARRAY or SEQUENCE. | |
DDS_ReturnCode_t | DDS_DynamicType_set_element (DDS_DynamicType t, uint32_t n, DDS_DynamicType e) |
Assigns a value to an element of an ARRAY or SEQUENCE. | |
DDS_ReturnCode_t | DDS_DynamicType_set_num_fields (DDS_DynamicType t, uint32_t n) |
Defines the number of fields held by a STRUCT or UNION DynamicType object. | |
DDS_ReturnCode_t | DDS_DynamicType_set_field (DDS_DynamicType t, uint32_t n, const char *field_name, DDS_DynamicType e, unsigned char key) |
Assigns a value to a field of a STRUCT or UNION DynamicType object. | |
DDS_ReturnCode_t | DDS_DynamicType_set_discriminator (DDS_DynamicType t, DDS_DynamicType d) |
Defines the type and value of the UNION discriminator. | |
DDS_ReturnCode_t | DDS_DynamicType_set_default_field (DDS_DynamicType t, int field) |
Defines the index of the default field within the UNION. | |
DDS_ReturnCode_t | DDS_DynamicType_set_field_num_labels (DDS_DynamicType t, uint32_t field, uint32_t n) |
Defines the number of labels associated with a field within the UNION. | |
DDS_ReturnCode_t | DDS_DynamicType_set_field_label (DDS_DynamicType t, uint32_t field, uint32_t label, int32_t val) |
Assigns a label to the specified field within the UNION. |
DDS_DynamicType is an object that enhances CoreDX DDS with the facilities to process dynamic data types (in other words, data types that are not defined at compile time).
The ability to process dynamic types adds significant flexibility to CoreDX DDS. The type information can be discovered at run-time, constructed programmatically, or based on existing type information. The DynamicType support allows the application to process a data type without compiling and linking type specific source code. For an application that must support a large number of data types, this can offer a savings in code size.
DDS_DynamicType DDS_DynamicType_alloc | ( | DDS_TypeCodeKind | type_code | ) | [related] |
Allocates and returns a DynamicType configured to hold the specified 'type_code' type.
This can be used to create a DynamicType for any of the the defined data types.
DDS_DynamicType DDS_DynamicType_alloc_array | ( | ) | [related] |
Allocates and returns an ARRAY DynamicType.
The type of the array elements must be specified by calling DDS_DynamicType_set_element_type(). The size of the array must be specified by calling DDS_DynamicType_set_max_length(). Before adding data to the array, memory for the elements must be allocated by calling DDS_DynamicType_set_length(). Data can be added to the array by calling DDS_DynamicType_set_element().
DDS_DynamicType DDS_DynamicType_alloc_basic | ( | DDS_TypeCodeKind | type_code | ) | [related] |
Allocates and returns a DynamicType configured to hold the specified 'type_code' basic type.
This can be used to create a DynamicType for the following data types: SHORT, LONG, LONGLONG, USHORT, ULONG, ULONGLONG, FLOAT, DOUBLE, BOOLEAN, CHAR, OCTET, or ENUM.
DDS_DynamicType DDS_DynamicType_alloc_enum | ( | ) | [related] |
Allocates and returns an ENUM DynamicType.
By default the enum has zero (name,value) pairs. DDS_DynamicType_enum_set_constant() is used to add (name, value) pairs to the ENUM. DDS_DynamicType_enum_get_constant_by_name() is useful for querying the 'value' associated with a specified 'name'. DDS_DynamicType_enum_get_constant_by_value() is useful for querying the 'name' associated with a specified 'value'. Use DDS_DynamicType_enum_set_value() to set the value of a specific ENUM instance.
DDS_DynamicType DDS_DynamicType_alloc_sequence | ( | ) | [related] |
Allocates and returns a SEQUENCE DynamicType.
The type of the sequence elements must be specified by calling DDS_DynamicType_set_element_type(). The size of the sequence must be specified by by calling DDS_DynamicType_set_max_length(). Before adding data to the sequence, memory for the elements must be allocated by calling DDS_DynamicType_set_length(). Data can be added to the sequence by calling DDS_DynamicType_set_element().
DDS_DynamicType DDS_DynamicType_alloc_string | ( | ) | [related] |
Allocates and returns a STRING DynamicType.
By default the string is unbounded. The length of the string may be bounded (if desired) by calling DDS_DynamicType_set_max_length().
DDS_DynamicType DDS_DynamicType_alloc_struct | ( | ) | [related] |
Allocates and returns a STRUCT DynamicType.
The DDS_DynamicType_set_num_fields() must be called to define the number of fields in the structure. For each field, DDS_DynamicType_set_field() must be used to define the type of the field.
DDS_DynamicType DDS_DynamicType_alloc_union | ( | ) | [related] |
Allocates and returns a UNION DynamicType.
The DDS_Dynamic_type_set_discriminator() function must be used to define the discriminator that is ued to select one of the union fields. The DDS_DynamicType_set_num_fields() must be called to define the number of fields in the union. For each field:
The DDS_DynamicType_set_default_field() function is used to (optionally) specify a field that is used as a 'default:' case.
DDS_DynamicType_EnumConstant_t * DDS_DynamicType_enum_get_constant | ( | DDS_DynamicType | t, | |
int32_t | index | |||
) | [related] |
Provides access to a specific constant (name,value pair) within the ENUM type.
An | allocated EnumConstant structure | |
NULL | if the 'name' is not found. |
DDS_DynamicType_EnumConstant_t * DDS_DynamicType_enum_get_constant_by_name | ( | DDS_DynamicType | t, | |
const char * | name | |||
) | [related] |
Provides access EnumConstant associated with an 'name' in the provided ENUM.
An | allocated EnumConstant structure | |
NULL | if the 'name' is not found. |
DDS_DynamicType_EnumConstant_t * DDS_DynamicType_enum_get_constant_by_value | ( | DDS_DynamicType | t, | |
uint32_t | val | |||
) | [related] |
Provides access to the EnumConstant associated with a 'value' in the provided ENUM.
An | allocated EnumConstant structure | |
NULL | if the 'value' is not found. |
int32_t DDS_DynamicType_enum_get_num_constants | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the number of constants defined for this ENUM type.
-1 | if the DynamicType is not of ENUM type. | |
number | of constants defined in this ENUM. |
DDS_ReturnCode_t DDS_DynamicType_enum_set_constant | ( | DDS_DynamicType | t, | |
int32_t | n, | |||
const char * | name, | |||
uint32_t | val | |||
) | [related] |
Assigns a 'name' to a 'value' in the provided ENUM DynamicType.
BAD_PARAMETER | if 't' is not of type ENUM. | |
BAD_PARAMETER | if a constant with 'name' already exists with a different 'val' | |
BAD_PARAMETER | if a constant with 'val' already exists with a different 'name' | |
OUT_OF_RESOURCES | if unable to add new value | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_enum_set_num_constants | ( | DDS_DynamicType | t, | |
int32_t | num | |||
) | [related] |
Sets the number of constants defined by this ENUM type.
BAD_PARAMETER | if 't' is not of type ENUM. | |
OUT_OF_RESOURCES | if unable to configure requested number of constants | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_enum_set_value | ( | DDS_DynamicType | t, | |
uint32_t | val | |||
) | [related] |
Assigns a value to this instance of an ENUM.
BAD_PARAMETER | if 't' is not of type ENUM. | |
OK | upon success. |
void DDS_DynamicType_free | ( | DDS_DynamicType | t | ) | [related] |
Reclaims all memory used by an allocated DynamicType object.
Call this routine to free memory associated with a DynamicType object created by one of the DDS_DynamicType_alloc_xxx() routines or by DDS_TypeDefinition_create_dynamictype(). This routines frees the type information as well as any data values contained in the DynamicType object.
unsigned char DDS_DynamicType_get_boolean | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an BOOLEAN DynamicType object.
unsigned_char | 0 indicates FALSE, non-zero indicates TRUE. |
char DDS_DynamicType_get_char | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an CHAR DynamicType object.
char | the data value held by 't'. |
int32_t DDS_DynamicType_get_default_field | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the 'default' field of a UNION DynamicType object.
This is applicable only for a UNION DynamicType object. This returns the index of the 'default' field in the UNION, if there is no field marked with a 'default:' case label.
int32_t | the index of the 'default' field. -1 if there is no defined 'default' case. |
DDS_DynamicType DDS_DynamicType_get_discriminator | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the 'discriminator' type of a UNION DynamicType object.
This is applicable only for a UNION DynamicType object. This returns the DynamicType that serves as a discriminator for the UNION data structure.
DDS_DynamicType | the discriminator data. |
double DDS_DynamicType_get_double | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an DOUBLE DynamicType object.
double | the data value held by 't'. |
DDS_DynamicType DDS_DynamicType_get_element | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
Provides access to the a data element held in an ARRAY or SEQUENCE DynamicType object.
This is applicable for a SEQUENCE or ARRAY DynamicType object. For a SEQUENCE, this returns the element 'n' of the sequence. For an ARRAY, this returns the element 'n' of the array elements. Elements are indexed starting at 0.
uint32_t | the data element held in the SEQUENCE or ARRAY 't' at index 'n'. |
DDS_DynamicType DDS_DynamicType_get_element_type | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the type of the of data held in an ARRAY or SEQUENCE DynamicType object.
This is applicable for a SEQUENCE or ARRAY DynamicType object. For a SEQUENCE, this returns the 'type' of the sequence elements. For an ARRAY, this returns the 'type' of the array elements.
uint32_t | the 'type' of the data value held in the SEQUENCE or ARRAY 't'. |
DDS_DynamicType DDS_DynamicType_get_field | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
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.
DDS_DynamicType | the number of data fields in the STRUCT or UNION 't'. |
unsigned char DDS_DynamicType_get_field_key | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
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. |
int32_t DDS_DynamicType_get_field_label | ( | DDS_DynamicType | t, | |
uint32_t | field, | |||
uint32_t | label | |||
) | [related] |
Provides access to the number of labels assigned to a field in the UNION DynamicType object.
This is applicable only for a UNION DynamicType object. This returns the count of the number of labels used to select a particular field in the UNION. The 'default:' label is not included in this count - as a result, it is possible for one field to have 'zero' labels.
int32_t | the value of the requested label of field identified by index 'field'. |
const char * DDS_DynamicType_get_field_name | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
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 DDS_DynamicType_get_field_num_labels | ( | DDS_DynamicType | t, | |
uint32_t | field | |||
) | [related] |
Provides access to the number of labels assigned to a field in the UNION DynamicType object.
This is applicable only for a UNION DynamicType object. This returns the count of the number of labels used to select a particular field in the UNION. The 'default:' label is not included in this count.
int32_t | the number of labels assigned to field identified by index 'field'. |
float DDS_DynamicType_get_float | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an FLOAT DynamicType object.
float | the data value held by 't'. |
uint32_t DDS_DynamicType_get_length | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the length of data held in a DynamicType object.
This is applicable for a SEQUENCE or ARRAY DynamicType object. For a SEQUENCE, this returns the 'length' of the sequence. For an ARRAY, this returns the size of the array.
uint32_t | the length of the data value held by 't'. |
int32_t DDS_DynamicType_get_long | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an LONG DynamicType object.
int32_t | the data value held by 't'. |
int64_t DDS_DynamicType_get_longlong | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an LONG LONG DynamicType object.
int64_t | the data value held by 't'. |
uint32_t DDS_DynamicType_get_max_length | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the maximum length of a DynamicType object.
This is applicable for a STRING, SEQUENCE, or ARRAY DynamicType object. For a STRING, this returns the 'fixed length' of the string, or zero if the string is not fixed length. For a SEQUENCE, this returns the 'fixed length' of the sequence, or zero if the sequence is unbounded. For an ARRAY, this returns the size of the array.
int32_t | the maximum length of the data value held by 't'. |
uint32_t DDS_DynamicType_get_num_fields | ( | DDS_DynamicType | t | ) | [related] |
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'. |
unsigned char DDS_DynamicType_get_octet | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an OCTET DynamicType object.
unsigned_char | the data value held by 't'. |
DDS_DynamicType DDS_DynamicType_get_selected_field | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the selected field of a UNION DynamicType object.
This is useful to access the field that is selected by the current value of the union's 'discriminator'.
int16_t DDS_DynamicType_get_short | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an SHORT DynamicType object.
int16_t | the data value held by 't'. |
const char * DDS_DynamicType_get_string | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an STRING DynamicType object.
const_char_* | the data value held by 't'. |
DDS_TypeCodeKind DDS_DynamicType_get_type | ( | DDS_DynamicType | t | ) | [related] |
Provides access to the 'type' of the DynamicType object. Applicable to any DynamicType.
DDS_TypeCodeKind | the type of object 't'. |
uint32_t DDS_DynamicType_get_ulong | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an UNSIGNED LONG DynamicType object.
uint32_t | the data value held by 't'. |
uint64_t DDS_DynamicType_get_ulonglong | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an UNSIGNED LONG LONG DynamicType object.
uint64_t | the data value held by 't'. |
uint16_t DDS_DynamicType_get_ushort | ( | DDS_DynamicType | t | ) | [related] |
Provides access to data held in an UNSIGNED SHORT DynamicType object.
uint16_t | the data value held by 't'. |
DDS_ReturnCode_t DDS_DynamicType_set_boolean | ( | DDS_DynamicType | t, | |
unsigned char | c | |||
) | [related] |
Assigns a value to the provided BOOLEAN DynamicType.
BAD_PARAMETER | if 't' is not of type BOOLEAN. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_char | ( | DDS_DynamicType | t, | |
char | c | |||
) | [related] |
Assigns a value to the provided CHAR DynamicType.
BAD_PARAMETER | if 't' is not of type CHAR. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_default_field | ( | DDS_DynamicType | t, | |
int | field | |||
) | [related] |
Defines the index of the default field within the UNION.
The active field in the UNION is selected by considering the value of the discriminator and the values of the field labels. Any value of the discriminator not explicitly listed in the labels will select the default field. The default field may have other labels assigned to it, or it may have zero labels.
BAD_PARAMETER | if 't' is not of type UNION. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_discriminator | ( | DDS_DynamicType | t, | |
DDS_DynamicType | d | |||
) | [related] |
Defines the type and value of the UNION discriminator.
The discriminator is used to identify which one of the UNION fields is active. Only one field within the UNION is active at a given time. The active field is selected by considering the value of the discriminator and the values of the field labels. Each field can have a set of labels containing zero or more unique discriminator values. Field labels are defined with the DDS_DynamicType_set_field_num_labels() and DDS_DynamicType_set_field_label() functions.
BAD_PARAMETER | if 't' is not of type UNION. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_double | ( | DDS_DynamicType | t, | |
double | c | |||
) | [related] |
Assigns a value to the provided DOUBLE DynamicType.
BAD_PARAMETER | if 't' is not of type DOUBLE. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_element | ( | DDS_DynamicType | t, | |
uint32_t | n, | |||
DDS_DynamicType | e | |||
) | [related] |
Assigns a value to an element of an ARRAY or SEQUENCE.
BAD_PARAMETER | if 't' is not of type ARRAY or SEQUENCE or if 'n' is beyond the specified length of the ARRAY or SEQUENCE. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_element_type | ( | DDS_DynamicType | t, | |
DDS_DynamicType | e | |||
) | [related] |
Defines the element type of an ARRAY or SEQUENCE.
BAD_PARAMETER | if 't' is not of type ARRAY or SEQUENCE. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_field | ( | DDS_DynamicType | t, | |
uint32_t | n, | |||
const char * | field_name, | |||
DDS_DynamicType | e, | |||
unsigned char | key | |||
) | [related] |
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 DDS_DynamicType_set_field_label | ( | DDS_DynamicType | t, | |
uint32_t | field, | |||
uint32_t | label, | |||
int32_t | val | |||
) | [related] |
Assigns a label to the specified field within the UNION.
BAD_PARAMETER | if 't' is not of type UNION or if field does not specify a valid field index, or if label does not specify a valid label index for the field. | |
OUT_OF_RESOURCES | if memory allocation fails. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_field_num_labels | ( | DDS_DynamicType | t, | |
uint32_t | field, | |||
uint32_t | n | |||
) | [related] |
Defines the number of labels associated with a field within the UNION.
Each field in a UNION has zero or more labels associated. The active field in the UNION is selected by considering the value of the discriminator and the values of the field labels. A field is selected when the value of the discriminator matches the value of one of its labels. Any value of the discriminator not explicitly listed in the all of the labels will select the default field. [The default field may have other labels assigned to it, or it may have zero labels.]
BAD_PARAMETER | if 't' is not of type UNION. | |
OUT_OF_RESOURCES | if memory allocation fails. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_float | ( | DDS_DynamicType | t, | |
float | c | |||
) | [related] |
Assigns a value to the provided FLOAT DynamicType.
BAD_PARAMETER | if 't' is not of type FLOAT. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_length | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
Assigns a 'length' value to the provided ARRAY or SEQUENCE DynamicType.
This defines the actual size of the array or sequence data. This will allocate memory to hold 'n' entries. The entries are not initialized, and must be initialized by calling DDS_DynamicType_set_element() 'n' times.
BAD_PARAMETER | if 't' is not of type ARRAY or SEQUENCE; OUT_OF_RESOURCES if memory allocation fails. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_long | ( | DDS_DynamicType | t, | |
long | c | |||
) | [related] |
Assigns a value to the provided LONG DynamicType.
BAD_PARAMETER | if 't' is not of type LONG. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_longlong | ( | DDS_DynamicType | t, | |
int64_t | c | |||
) | [related] |
Assigns a value to the provided LONGLONG DynamicType.
BAD_PARAMETER | if 't' is not of type LONGLONG. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_max_length | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType.
For STRINGS and SEQUENCES, this defines the bound on the string length or sequence length. For arrays, this defines the size of the array.
BAD_PARAMETER | if 't' is not of type STRING, ARRAY, or SEQUENCE. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_num_fields | ( | DDS_DynamicType | t, | |
uint32_t | n | |||
) | [related] |
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. |
DDS_ReturnCode_t DDS_DynamicType_set_octet | ( | DDS_DynamicType | t, | |
unsigned char | c | |||
) | [related] |
Assigns a value to the provided OCTET DynamicType.
BAD_PARAMETER | if 't' is not of type OCTET. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_short | ( | DDS_DynamicType | t, | |
short | c | |||
) | [related] |
Assigns a value to the provided SHORT DynamicType.
BAD_PARAMETER | if 't' is not of type SHORT. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_string | ( | DDS_DynamicType | t, | |
const char * | c | |||
) | [related] |
Assigns a value to the provided STRING DynamicType.
This routine will make a copy of the provided string data. If the STRING has a defined 'max_length', then the copied data will be truncated to 'max_length' characters. [A 0x00 (nul) character will be added after the truncated data.]
DDS_ReturnCode_t | BAD_PARAMETER if 't' is not of type STRING. | |
OUT_OF_RESOURCES | if memory allocation fails. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_ulong | ( | DDS_DynamicType | t, | |
unsigned long | c | |||
) | [related] |
Assigns a value to the provided ULONG DynamicType.
BAD_PARAMETER | if 't' is not of type ULONG. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_ulonglong | ( | DDS_DynamicType | t, | |
uint64_t | c | |||
) | [related] |
Assigns a value to the provided ULONGLONG DynamicType.
BAD_PARAMETER | if 't' is not of type ULONGLONG. | |
OK | upon success. |
DDS_ReturnCode_t DDS_DynamicType_set_ushort | ( | DDS_DynamicType | t, | |
unsigned short | c | |||
) | [related] |
Assigns a value to the provided USHORT DynamicType.
BAD_PARAMETER | if 't' is not of type USHORT. | |
OK | upon success. |