CoreDX DDS
C++ Reference Manual

DDS::StructDynamicType Class Reference
[CoreDX DDS DynamicTypes]

Represents a struct of members. Each member has an associated data type. More...

Inheritance diagram for DDS::StructDynamicType:
DDS::DynamicType

List of all members.

Public Member Functions

uint32_t get_num_fields ()
 Provides access to the number of fields held by a STRUCT or UNION DynamicType object.
DynamicTypeget_field (uint32_t n)
 Provides access to a field held by a STRUCT or UNION DynamicType object.
const char * get_field_name (uint32_t n)
 Provides access to the name of a field held by a STRUCT or UNION DynamicType object.
unsigned char get_field_key (uint32_t n)
 Provides access to the 'key' indication for a field held by a STRUCT DynamicType object.
ReturnCode_t set_num_fields (uint32_t n)
 Defines the number of fields held by a STRUCT or UNION DynamicType object.
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.

Detailed Description

Represents a struct of members. Each member has an associated data type.


Member Function Documentation

DynamicType* DDS::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.

Return values:
DynamicType the number of data fields in the STRUCT or UNION 't'.
unsigned char DDS::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.

Return values:
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* DDS::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.

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

Return values:
uint32_t the number of data fields in the STRUCT or UNION 't'.
ReturnCode_t DDS::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.

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_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.
ReturnCode_t DDS::StructDynamicType::set_num_fields ( uint32_t  n  ) 

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

Return values:
BAD_PARAMETER if 't' is not of type STRUCT or UNION.
OK upon success.
 All Classes Files Functions Variables

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