20.1.3 Introduction to TypeCode
Type schemas—the names and definitions of a type and its fields—are represented by TypeCode objects (known as DynamicType in the Modern C++ API). A type code value consists of a type code kind (see the TCKind enumeration below) and a list of members. For compound types like structs and arrays, this list will recursively include one or more type code values.
enum TCKind { TK_NULL, TK_SHORT, TK_LONG, TK_USHORT, TK_ULONG, TK_FLOAT, TK_DOUBLE, TK_BOOLEAN, TK_CHAR, TK_OCTET, TK_STRUCT, TK_UNION TK_ENUM, TK_STRING, TK_SEQUENCE, TK_ARRAY, TK_ALIAS, TK_LONGLONG, TK_ULONGLONG, TK_LONGDOUBLE, TK_WCHAR, TK_WSTRING, TK_VALUE }
Type codes unambiguously match type representations and provide a more reliable test than comparing the string type names.
The TypeCode class, modeled after the corresponding CORBA API, provides access to type-code information. For details on the available operations for the TypeCode class, see the API Reference HTML documentation, which is available for all supported programming languages (select Modules, RTI Connext API Reference, Topic Module, Type Code Support or, for the Modern C++ API select Modules, RTI Connext API Reference, Infrastructure Module, DynamicType and DynamicData).
Note: Type-code support must be enabled if you are going to use 21.3 ContentFilteredTopics with the default SQL filter. You may disable type codes and use a custom filter, as described in 45.2 Creating ContentFilteredTopics.
20.1.3.1 Sending Type Information on the Network
In addition to being used locally, the type information of a Topic is published automatically during discovery as part of the built-in topics for publications and subscriptions. See 31.2 Built-in DataReaders. This allows applications to publish or subscribe to topics of arbitrary types. This functionality is useful for generic system monitoring tools like the rtiddsspy debug tool (see the API Reference HTML documentation).
Earlier versions of Connext (4.5f and lower) used serialized TypeCodes (now deprecated1) as the wire representation to communicate types over the network.
The OMG 'Extensible and Dynamic Topic Types for DDS' specification, version 1.3 uses TypeObjects as the wire representation. Types are propagated by serializing the associated TypeObject representation. Connext 5.x and higher supports TypeObjects as the wire representation. To maintain backward compatibility with previous releases, Connext still supports propagation of TypeCodes; however, support for this feature may be discontinued in future releases.
If your data type has an especially complex type code, you may need to increase the value of the type_code_max_serialized_length, type_object_max_serialized_length, and type_object_max_deserialized_length fields in the DomainParticipant's 56.4 DOMAIN_PARTICIPANT_RESOURCE_LIMITS QosPolicy (DDS Extension). Or, to prevent the propagation of type information altogether, you can set these values to zero (0). Be aware that some features of monitoring tools, as well as some features of the middleware itself (such as ContentFilteredTopics) will not work correctly if you disable type information propagation.
For additional information on TypeCode versus TypeObject as wire representation, as well as resource limits to configure the propagation, see Type Representation, in the RTI Connext Core Libraries Extensible Types Guide.