CoreDX DDS C++ Reference Manual
Public Member Functions | List of all members
CDX::SequenceDynamicType Class Reference

Contains a sequence. More...

Inheritance diagram for CDX::SequenceDynamicType:
CDX::DynamicType

Public Member Functions

uint32_t get_length ()
 Provides access to the length of data held in a DynamicType object. More...
 
DynamicTypeget_element_type ()
 Provides access to the type of the of data held in an ARRAY or SEQUENCE DynamicType object. More...
 
DynamicTypeget_element (uint32_t n)
 Provides access to the a data element held in an ARRAY or SEQUENCE DynamicType object. More...
 
DDS::ReturnCode_t set_max_length (uint32_t n)
 Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType. More...
 
DDS::ReturnCode_t set_length (uint32_t n)
 Assigns a 'length' value to the provided ARRAY or SEQUENCE DynamicType. More...
 
DDS::ReturnCode_t set_element_type (DynamicType *e)
 Defines the element type of an ARRAY or SEQUENCE. More...
 
DDS::ReturnCode_t set_element (uint32_t n, DynamicType *e)
 Assigns a value to an element of an ARRAY or SEQUENCE. 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...
 

Detailed Description

Contains a sequence.

Member Function Documentation

DynamicType* CDX::SequenceDynamicType::get_element ( uint32_t  n)

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'.
DynamicType* CDX::SequenceDynamicType::get_element_type ( )

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'.
uint32_t CDX::SequenceDynamicType::get_length ( )

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'.
DDS::ReturnCode_t CDX::SequenceDynamicType::set_element ( uint32_t  n,
DynamicType e 
)

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::SequenceDynamicType::set_element_type ( DynamicType e)

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::SequenceDynamicType::set_length ( uint32_t  n)

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 set_element() 'n' times.

Note
If 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::SequenceDynamicType::set_max_length ( uint32_t  n)

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.

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