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

Contains a string. More...

Inheritance diagram for CDX::StringDynamicType:
CDX::DynamicType

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...
 

Detailed Description

Contains a string.

Member Function Documentation

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.

Return values
uint32_tthe 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.

Return values
uint32_tthe 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.

Return values
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.

Return values
BAD_PARAMETERif 't' is not of type STRING, ARRAY, or SEQUENCE.
OKupon 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.]

Return values
DDS::ReturnCode_tBAD_PARAMETER if 't' is not of type STRING.
OUT_OF_RESOURCESif memory allocation fails.
OKupon success.

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