Type Code Support
[Topic Module]

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

Defines

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

Typedefs

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

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,
  DDS_TK_SPARSE
}
 Enumeration type for DDS_TypeCode kinds. More...

Variables

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

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 enabled by default. (The -notypecode option can be used to disable generation of DDS_TypeCode information.) 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.

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

rtiddsgen

DDS_SubscriptionBuiltinTopicData

DDS_PublicationBuiltinTopicData


Define Documentation

#define DDS_TYPECODE_MEMBER_ID_INVALID

A sentinel indicating an invalid DDS_TypeCode member ID.

#define DDS_TYPECODE_INDEX_INVALID

A sentinel indicating an invalid DDS_TypeCode member index.

#define DDS_TYPECODE_NOT_BITFIELD

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

#define DDS_VM_NONE

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

See also:
DDS_ValueModifier
Examples:
HelloWorld.cxx.

#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

#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

#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

#define DDS_PRIVATE_MEMBER

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

See also:
DDS_Visibility

DDS_PUBLIC_MEMBER

Examples:
HelloWorld.cxx.

#define DDS_PUBLIC_MEMBER

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

See also:
DDS_Visibility

DDS_PRIVATE_MEMBER

#define DDS_TYPECODE_NONKEY_MEMBER

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

Only sparse value types (i.e. types of DDS_TCKind DDS_TK_SPARSE) support this flag. Non-key members of other type kinds should use the flag DDS_TYPECODE_NONKEY_REQUIRED_MEMBER.

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

#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, even if the type is a sparse value type (i.e. of kind DDS_TK_SPARSE). 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

#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, even if the type is a sparse value type (i.e. of kind DDS_TK_SPARSE). 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


Typedef Documentation

typedef short DDS_ValueModifier

Modifier type for a value type.

See also:
DDS_VM_NONE

DDS_VM_CUSTOM

DDS_VM_ABSTRACT

DDS_VM_TRUNCATABLE

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

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_TK_SPARSE  A sparse value type.

A sparse value type is one in which all of the fields are not necessarily sent on the network as a part of every sample.

Fields of a sparse value type fall into one of three categories:

Fields of the first two kinds must appear in every sample. These are also the only kinds of fields on which you can perform content filtering (see DDSContentFilteredTopic), because filter evaluation on a non-existent field is not well defined.


Variable Documentation

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

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

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

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

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

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

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

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

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

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

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

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


RTI Connext C++ API Version 4.5f Copyright © 17 Mar 2012 Real-Time Innovations, Inc