Contains a string. More...
Public Member Functions | |
const char * | get_string () |
Provides access to data held in an STRING DynamicType object. More... | |
uint32_t | get_max_length () |
Provides access to the maximum length of a DynamicType object. More... | |
uint32_t | get_length () |
Provides access to the length of data held in a DynamicType object. More... | |
DDS::ReturnCode_t | set_string (const char *c) |
Assigns a value to the provided STRING DynamicType. More... | |
DDS::ReturnCode_t | set_max_length (uint32_t n) |
Assigns a 'max_length' value to the provided STRING, ARRAY, or SEQUENCE DynamicType. 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... | |
Contains a string.
uint32_t CDX::StringDynamicType::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.
uint32_t | the length of the data value held by 't'. |
uint32_t CDX::StringDynamicType::get_max_length | ( | ) |
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.
uint32_t | the maximum length of the data value held by 't'. |
const char* CDX::StringDynamicType::get_string | ( | ) |
Provides access to data held in an STRING DynamicType object.
const_char_* | the data value held by 't'. |
DDS::ReturnCode_t CDX::StringDynamicType::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.
BAD_PARAMETER | if 't' is not of type STRING, ARRAY, or SEQUENCE. |
OK | upon success. |
DDS::ReturnCode_t CDX::StringDynamicType::set_string | ( | const char * | c | ) |
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 '\0' (nul) character will be added after the truncated data.]
DDS::ReturnCode_t | BAD_PARAMETER if 't' is not of type STRING. |
OUT_OF_RESOURCES | if memory allocation fails. |
OK | upon success. |