CoreDX DDS
C++ Reference Manual

DDS::SequenceDynamicType Class Reference
[CoreDX DDS DynamicTypes]

Contains a sequence. More...

Inheritance diagram for DDS::SequenceDynamicType:
DDS::DynamicType

List of all members.

Public Member Functions

uint32_t get_length ()
 Provides access to the length of data held in a DynamicType object.
DynamicTypeget_element_type ()
 Provides access to the type of the of data held in an ARRAY or SEQUENCE DynamicType object.
DynamicTypeget_element (uint32_t n)
 Provides access to the a data element held in an ARRAY or SEQUENCE DynamicType object.
ReturnCode_t set_max_length (uint32_t n)
 Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType.
ReturnCode_t set_length (uint32_t n)
 Assigns a 'length' value to the provided ARRAY or SEQUENCE DynamicType.
ReturnCode_t set_element_type (DynamicType *e)
 Defines the element type of an ARRAY or SEQUENCE.
ReturnCode_t set_element (uint32_t n, DynamicType *e)
 Assigns a value to an element of an ARRAY or SEQUENCE.

Detailed Description

Contains a sequence.


Member Function Documentation

DynamicType* DDS::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_t the data element held in the SEQUENCE or ARRAY 't' at index 'n'.
DynamicType* DDS::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_t the 'type' of the data value held in the SEQUENCE or ARRAY 't'.
uint32_t DDS::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_t the length of the data value held by 't'.
ReturnCode_t DDS::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_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.
ReturnCode_t DDS::SequenceDynamicType::set_element_type ( DynamicType e  ) 

Defines the element type of an ARRAY or SEQUENCE.

Return values:
BAD_PARAMETER if 't' is not of type ARRAY or SEQUENCE.
OK upon success.
ReturnCode_t DDS::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_PARAMETER if 't' is not of type ARRAY or SEQUENCE; OUT_OF_RESOURCES if memory allocation fails.
OK upon success.
ReturnCode_t DDS::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_PARAMETER if 't' is not of type STRING, ARRAY, or SEQUENCE.
OK upon success.
 All Classes Files Functions Variables

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