RTI Connext Traditional C++ API  Version 7.0.0

<<extension>> A DDS_TypeCode is a mechanism for representing a type at runtime. RTI Connext can use type codes to send type definitions on the network. You will need to understand this API in order to use the Dynamic Data capability or to inspect the type information you receive from remote readers and writers. More...

Classes

struct  DDS_TypeCodePrintFormatProperty
 A collection of attributes used to configure how a TypeCode appears when converted to a string. More...
 
struct  DDS_TypeCode
 The definition of a particular data type, which you can use to inspect the name, members, and other properties of types generated with rtiddsgen (see the Code Generator User's Manual) or to modify types you define yourself at runtime. More...
 
struct  DDS_StructMember
 A description of a member of a struct. More...
 
struct  DDS_StructMemberSeq
 Defines a sequence of struct members. More...
 
struct  DDS_UnionMember
 A description of a member of a union. More...
 
struct  DDS_UnionMemberSeq
 Defines a sequence of union members. More...
 
struct  DDS_EnumMember
 A description of a member of an enumeration. More...
 
struct  DDS_EnumMemberSeq
 Defines a sequence of enumerator members. More...
 
struct  DDS_ValueMember
 A description of a member of a value type. More...
 
struct  DDS_ValueMemberSeq
 Defines a sequence of value members. More...
 
struct  DDS_TypeCodeFactory
 A singleton factory for creating, copying, and deleting data type definitions dynamically. More...
 

Macros

#define DDS_TYPECODE_MEMBER_ID_INVALID
 A sentinel indicating an invalid DDS_TypeCode member ID. More...
 
#define DDS_TYPECODE_INDEX_INVALID
 A sentinel indicating an invalid DDS_TypeCode member index. More...
 
#define DDS_TYPECODE_NOT_BITFIELD
 Indicates that a member of a type is not a bitfield. More...
 
#define DDS_VM_NONE
 Constant used to indicate that a value type has no modifiers. More...
 
#define DDS_VM_CUSTOM
 Constant used to indicate that a value type has the custom modifier. More...
 
#define DDS_VM_ABSTRACT
 Constant used to indicate that a value type has the abstract modifier. More...
 
#define DDS_VM_TRUNCATABLE
 Constant used to indicate that a value type has the truncatable modifier. More...
 
#define DDS_PRIVATE_MEMBER
 Constant used to indicate that a value type member is private. More...
 
#define DDS_PUBLIC_MEMBER
 Constant used to indicate that a value type member is public. More...
 
#define DDS_TYPECODE_NONKEY_MEMBER
 A flag indicating that a type member is optional and not part of the key. More...
 
#define DDS_TYPECODE_KEY_MEMBER
 A flag indicating that a type member is part of the key for that type, and therefore required. More...
 
#define DDS_TYPECODE_NONKEY_REQUIRED_MEMBER
 A flag indicating that a type member is not part of the key but is nevertheless required. More...
 
#define DDS_TypeCode_PrintFormat_INITIALIZER
 Static initializer for DDS_TypeCodePrintFormatProperty. More...
 

Typedefs

typedef short DDS_ValueModifier
 Modifier type for a value type. More...
 
typedef short DDS_Visibility
 Type to indicate the visibility of a value type member. More...
 

Enumerations

enum  DDS_TCKind {
  DDS_TK_NULL,
  DDS_TK_SHORT,
  DDS_TK_LONG,
  DDS_TK_USHORT,
  DDS_TK_ULONG,
  DDS_TK_FLOAT,
  DDS_TK_DOUBLE,
  DDS_TK_BOOLEAN,
  DDS_TK_CHAR,
  DDS_TK_OCTET,
  DDS_TK_STRUCT,
  DDS_TK_UNION,
  DDS_TK_ENUM,
  DDS_TK_STRING,
  DDS_TK_SEQUENCE,
  DDS_TK_ARRAY,
  DDS_TK_ALIAS,
  DDS_TK_LONGLONG,
  DDS_TK_ULONGLONG,
  DDS_TK_LONGDOUBLE,
  DDS_TK_WCHAR,
  DDS_TK_WSTRING,
  DDS_TK_VALUE
}
 Enumeration type for DDS_TypeCode kinds. More...
 
enum  DDS_ExtensibilityKind {
  DDS_FINAL_EXTENSIBILITY,
  DDS_EXTENSIBLE_EXTENSIBILITY,
  DDS_MUTABLE_EXTENSIBILITY
}
 Type to indicate the extensibility of a type. More...
 

Variables

DDS_TypeCode DDS_g_tc_null
 Basic NULL type. More...
 
DDS_TypeCode DDS_g_tc_short
 Basic 16-bit signed integer type. More...
 
DDS_TypeCode DDS_g_tc_long
 Basic 32-bit signed integer type. More...
 
DDS_TypeCode DDS_g_tc_ushort
 Basic unsigned 16-bit integer type. More...
 
DDS_TypeCode DDS_g_tc_ulong
 Basic unsigned 32-bit integer type. More...
 
DDS_TypeCode DDS_g_tc_float
 Basic 32-bit floating point type. More...
 
DDS_TypeCode DDS_g_tc_double
 Basic 64-bit floating point type. More...
 
DDS_TypeCode DDS_g_tc_boolean
 Basic Boolean type. More...
 
DDS_TypeCode DDS_g_tc_char
 Basic single-byte character type. More...
 
DDS_TypeCode DDS_g_tc_octet
 Basic octet/byte type. More...
 
DDS_TypeCode DDS_g_tc_longlong
 Basic 64-bit integer type. More...
 
DDS_TypeCode DDS_g_tc_ulonglong
 Basic unsigned 64-bit integer type. More...
 
DDS_TypeCode DDS_g_tc_longdouble
 Basic 128-bit floating point type. More...
 
DDS_TypeCode DDS_g_tc_wchar
 Basic four-byte character type. More...
 

Detailed Description

<<extension>> A DDS_TypeCode is a mechanism for representing a type at runtime. RTI Connext can use type codes to send type definitions on the network. You will need to understand this API in order to use the Dynamic Data capability or to inspect the type information you receive from remote readers and writers.

Type codes are values that are used to describe arbitrarily complex types at runtime. Type code values are manipulated via the DDS_TypeCode class, which has an analogue in CORBA.

A DDS_TypeCode value consists of a type code kind (represented by the DDS_TCKind enumeration) and a list of members (that is, fields). These members are recursive: each one has its own DDS_TypeCode, and in the case of complex types (structures, arrays, and so on), these contained type codes contain their own members.

There are a number of uses for type codes. The type code mechanism can be used to unambiguously match type representations. The DDS_TypeCode::equal method is a more reliable test than comparing the string type names, requiring equivalent definitions of the types.

Accessing a Local ::DDS_TypeCode

When generating types with rtiddsgen, type codes are always enabled. For these types, a DDS_TypeCode may be accessed by calling the Foo_get_typecode function for a type "Foo", which returns a DDS_TypeCode pointer. via the FooTypeCode.VALUE member. This API also includes support for dynamic creation of DDS_TypeCode values, typically for use with the Dynamic Data API. You can create a DDS_TypeCode using the DDS_TypeCodeFactory class. You will construct the DDS_TypeCode recursively, from the outside in: start with the type codes for primitive types, then compose them into complex types like arrays, structures, and so on. You will find the following methods helpful:

Accessing a Remote ::DDS_TypeCode

In addition to being used locally, RTI Connext can transmit DDS_TypeCode on the network between participants. This information can be used to access information about types used remotely at runtime, for example to be able to publish or subscribe to topics of arbitrarily types (see Dynamic Data). This functionality is useful for a generic system monitoring tool like rtiddsspy.

Remote DDS_TypeCode information is shared during discovery over the publication and subscription built-in topics and can be accessed using the built-in readers for these topics; see Built-in Topics. Discovered DDS_TypeCode values are not cached by RTI Connext upon receipt and are therefore not available from the built-in topic data returned by DDSDataWriter::get_matched_subscription_data or DDSDataReader::get_matched_publication_data.

The space available locally to deserialize a discovered remote DDS_TypeCode is specified by the DDSDomainParticipant's DDS_DomainParticipantResourceLimitsQosPolicy::type_code_max_serialized_length QoS parameter. To support especially complex type codes, it may be necessary for you to increase the value of this parameter.

See also
DDS_TypeCode
Dynamic Data
the Code Generator User's Manual
DDS_SubscriptionBuiltinTopicData
DDS_PublicationBuiltinTopicData

Macro Definition Documentation

◆ DDS_TYPECODE_MEMBER_ID_INVALID

#define DDS_TYPECODE_MEMBER_ID_INVALID

A sentinel indicating an invalid DDS_TypeCode member ID.

◆ DDS_TYPECODE_INDEX_INVALID

#define DDS_TYPECODE_INDEX_INVALID

A sentinel indicating an invalid DDS_TypeCode member index.

◆ DDS_TYPECODE_NOT_BITFIELD

#define DDS_TYPECODE_NOT_BITFIELD

Indicates that a member of a type is not a bitfield.

◆ DDS_VM_NONE

#define DDS_VM_NONE

Constant used to indicate that a value type has no modifiers.

See also
DDS_ValueModifier
Examples:
HelloWorld.cxx.

◆ DDS_VM_CUSTOM

#define DDS_VM_CUSTOM

Constant used to indicate that a value type has the custom modifier.

This modifier is used to specify whether the value type uses custom marshaling.

See also
DDS_ValueModifier

◆ DDS_VM_ABSTRACT

#define DDS_VM_ABSTRACT

Constant used to indicate that a value type has the abstract modifier.

An abstract value type may not be instantiated.

See also
DDS_ValueModifier

◆ DDS_VM_TRUNCATABLE

#define DDS_VM_TRUNCATABLE

Constant used to indicate that a value type has the truncatable modifier.

A value with a state that derives from another value with a state can be declared as truncatable. A truncatable type means the object can be truncated to the base type.

See also
DDS_ValueModifier

◆ DDS_PRIVATE_MEMBER

#define DDS_PRIVATE_MEMBER

Constant used to indicate that a value type member is private.

See also
DDS_Visibility
DDS_PUBLIC_MEMBER

◆ DDS_PUBLIC_MEMBER

#define DDS_PUBLIC_MEMBER

Constant used to indicate that a value type member is public.

See also
DDS_Visibility
DDS_PRIVATE_MEMBER
Examples:
HelloWorld.cxx.

◆ DDS_TYPECODE_NONKEY_MEMBER

#define DDS_TYPECODE_NONKEY_MEMBER

A flag indicating that a type member is optional and not part of the key.

If a type is used with the Dynamic Data facility, a DDS_DynamicData sample of the type will only contain a value for a DDS_TYPECODE_NONKEY_MEMBER field if one has been explicitly set (see, for example, DDS_DynamicData::set_long). The middleware will not assume any default value.

See also
DDS_TYPECODE_KEY_MEMBER
DDS_TYPECODE_NONKEY_REQUIRED_MEMBER
DDS_TYPECODE_KEY_MEMBER
DDS_TypeCode::add_member
DDS_TypeCode::add_member_ex
DDS_TypeCode::is_member_key
DDS_TypeCode::is_member_required
DDS_StructMember::is_key
DDS_ValueMember::is_key

◆ DDS_TYPECODE_KEY_MEMBER

#define DDS_TYPECODE_KEY_MEMBER

A flag indicating that a type member is part of the key for that type, and therefore required.

If a type is used with the Dynamic Data facility, all DDS_DynamicData samples of the type will contain a value for all DDS_TYPECODE_KEY_MEMBER fields. If you do not set a value of the member explicitly (see, for example, DDS_DynamicData::set_long), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.

See also
DDS_TYPECODE_NONKEY_REQUIRED_MEMBER
DDS_TYPECODE_NONKEY_MEMBER
DDS_TypeCode::add_member
DDS_TypeCode::add_member_ex
DDS_TypeCode::is_member_key
DDS_TypeCode::is_member_required
DDS_StructMember::is_key
DDS_ValueMember::is_key

◆ DDS_TYPECODE_NONKEY_REQUIRED_MEMBER

#define DDS_TYPECODE_NONKEY_REQUIRED_MEMBER

A flag indicating that a type member is not part of the key but is nevertheless required.

This is the most common kind of member.

If a type is used with the Dynamic Data facility, all DDS_DynamicData samples of the type will contain a value for all DDS_TYPECODE_NONKEY_REQUIRED_MEMBER fields. If you do not set a value of the member explicitly (see, for example, DDS_DynamicData::set_long), the middleware will assume a default "zero" value: numeric values will be set to zero; strings and sequences will be of zero length.

See also
DDS_TYPECODE_KEY_MEMBER
DDS_TYPECODE_NONKEY_MEMBER
DDS_TYPECODE_KEY_MEMBER
DDS_TypeCode::add_member
DDS_TypeCode::add_member_ex
DDS_TypeCode::is_member_key
DDS_TypeCode::is_member_required
DDS_StructMember::is_key
DDS_ValueMember::is_key

◆ DDS_TypeCode_PrintFormat_INITIALIZER

#define DDS_TypeCode_PrintFormat_INITIALIZER

Static initializer for DDS_TypeCodePrintFormatProperty.

Use this initializer to ensure that new objects don't have uninitialized contents.

Typedef Documentation

◆ DDS_ValueModifier

typedef short DDS_ValueModifier

Modifier type for a value type.

See also
DDS_VM_NONE
DDS_VM_CUSTOM
DDS_VM_ABSTRACT
DDS_VM_TRUNCATABLE

◆ DDS_Visibility

typedef short DDS_Visibility

Type to indicate the visibility of a value type member.

See also
DDS_PRIVATE_MEMBER
DDS_PUBLIC_MEMBER

Enumeration Type Documentation

◆ DDS_TCKind

enum DDS_TCKind

Enumeration type for DDS_TypeCode kinds.

Type code kinds are modeled as values of this type.

Enumerator
DDS_TK_NULL 

Indicates that a type code does not describe anything.

DDS_TK_SHORT 

short type.

DDS_TK_LONG 

long type.

DDS_TK_USHORT 

unsigned short type.

DDS_TK_ULONG 

unsigned long type.

DDS_TK_FLOAT 

float type.

DDS_TK_DOUBLE 

double type.

DDS_TK_BOOLEAN 

boolean type.

DDS_TK_CHAR 

char type.

DDS_TK_OCTET 

octet type.

DDS_TK_STRUCT 

struct type.

DDS_TK_UNION 

union type.

DDS_TK_ENUM 

enumerated type.

DDS_TK_STRING 

string type.

DDS_TK_SEQUENCE 

sequence type.

DDS_TK_ARRAY 

array type.

DDS_TK_ALIAS 

alias (typedef) type.

DDS_TK_LONGLONG 

long long type.

DDS_TK_ULONGLONG 

unsigned long long type.

DDS_TK_LONGDOUBLE 

long double type.

DDS_TK_WCHAR 

wide char type.

DDS_TK_WSTRING 

wide string type.

DDS_TK_VALUE 

value type.

◆ DDS_ExtensibilityKind

Type to indicate the extensibility of a type.

Enumerator
DDS_FINAL_EXTENSIBILITY 

Specifies that a type has FINAL extensibility.

A type may be final, indicating that the range of its possible values is strictly defined. In particular, it is not possible to add elements to members of collection or aggregated types while maintaining type assignability.

The following types are always final:

DDS_EXTENSIBLE_EXTENSIBILITY 

Specifies that a type has EXTENSIBLE extensibility.

A type may be extensible, indicating that two types, where one contains all of the elements/members of the other plus additional elements/members appended to the end, may remain assignable.

DDS_MUTABLE_EXTENSIBILITY 

Specifies that a type has MUTABLE extensibility.

A type may be mutable, indicating that two types may differ from one another in the additional, removal, and/or transposition of elements/members while remaining assignable.

The following types are always mutable:

Variable Documentation

◆ DDS_g_tc_null

DDS_TypeCode DDS_g_tc_null

Basic NULL type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc

◆ DDS_g_tc_short

DDS_TypeCode DDS_g_tc_short

Basic 16-bit signed integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Short

◆ DDS_g_tc_long

DDS_TypeCode DDS_g_tc_long

Basic 32-bit signed integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Long

◆ DDS_g_tc_ushort

DDS_TypeCode DDS_g_tc_ushort

Basic unsigned 16-bit integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_UnsignedShort

◆ DDS_g_tc_ulong

DDS_TypeCode DDS_g_tc_ulong

Basic unsigned 32-bit integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_UnsignedLong

◆ DDS_g_tc_float

DDS_TypeCode DDS_g_tc_float

Basic 32-bit floating point type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Float

◆ DDS_g_tc_double

DDS_TypeCode DDS_g_tc_double

Basic 64-bit floating point type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Double

◆ DDS_g_tc_boolean

DDS_TypeCode DDS_g_tc_boolean

Basic Boolean type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Boolean

◆ DDS_g_tc_char

DDS_TypeCode DDS_g_tc_char

Basic single-byte character type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Char

◆ DDS_g_tc_octet

DDS_TypeCode DDS_g_tc_octet

Basic octet/byte type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Octet

◆ DDS_g_tc_longlong

DDS_TypeCode DDS_g_tc_longlong

Basic 64-bit integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_LongLong

◆ DDS_g_tc_ulonglong

DDS_TypeCode DDS_g_tc_ulonglong

Basic unsigned 64-bit integer type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_UnsignedLongLong

◆ DDS_g_tc_longdouble

DDS_TypeCode DDS_g_tc_longdouble

Basic 128-bit floating point type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_LongDouble

◆ DDS_g_tc_wchar

DDS_TypeCode DDS_g_tc_wchar

Basic four-byte character type.

For new code, DDS_TypeCodeFactory::get_primitive_tc is preferred to using this global variable.

See also
DDS_TypeCodeFactory::get_primitive_tc
DDS_Wchar