The type representation specifies the ways in which a type can be externalized so that it can be stored in a file or sent over the network.
The "Extensible and Dynamic Topic Types for DDS" (DDS-XTypes) specification describes four different type representations: IDL, TypeObject, XML, and XSD.
Earlier versions of Connext DDS (4.5f and lower) used TypeCodes as the wire representation to communicate types over the network and the TypeCode API to introspect and manipulate the types at run time.
The Extensible Types specification uses TypeObjects as the wire representation and the DynamicType API to introspect and manipulate the types. Types are propagated by serializing the associated TypeObject representation.
Connext DDS 5.x and higher supports TypeObjects v1 as the wire representation. TypeObjects v2 are not supported. To maintain backward compatibility with previous releases, this release still supports propagation of TypeCodes; however, support for this feature may be discontinued in future releases.
In this release, only Modern C++ supports the DynamicType API to introspect the types at runtime. Other language bindings must use the TypeCode API.
You can introspect the discovered type independently of the wire format by using the type_code member in the PublicationBuiltinTopicData and SubscriptionBuiltinTopicData structures for all language bindings but Modern C++. In Modern C++, the type information can be accessed using the type() or get_type_no_copy() accessors.
One important limitation of using TypeCodes as the wire representation is that their serialized size is limited to 65 KB. This is a problem for services and tools that depend on the discovered types, such as RTI Routing Service and RTI Spreadsheet Add-in for Microsoft Excel. With the introduction of TypeObjects, this limitation is removed since the size of the serialized representation is not bounded.
To summarize:
|
Connext DDS 5.x and Higher |
Connext DDS 4.5f and Earlier |
Wire Representation |
TypeObjects or TypeCodes (for backwards compatibility) |
TypeCodes |
For Introspection at Run Time |
TypeCode API (DynamicType API for Modern C++) |
TypeCode API |
Maximum Size of Serialized Representation |
When using TypeObjects: Unbounded When using TypeCodes: 65 KB |
65 KB |
Table 5.1 TypeObject Fields in DomainParticipantResourceLimitsQosPolicy lists fields in the DomainParticipantResourceLimitsQosPolicy that control resource utilization when the TypeObjects in a DomainParticipant are stored and propagated.
Note that memory usage is optimized; only one instance of a TypeObject will be stored, even if multiple local or remote DataReaders or DataWriters use it.
The TypeObject is needed for type-assignability enforcement.
Since TypeObjects contain all of the information of a data structure, including the strings that define the names of the members of a structure, complex data structures can result in large TypeObjects that frequently require enabling asynchronous publication for discovery data.
To reduce bandwidth usage during discovery for large TypeObjects, Connext DDS allows compressing the TypeObject information. Compression is enabled by default, and it can be configured using the QoS value DDS_DiscoveryConfigQosPolicy::endpoint_type_object_lb_serialization_threshold. For additional information, see the section “DISCOVERY_CONFIG QosPolicy” in the RTI Connext DDS Core Libraries User's Manual.
By default, Connext DDS 5.3.1 and lower propagated both the pre-standard TypeCode and the TypeObject. Connext DDS 6.0.0 and higher only propagates TypeObjects by default. You can change this behavior:
To propagate TypeObject only: |
Set type_code_max_serialized_length = 0 |
To propagate TypeCode only: |
Set type_object_max_serialized_length = 0 |
To propagate none: |
Set type_code_max_serialized_length = 0 and type_object_max_serialized_length = 0 |
To propagate both (default): |
Use the default values of type_code_max_serialized_length and type_object_max_serialized_length or modify them if the type size requires so. |
The XML and XSD type-representation formats available in Connext DDS formed the basis for the DDS-XTypes specification of these features.
The XML format is compatible with the format described in the XTypes specification.
The XSD format, however, has not been completely updated to the new standard format. For example, in Connext DDS, built-in annotations are applied using comments, whereas in the XTypes specification they are applied using <xsd:annotation>.
For additional information on how to apply built-in annotations using XSD Type Representation in Connext DDS see the section "Creating User Data Types with XML Schemas (XSD)" in the RTI Connext DDS Core Libraries User's Manual.
For additional information on how to apply built-in annotations using XSD Type Representation in the XTypes specification, see the section “XSD Type Representation” in the “Extensible and Dynamic Topic Types for DDS” specification.
© 2020 RTI