Type Code Support
[Topic Module]

<<eXtension>> A DDS::TypeCode is a mechanism for representing a type at runtime. RTI Data Distribution Service 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

class  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...
class  DDS::StructMember
 A description of a member of a struct. More...
class  DDS::StructMemberSeq
 Defines a sequence of struct members. More...
class  DDS::UnionMember
 A description of a member of a union. More...
class  DDS::UnionMemberSeq
 Defines a sequence of union members. More...
class  DDS::EnumMember
 A description of a member of an enumeration. More...
class  DDS::EnumMemberSeq
 Defines a sequence of enumerator members. More...
class  DDS::ValueMember
 A description of a member of a value type. More...
class  DDS::ValueMemberSeq
 Defines a sequence of value members. More...
class  DDS::TypeCodeFactory
 A singleton factory for creating, copying, and deleting data type definitions dynamically. 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,
  DDS::TK_SPARSE
}
 Enumeration type for DDS::TypeCode kinds. More...
enum  DDS::ValueModifier {
  DDS::VM_NONE,
  DDS::VM_CUSTOM,
  DDS::VM_ABSTRACT,
  DDS::VM_TRUNCATABLE
}
 Modifier type for a value type. More...
enum  DDS::Visibility {
  DDS::PRIVATE_MEMBER,
  DDS::PUBLIC_MEMBER
}
 Type to indicate the visibility of a value type member. More...

Variables

TypeCode^ DDS::TypeCode::TC_NULL
 Basic null type.
TypeCode^ DDS::TypeCode::TC_LONG
 Basic 32-bit signed integer type.
TypeCode^ DDS::TypeCode::TC_USHORT
 Basic unsigned 16-bit integer type.
TypeCode^ DDS::TypeCode::TC_ULONG
 Basic unsigned 32-bit integer type.
TypeCode^ DDS::TypeCode::TC_FLOAT
 Basic 32-bit floating point type.
TypeCode^ DDS::TypeCode::TC_DOUBLE
 Basic 64-bit floating point type.
TypeCode^ DDS::TypeCode::TC_BOOLEAN
 Basic Boolean type.
TypeCode^ DDS::TypeCode::TC_OCTET
 Basic octet/byte type.
TypeCode^ DDS::TypeCode::TC_LONGLONG
 Basic 64-bit integer type.
TypeCode^ DDS::TypeCode::TC_ULONGLONG
 Basic unsigned 64-bit integer type.
TypeCode^ DDS::TypeCode::TC_LONGDOUBLE
 Basic 128-bit floating point type.
TypeCode^ DDS::TypeCode::TC_WCHAR
 Basic four-byte character type.
System::Int32 DDS::TypeCode::MEMBER_ID_INVALID
 A sentinel indicating an invalid DDS::TypeCode member ID.
System::UInt32 DDS::TypeCode::INDEX_INVALID
 A sentinel indicating an invalid DDS::TypeCode member index.
System::Int16 DDS::TypeCode::NOT_BITFIELD
 Indicates that a member of a type is not a bitfield.
System::Byte DDS::TypeCode::NONKEY_MEMBER
 A flag indicating that a type member is optional and not part of the key.
System::Byte DDS::TypeCode::KEY_MEMBER
 A flag indicating that a type member is part of the key for that type, and therefore required.
System::Byte DDS::TypeCode::NONKEY_REQUIRED_MEMBER
 A flag indicating that a type member is not part of the key but is nevertheless required.

Detailed Description

<<eXtension>> A DDS::TypeCode is a mechanism for representing a type at runtime. RTI Data Distribution Service 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::Equals 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 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 Data Distribution Service 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 Data Distribution Service upon receipt and are therefore not available from the built-in topic data returned by DDS::DataWriter::get_matched_subscription_data or DDS::DataReader::get_matched_publication_data.

The space available locally to deserialize a discovered remote DDS::TypeCode is specified by the DDS::DomainParticipant'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


Enumeration Type Documentation

Enumeration type for DDS::TypeCode kinds.

Type code kinds are modeled as values of this type.

Enumerator:
TK_NULL  Indicates that a type code does not describe anything.
TK_SHORT  short type.
TK_LONG  long type.
TK_USHORT  unsigned short type.
TK_ULONG  unsigned long type.
TK_FLOAT  float type.
TK_DOUBLE  double type.
TK_BOOLEAN  boolean type.
TK_CHAR  char type.
TK_OCTET  octet type.
TK_STRUCT  struct type.
TK_UNION  union type.
TK_ENUM  enumerated type.
TK_STRING  string type.
TK_SEQUENCE  sequence type.
TK_ARRAY  array type.
TK_ALIAS  alias (typedef) type.
TK_LONGLONG  long long type.
TK_ULONGLONG  unsigned long long type.
TK_LONGDOUBLE  long double type.
TK_WCHAR  wide char type.
TK_WSTRING  wide string type.
TK_VALUE  value type.
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 DDS::ContentFilteredTopic), because filter evaluation on a non-existent field is not well defined.

Modifier type for a value type.

See also:
DDS::ValueModifier::VM_NONE

DDS::ValueModifier::VM_CUSTOM

DDS::ValueModifier::VM_ABSTRACT

DDS::ValueModifier::VM_TRUNCATABLE

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

See also:
DDS::ValueModifier
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
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
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

Type to indicate the visibility of a value type member.

See also:
DDS::Visibility::PRIVATE_MEMBER

DDS::Visibility::PUBLIC_MEMBER

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

See also:
DDS::Visibility

DDS::Visibility::PUBLIC_MEMBER

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

See also:
DDS::Visibility

DDS::Visibility::PRIVATE_MEMBER


Variable Documentation

TypeCode ^ DDS::TypeCode::TC_NULL [inherited]

Basic null type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_LONG [inherited]

Basic 32-bit signed integer type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_USHORT [inherited]

Basic unsigned 16-bit integer type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_ULONG [inherited]

Basic unsigned 32-bit integer type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_FLOAT [inherited]

Basic 32-bit floating point type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_DOUBLE [inherited]

Basic 64-bit floating point type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_BOOLEAN [inherited]

Basic Boolean type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_OCTET [inherited]

Basic octet/byte type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_LONGLONG [inherited]

Basic 64-bit integer type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_ULONGLONG [inherited]

Basic unsigned 64-bit integer type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_LONGDOUBLE [inherited]

Basic 128-bit floating point type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

TypeCode ^ DDS::TypeCode::TC_WCHAR [inherited]

Basic four-byte character type.

See also:
DDS::TypeCodeFactory::get_primitive_tc

System::Int32 DDS::TypeCode::MEMBER_ID_INVALID [inherited]

A sentinel indicating an invalid DDS::TypeCode member ID.

System::UInt32 DDS::TypeCode::INDEX_INVALID [inherited]

A sentinel indicating an invalid DDS::TypeCode member index.

System::Int16 DDS::TypeCode::NOT_BITFIELD [inherited]

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

System::Byte DDS::TypeCode::NONKEY_MEMBER [inherited]

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::TCKind::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_int). 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

System::Byte DDS::TypeCode::KEY_MEMBER [inherited]

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::TCKind::TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DDS::DynamicData::set_int), 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

System::Byte DDS::TypeCode::NONKEY_REQUIRED_MEMBER [inherited]

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::TCKind::TK_SPARSE). If you do not set a value of the member explicitly (see, for example, DDS::DynamicData::set_int), 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


RTI Data Distribution Service .Net APIs Version 4.5e Copyright © 23 Oct 2011 Real-Time Innovations, Inc