CoreDX DDS C Reference Manual
Related Functions | List of all members
CDX_DynamicType Struct Reference

CDX_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 CDX_DynamicType_get_type (CDX_DynamicType t)
 Provides access to the 'type' of the DynamicType object. Applicable to any DynamicType. More...
 
unsigned char CDX_DynamicType_get_octet (CDX_DynamicType t)
 Provides access to data held in an OCTET DynamicType object. More...
 
unsigned char CDX_DynamicType_get_boolean (CDX_DynamicType t)
 Provides access to data held in an BOOLEAN DynamicType object. More...
 
char CDX_DynamicType_get_char (CDX_DynamicType t)
 Provides access to data held in an CHAR DynamicType object. More...
 
int16_t CDX_DynamicType_get_short (CDX_DynamicType t)
 Provides access to data held in an SHORT DynamicType object. More...
 
uint16_t CDX_DynamicType_get_ushort (CDX_DynamicType t)
 Provides access to data held in an UNSIGNED SHORT DynamicType object. More...
 
int32_t CDX_DynamicType_get_long (CDX_DynamicType t)
 Provides access to data held in an LONG DynamicType object. More...
 
uint32_t CDX_DynamicType_get_ulong (CDX_DynamicType t)
 Provides access to data held in an UNSIGNED LONG DynamicType object. More...
 
int64_t CDX_DynamicType_get_longlong (CDX_DynamicType t)
 Provides access to data held in an LONG LONG DynamicType object. More...
 
uint64_t CDX_DynamicType_get_ulonglong (CDX_DynamicType t)
 Provides access to data held in an UNSIGNED LONG LONG DynamicType object. More...
 
float CDX_DynamicType_get_float (CDX_DynamicType t)
 Provides access to data held in an FLOAT DynamicType object. More...
 
double CDX_DynamicType_get_double (CDX_DynamicType t)
 Provides access to data held in an DOUBLE DynamicType object. More...
 
int32_t CDX_DynamicType_enum_get_size (CDX_DynamicType t)
 Gets the 'size' of this ENUM type in bytes (either 4 bytes or 2 bytes). More...
 
int32_t CDX_DynamicType_enum_get_num_constants (CDX_DynamicType t)
 Provides access to the number of constants defined for this ENUM type. More...
 
void CDX_DynamicType_EnumConstant_delete (CDX_DynamicType_EnumConstant_t *ec)
 Provides method to reclaim memory held by a CDX_DynamicType_EnumConstant_t. Use this to reclaim the memory returned by one of the following routines: CDX_DynamicType_enum_get_constant() CDX_DynamicType_enum_get_constant_by_name() CDX_DynamicType_enum_get_constant_by_value()
 
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant (CDX_DynamicType t, int32_t index)
 Provides access to a specific constant (name,value pair) within the ENUM type. More...
 
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant_by_name (CDX_DynamicType t, const char *name)
 Provides access EnumConstant associated with an 'name' in the provided ENUM. More...
 
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant_by_value (CDX_DynamicType t, uint32_t val)
 Provides access to the EnumConstant associated with a 'value' in the provided ENUM. More...
 
uint32_t CDX_DynamicType_enum_get_value (CDX_DynamicType t)
 Provides access to the 'value' of an instance of type ENUM.
 
int32_t CDX_DynamicType_bitset_get_size (CDX_DynamicType t)
 Gets the 'size' of this BITSET type in bytes (either 8, 4, 2, or 1 bytes) More...
 
uint64_t CDX_DynamicType_bitset_get_value (CDX_DynamicType t)
 Provides access to the 'value' of an instance of type BITSET.
 
int32_t CDX_DynamicType_bitset_get_num_flags (CDX_DynamicType t)
 Provides access to the number of flags defined for this BITSET type. More...
 
void CDX_DynamicType_BitsetFlag_delete (CDX_DynamicType_BitsetFlag_t *bf)
 Provides method to reclaim memory held by a CDX_DynamicType_BitsetFlag_t. Use this to reclaim the memory returned by one of the following routines: CDX_DynamicType_bitset_get_flag() CDX_DynamicType_bitset_get_flag_by_name()
 
CDX_DynamicType_BitsetFlag_t * CDX_DynamicType_bitset_get_flag (CDX_DynamicType t, int32_t index)
 Provides access to a specific flag (name,value pair) within the BITSET type. More...
 
CDX_DynamicType_BitsetFlag_t * CDX_DynamicType_bitset_get_flag_by_name (CDX_DynamicType t, const char *name)
 Provides access BitsetFlag associated with an 'name' in the provided BITSET. More...
 
const char * CDX_DynamicType_get_string (CDX_DynamicType t)
 Provides access to data held in an STRING DynamicType object. More...
 
uint32_t CDX_DynamicType_get_max_length (CDX_DynamicType t)
 Provides access to the maximum length of a DynamicType object. More...
 
uint32_t CDX_DynamicType_get_length (CDX_DynamicType t)
 Provides access to the length of data held in a DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_get_element_type (CDX_DynamicType t)
 Provides access to the type of the of data held in an ARRAY or SEQUENCE DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_get_element (CDX_DynamicType t, uint32_t n)
 Provides access to the a data element held in an ARRAY or SEQUENCE DynamicType object. More...
 
uint32_t CDX_DynamicType_get_num_fields (CDX_DynamicType t)
 Provides access to the number of fields held by a STRUCT or UNION DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_get_field (CDX_DynamicType t, uint32_t n)
 Provides access to a field held by a STRUCT or UNION DynamicType object. More...
 
const char * CDX_DynamicType_get_field_name (CDX_DynamicType t, uint32_t n)
 Provides access to the name of a field held by a STRUCT or UNION DynamicType object. More...
 
unsigned char CDX_DynamicType_get_field_key (CDX_DynamicType t, uint32_t n)
 Provides access to the 'key' indication for a field held by a STRUCT DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_get_discriminator (CDX_DynamicType t)
 Provides access to the 'discriminator' type of a UNION DynamicType object. More...
 
int32_t CDX_DynamicType_get_default_field (CDX_DynamicType t)
 Provides access to the 'default' field of a UNION DynamicType object. More...
 
uint32_t CDX_DynamicType_get_field_num_labels (CDX_DynamicType t, uint32_t field)
 Provides access to the number of labels assigned to a field in the UNION DynamicType object. More...
 
int32_t CDX_DynamicType_get_field_label (CDX_DynamicType t, uint32_t field, uint32_t label_idx)
 Provides access to a label value assigned to a field in the UNION DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_get_selected_field (CDX_DynamicType t)
 Provides access to the selected field of a UNION DynamicType object. More...
 
CDX_DynamicType CDX_DynamicType_alloc (DDS_TypeCodeKind type_code)
 Allocates and returns a DynamicType configured to hold the specified 'type_code' type. More...
 
CDX_DynamicType CDX_DynamicType_alloc_basic (DDS_TypeCodeKind type_code)
 Allocates and returns a DynamicType configured to hold the specified 'type_code' basic type. More...
 
CDX_DynamicType CDX_DynamicType_alloc_enum ()
 Allocates and returns an ENUM DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_bitset ()
 Allocates and returns a BITSET DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_string ()
 Allocates and returns a STRING DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_array ()
 Allocates and returns an ARRAY DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_sequence ()
 Allocates and returns a SEQUENCE DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_struct ()
 Allocates and returns a STRUCT DynamicType. More...
 
CDX_DynamicType CDX_DynamicType_alloc_union ()
 Allocates and returns a UNION DynamicType. More...
 
void CDX_DynamicType_free (CDX_DynamicType t)
 Reclaims all memory used by an allocated DynamicType object. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_octet (CDX_DynamicType t, unsigned char c)
 Assigns a value to the provided OCTET DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_boolean (CDX_DynamicType t, unsigned char c)
 Assigns a value to the provided BOOLEAN DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_char (CDX_DynamicType t, char c)
 Assigns a value to the provided CHAR DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_short (CDX_DynamicType t, short c)
 Assigns a value to the provided SHORT DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_ushort (CDX_DynamicType t, unsigned short c)
 Assigns a value to the provided USHORT DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_long (CDX_DynamicType t, long c)
 Assigns a value to the provided LONG DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_ulong (CDX_DynamicType t, unsigned long c)
 Assigns a value to the provided ULONG DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_longlong (CDX_DynamicType t, int64_t c)
 Assigns a value to the provided LONGLONG DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_ulonglong (CDX_DynamicType t, uint64_t c)
 Assigns a value to the provided ULONGLONG DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_float (CDX_DynamicType t, float c)
 Assigns a value to the provided FLOAT DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_double (CDX_DynamicType t, double c)
 Assigns a value to the provided DOUBLE DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_enum_set_size (CDX_DynamicType t, int32_t size)
 Sets the 'size' of this ENUM type in bytes (either 4 bytes or 2 bytes). More...
 
DDS_ReturnCode_t CDX_DynamicType_enum_set_num_constants (CDX_DynamicType t, int32_t num)
 Sets the number of constants defined by this ENUM type. More...
 
DDS_ReturnCode_t CDX_DynamicType_enum_set_constant (CDX_DynamicType t, int32_t n, const char *name, uint32_t val)
 Assigns a 'name' to a 'value' in the provided ENUM DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_enum_set_value (CDX_DynamicType t, uint32_t val)
 Assigns a value to this instance of an ENUM. More...
 
DDS_ReturnCode_t CDX_DynamicType_bitset_set_size (CDX_DynamicType t, int32_t size)
 Sets the 'size' of this BITSET type in bytes (either 8, 4, 2, or 1 bytes). More...
 
DDS_ReturnCode_t CDX_DynamicType_bitset_set_num_flags (CDX_DynamicType t, int32_t num)
 Sets the number of flags defined by this BITSET type. More...
 
DDS_ReturnCode_t CDX_DynamicType_bitset_set_flag (CDX_DynamicType t, int32_t n, const char *name, uint64_t val)
 Assigns a 'name' to a 'value' in the provided BITSET DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_bitset_set_value (CDX_DynamicType t, uint64_t val)
 Assigns a value to this instance of an BITSET. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_string (CDX_DynamicType t, const char *c)
 Assigns a value to the provided STRING DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_max_length (CDX_DynamicType t, uint32_t n)
 Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_length (CDX_DynamicType t, uint32_t n)
 Assigns a 'length' value to the provided ARRAY or SEQUENCE DynamicType. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_element_type (CDX_DynamicType t, CDX_DynamicType e)
 Defines the element type of an ARRAY or SEQUENCE. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_element (CDX_DynamicType t, uint32_t n, CDX_DynamicType e)
 Assigns a value to an element of an ARRAY or SEQUENCE. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_num_fields (CDX_DynamicType t, uint32_t n)
 Defines the number of fields held by a STRUCT or UNION DynamicType object. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_field (CDX_DynamicType t, uint32_t n, const char *field_name, CDX_DynamicType e, unsigned char key)
 Assigns a value to a field of a STRUCT or UNION DynamicType object. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_discriminator (CDX_DynamicType t, CDX_DynamicType d)
 Defines the type and value of the UNION discriminator. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_default_field (CDX_DynamicType t, int field)
 Defines the index of the default field within the UNION. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_field_num_labels (CDX_DynamicType t, uint32_t field, uint32_t n)
 Defines the number of labels associated with a field within the UNION. More...
 
DDS_ReturnCode_t CDX_DynamicType_set_field_label (CDX_DynamicType t, uint32_t field, uint32_t label, int32_t val)
 Assigns a label to the specified field within the UNION. More...
 

Detailed Description

CDX_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.

Friends And Related Function Documentation

CDX_DynamicType CDX_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.

CDX_DynamicType CDX_DynamicType_alloc_array ( )
related

Allocates and returns an ARRAY DynamicType.

The type of the array elements must be specified by calling CDX_DynamicType_set_element_type(). The size of the array must be specified by calling CDX_DynamicType_set_max_length(). Before adding data to the array, memory for the elements must be allocated by calling CDX_DynamicType_set_length(). Data can be added to the array by calling CDX_DynamicType_set_element().

CDX_DynamicType CDX_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, or OCTET.

CDX_DynamicType CDX_DynamicType_alloc_bitset ( )
related

Allocates and returns a BITSET DynamicType.

By default the bitset has zero flags defined (that is, [name,value] pairs). CDX_DynamicType_bitset_set_flag() is used to add (name, value) pairs to the BITSET. CDX_DynamicType_bitset_get_flag_by_name() is useful for querying the 'value' associated with a specified 'name'. Use CDX_DynamicType_bitset_set_value() to set the value of a specific BITSET instance. This creates an BITSET with a default BitBound of 32 bits (4 bytes).

CDX_DynamicType CDX_DynamicType_alloc_enum ( )
related

Allocates and returns an ENUM DynamicType.

By default the enum has zero (name,value) pairs. CDX_DynamicType_enum_set_constant() is used to add (name, value) pairs to the ENUM. CDX_DynamicType_enum_get_constant_by_name() is useful for querying the 'value' associated with a specified 'name'. CDX_DynamicType_enum_get_constant_by_value() is useful for querying the 'name' associated with a specified 'value'. Use CDX_DynamicType_enum_set_value() to set the value of a specific ENUM instance. This creates an enum with a default size of 32 bits (4 bytes). Use CDX_DynamicType_set_enum_size() to change the 'size' of this ENUM type.

CDX_DynamicType CDX_DynamicType_alloc_sequence ( )
related

Allocates and returns a SEQUENCE DynamicType.

The type of the sequence elements must be specified by calling CDX_DynamicType_set_element_type(). The size of the sequence must be specified by by calling CDX_DynamicType_set_max_length(). Before adding data to the sequence, memory for the elements must be allocated by calling CDX_DynamicType_set_length(). Data can be added to the sequence by calling CDX_DynamicType_set_element().

CDX_DynamicType CDX_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 CDX_DynamicType_set_max_length().

CDX_DynamicType CDX_DynamicType_alloc_struct ( )
related

Allocates and returns a STRUCT DynamicType.

The CDX_DynamicType_set_num_fields() must be called to define the number of fields in the structure. For each field, CDX_DynamicType_set_field() must be used to define the type of the field.

CDX_DynamicType CDX_DynamicType_alloc_union ( )
related

Allocates and returns a UNION DynamicType.

The CDX_DynamicType_set_discriminator() function must be used to define the discriminator that is ued to select one of the union fields. The CDX_DynamicType_set_num_fields() must be called to define the number of fields in the union. For each field:

  1. CDX_DynamicType_set_field() must be used to define the type of the field.
  2. The CDX_DynamicType_field_num_labels() function must be used to define the number of case labels (discriminator values) that select this field. (For a 'default:' only field, the number can be zero.)
  3. The CDX_DynamicType_set_field_label() function must be used to define a specific case label for the field.

The CDX_DynamicType_set_default_field() function is used to (optionally) specify a field that is used as a 'default:' case.

CDX_DynamicType_BitsetFlag_t * CDX_DynamicType_bitset_get_flag ( CDX_DynamicType  t,
int32_t  index 
)
related

Provides access to a specific flag (name,value pair) within the BITSET type.

Note
Caller is responsible for freeing the returned pointer with CDX_DynamicType_BitsetFlag_delete().
Return values
Anallocated BitsetFlag structure
NULLif the 'name' is not found.
CDX_DynamicType_BitsetFlag_t * CDX_DynamicType_bitset_get_flag_by_name ( CDX_DynamicType  t,
const char *  name 
)
related

Provides access BitsetFlag associated with an 'name' in the provided BITSET.

Note
Caller is responsible for freeing the returned pointer with CDX_DynamicType_BitsetFlag_delete().
Return values
Anallocated BitsetFlag structure
NULLif the 'name' is not found.
int32_t CDX_DynamicType_bitset_get_num_flags ( CDX_DynamicType  t)
related

Provides access to the number of flags defined for this BITSET type.

Return values
-1if the DynamicType is not of BITSET type.
numberof flags defined in this BITSET.
int32_t CDX_DynamicType_bitset_get_size ( CDX_DynamicType  t)
related

Gets the 'size' of this BITSET type in bytes (either 8, 4, 2, or 1 bytes)

Return values
-1if the DynamicType is not of type BITSET.
numberof bytes used to represent this BITSET type.
DDS_ReturnCode_t CDX_DynamicType_bitset_set_flag ( CDX_DynamicType  t,
int32_t  n,
const char *  name,
uint64_t  val 
)
related

Assigns a 'name' to a 'value' in the provided BITSET DynamicType.

Return values
BAD_PARAMETERif 't' is not of type BITSET.
BAD_PARAMETERif a flag with 'name' already exists with a different 'val'
OUT_OF_RESOURCESif unable to add new flag
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_bitset_set_num_flags ( CDX_DynamicType  t,
int32_t  num 
)
related

Sets the number of flags defined by this BITSET type.

Return values
BAD_PARAMETERif 't' is not of type BITSET.
OUT_OF_RESOURCESif unable to configure requested number of flags.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_bitset_set_size ( CDX_DynamicType  t,
int32_t  size 
)
related

Sets the 'size' of this BITSET type in bytes (either 8, 4, 2, or 1 bytes).

Return values
BAD_PARAMETERif 't' is not of type BITSET, or size is not one of 8, 4, 2, or 1.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_bitset_set_value ( CDX_DynamicType  t,
uint64_t  val 
)
related

Assigns a value to this instance of an BITSET.

Return values
BAD_PARAMETERif 't' is not of type BITSET, or if 'val' requires more bits than supported by this BITSET.
OKupon success.
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant ( CDX_DynamicType  t,
int32_t  index 
)
related

Provides access to a specific constant (name,value pair) within the ENUM type.

Note
Caller is responsible for freeing the returned pointer with CDX_DynamicType_EnumConstant_delete().
Return values
Anallocated EnumConstant structure
NULLif the 'name' is not found.
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant_by_name ( CDX_DynamicType  t,
const char *  name 
)
related

Provides access EnumConstant associated with an 'name' in the provided ENUM.

Note
Caller is responsible for freeing the returned pointer with CDX_DynamicType_EnumConstant_delete().
Return values
Anallocated EnumConstant structure
NULLif the 'name' is not found.
CDX_DynamicType_EnumConstant_t * CDX_DynamicType_enum_get_constant_by_value ( CDX_DynamicType  t,
uint32_t  val 
)
related

Provides access to the EnumConstant associated with a 'value' in the provided ENUM.

Note
Caller is responsible for freeing the returned pointer with CDX_DynamicType_EnumConstant_delete().
Return values
Anallocated EnumConstant structure
NULLif the 'value' is not found.
int32_t CDX_DynamicType_enum_get_num_constants ( CDX_DynamicType  t)
related

Provides access to the number of constants defined for this ENUM type.

Return values
-1if the DynamicType is not of ENUM type.
numberof constants defined in this ENUM.
int32_t CDX_DynamicType_enum_get_size ( CDX_DynamicType  t)
related

Gets the 'size' of this ENUM type in bytes (either 4 bytes or 2 bytes).

Return values
-1if the DynamicType is not of type ENUM.
numberof bytes used to represent this ENUM type.
DDS_ReturnCode_t CDX_DynamicType_enum_set_constant ( CDX_DynamicType  t,
int32_t  n,
const char *  name,
uint32_t  val 
)
related

Assigns a 'name' to a 'value' in the provided ENUM DynamicType.

Return values
BAD_PARAMETERif 't' is not of type ENUM.
BAD_PARAMETERif a constant with 'name' already exists with a different 'val'
BAD_PARAMETERif a constant with 'val' already exists with a different 'name'
OUT_OF_RESOURCESif unable to add new value
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_enum_set_num_constants ( CDX_DynamicType  t,
int32_t  num 
)
related

Sets the number of constants defined by this ENUM type.

Return values
BAD_PARAMETERif 't' is not of type ENUM.
OUT_OF_RESOURCESif unable to configure requested number of constants
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_enum_set_size ( CDX_DynamicType  t,
int32_t  size 
)
related

Sets the 'size' of this ENUM type in bytes (either 4 bytes or 2 bytes).

Return values
BAD_PARAMETERif 't' is not of type ENUM, or size is not 4 or 2.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_enum_set_value ( CDX_DynamicType  t,
uint32_t  val 
)
related

Assigns a value to this instance of an ENUM.

Return values
BAD_PARAMETERif 't' is not of type ENUM.
OKupon success.
void CDX_DynamicType_free ( CDX_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 CDX_DynamicType_alloc_xxx() routines or by CDX_TypeDefinition_create_dynamictype(). This routines frees the type information as well as any data values contained in the DynamicType object.

unsigned char CDX_DynamicType_get_boolean ( CDX_DynamicType  t)
related

Provides access to data held in an BOOLEAN DynamicType object.

Return values
unsigned_char0 indicates FALSE, non-zero indicates TRUE.
char CDX_DynamicType_get_char ( CDX_DynamicType  t)
related

Provides access to data held in an CHAR DynamicType object.

Return values
charthe data value held by 't'.
int32_t CDX_DynamicType_get_default_field ( CDX_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.

Return values
int32_tthe index of the 'default' field. -1 if there is no defined 'default' case.
CDX_DynamicType CDX_DynamicType_get_discriminator ( CDX_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.

Return values
CDX_DynamicTypethe discriminator data.
double CDX_DynamicType_get_double ( CDX_DynamicType  t)
related

Provides access to data held in an DOUBLE DynamicType object.

Return values
doublethe data value held by 't'.
CDX_DynamicType CDX_DynamicType_get_element ( CDX_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.

Return values
uint32_tthe data element held in the SEQUENCE or ARRAY 't' at index 'n'.
CDX_DynamicType CDX_DynamicType_get_element_type ( CDX_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.

Return values
uint32_tthe 'type' of the data value held in the SEQUENCE or ARRAY 't'.
CDX_DynamicType CDX_DynamicType_get_field ( CDX_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.

Return values
CDX_DynamicTypethe number of data fields in the STRUCT or UNION 't'.
unsigned char CDX_DynamicType_get_field_key ( CDX_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.

Return values
unsigned_charif 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 CDX_DynamicType_get_field_label ( CDX_DynamicType  t,
uint32_t  field,
uint32_t  label_idx 
)
related

Provides access to a label value assigned to a field in the UNION DynamicType object.

This is applicable only for a UNION DynamicType object. This the value of the indicated label associated with a particular field in the UNION. [The 'default:' label is not included in these values - as a result, it is possible for one field to have 'zero' labels.]

Return values
int32_t: the value of the requested label identified by label_idx, of field identified by index 'field'.
const char * CDX_DynamicType_get_field_name ( CDX_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.

Return values
const_char_*field name of field 'n' in STRUCT or UNION 't'.
uint32_t CDX_DynamicType_get_field_num_labels ( CDX_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.

Return values
int32_tthe number of labels assigned to field identified by index 'field'.
float CDX_DynamicType_get_float ( CDX_DynamicType  t)
related

Provides access to data held in an FLOAT DynamicType object.

Return values
floatthe data value held by 't'.
uint32_t CDX_DynamicType_get_length ( CDX_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.

Return values
uint32_tthe length of the data value held by 't'.
int32_t CDX_DynamicType_get_long ( CDX_DynamicType  t)
related

Provides access to data held in an LONG DynamicType object.

Return values
int32_tthe data value held by 't'.
int64_t CDX_DynamicType_get_longlong ( CDX_DynamicType  t)
related

Provides access to data held in an LONG LONG DynamicType object.

Return values
int64_tthe data value held by 't'.
uint32_t CDX_DynamicType_get_max_length ( CDX_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.

Return values
int32_tthe maximum length of the data value held by 't'.
uint32_t CDX_DynamicType_get_num_fields ( CDX_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.

Return values
uint32_tthe number of data fields in the STRUCT or UNION 't'.
unsigned char CDX_DynamicType_get_octet ( CDX_DynamicType  t)
related

Provides access to data held in an OCTET DynamicType object.

Return values
unsigned_charthe data value held by 't'.
CDX_DynamicType CDX_DynamicType_get_selected_field ( CDX_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 CDX_DynamicType_get_short ( CDX_DynamicType  t)
related

Provides access to data held in an SHORT DynamicType object.

Return values
int16_tthe data value held by 't'.
const char * CDX_DynamicType_get_string ( CDX_DynamicType  t)
related

Provides access to data held in an STRING DynamicType object.

Return values
const_char_*the data value held by 't'.
DDS_TypeCodeKind CDX_DynamicType_get_type ( CDX_DynamicType  t)
related

Provides access to the 'type' of the DynamicType object. Applicable to any DynamicType.

Return values
DDS_TypeCodeKindthe type of object 't'.
uint32_t CDX_DynamicType_get_ulong ( CDX_DynamicType  t)
related

Provides access to data held in an UNSIGNED LONG DynamicType object.

Return values
uint32_tthe data value held by 't'.
uint64_t CDX_DynamicType_get_ulonglong ( CDX_DynamicType  t)
related

Provides access to data held in an UNSIGNED LONG LONG DynamicType object.

Return values
uint64_tthe data value held by 't'.
uint16_t CDX_DynamicType_get_ushort ( CDX_DynamicType  t)
related

Provides access to data held in an UNSIGNED SHORT DynamicType object.

Return values
uint16_tthe data value held by 't'.
DDS_ReturnCode_t CDX_DynamicType_set_boolean ( CDX_DynamicType  t,
unsigned char  c 
)
related

Assigns a value to the provided BOOLEAN DynamicType.

Return values
BAD_PARAMETERif 't' is not of type BOOLEAN.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_char ( CDX_DynamicType  t,
char  c 
)
related

Assigns a value to the provided CHAR DynamicType.

Return values
BAD_PARAMETERif 't' is not of type CHAR.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_default_field ( CDX_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.

Note
An index value of -1 indicates that the UNION has no default field.
Return values
BAD_PARAMETERif 't' is not of type UNION.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_discriminator ( CDX_DynamicType  t,
CDX_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 CDX_DynamicType_set_field_num_labels() and CDX_DynamicType_set_field_label() functions.

Note
The UNION takes ownership of the provided discriminator.
One field in the union can be designated as the 'default' field. 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.
Return values
BAD_PARAMETERif 't' is not of type UNION.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_double ( CDX_DynamicType  t,
double  c 
)
related

Assigns a value to the provided DOUBLE DynamicType.

Return values
BAD_PARAMETERif 't' is not of type DOUBLE.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_element ( CDX_DynamicType  t,
uint32_t  n,
CDX_DynamicType  e 
)
related

Assigns a value to an element of an ARRAY or SEQUENCE.

Note
The ARRAY or SEQUENCE takes ownership of the provided field.
Return values
BAD_PARAMETERif 't' is not of type ARRAY or SEQUENCE or if 'n' is beyond the specified length of the ARRAY or SEQUENCE.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_element_type ( CDX_DynamicType  t,
CDX_DynamicType  e 
)
related

Defines the element type of an ARRAY or SEQUENCE.

Return values
BAD_PARAMETERif 't' is not of type ARRAY or SEQUENCE.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_field ( CDX_DynamicType  t,
uint32_t  n,
const char *  field_name,
CDX_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.

Note
The STRUCT or UNION takes ownership of the provided field.
Fields of a UNION data type can not be part of a 'key set', as the field may not exist in a particular instantiation of the union data type.
Return values
BAD_PARAMETERif 't' is not of type STRUCT or UNION.
OUT_OF_MEMORYif memory allocation (to hold a copy of field_name) fails.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_field_label ( CDX_DynamicType  t,
uint32_t  field,
uint32_t  label,
int32_t  val 
)
related

Assigns a label to the specified field within the UNION.

Return values
BAD_PARAMETERif '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_RESOURCESif memory allocation fails.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_field_num_labels ( CDX_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.]

Note
Subsequent calls to this routine for the same field will clear any previously assigned labels. [The default field may have other labels assigned to it, or it may have zero labels.]
Return values
BAD_PARAMETERif 't' is not of type UNION.
OUT_OF_RESOURCESif memory allocation fails.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_float ( CDX_DynamicType  t,
float  c 
)
related

Assigns a value to the provided FLOAT DynamicType.

Return values
BAD_PARAMETERif 't' is not of type FLOAT.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_length ( CDX_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 CDX_DynamicType_set_element() 'n' times.

Note
If CDX_DynamicType_set_length() has been called previously on object 't', the subsequent calls to this routine will deallocate the storate for the previous array or sequence elements. However, the elements themselves will not be freed. To avoid a memory leak, it is necessary to manually free each element before calling set_length().
Return values
BAD_PARAMETERif 't' is not of type ARRAY or SEQUENCE; OUT_OF_RESOURCES if memory allocation fails.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_long ( CDX_DynamicType  t,
long  c 
)
related

Assigns a value to the provided LONG DynamicType.

Return values
BAD_PARAMETERif 't' is not of type LONG.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_longlong ( CDX_DynamicType  t,
int64_t  c 
)
related

Assigns a value to the provided LONGLONG DynamicType.

Return values
BAD_PARAMETERif 't' is not of type LONGLONG.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_max_length ( CDX_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.

Return values
BAD_PARAMETERif 't' is not of type STRING, ARRAY, or SEQUENCE.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_num_fields ( CDX_DynamicType  t,
uint32_t  n 
)
related

Defines the number of fields held by a STRUCT or UNION DynamicType object.

Return values
BAD_PARAMETERif 't' is not of type STRUCT or UNION.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_octet ( CDX_DynamicType  t,
unsigned char  c 
)
related

Assigns a value to the provided OCTET DynamicType.

Return values
BAD_PARAMETERif 't' is not of type OCTET.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_short ( CDX_DynamicType  t,
short  c 
)
related

Assigns a value to the provided SHORT DynamicType.

Return values
BAD_PARAMETERif 't' is not of type SHORT.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_string ( CDX_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.]

Return values
DDS_ReturnCode_tBAD_PARAMETER if 't' is not of type STRING.
OUT_OF_RESOURCESif memory allocation fails.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_ulong ( CDX_DynamicType  t,
unsigned long  c 
)
related

Assigns a value to the provided ULONG DynamicType.

Return values
BAD_PARAMETERif 't' is not of type ULONG.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_ulonglong ( CDX_DynamicType  t,
uint64_t  c 
)
related

Assigns a value to the provided ULONGLONG DynamicType.

Return values
BAD_PARAMETERif 't' is not of type ULONGLONG.
OKupon success.
DDS_ReturnCode_t CDX_DynamicType_set_ushort ( CDX_DynamicType  t,
unsigned short  c 
)
related

Assigns a value to the provided USHORT DynamicType.

Return values
BAD_PARAMETERif 't' is not of type USHORT.
OKupon success.

© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.