Contains an array.
More...
DynamicType* CDX::ArrayDynamicType::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* CDX::ArrayDynamicType::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 CDX::ArrayDynamicType::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'. |
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. |
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. |
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. |
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. |