RTI Connext Java API
Version 6.0.0
|
Defines the rules for determining whether the type used to publish a given topic is consistent with that used to subscribe to it. More...
Public Attributes | |
TypeConsistencyKind | kind |
Type consistency kind. | |
boolean | ignore_sequence_bounds |
Controls whether sequence bounds are taken into consideration for type assignability. | |
boolean | ignore_string_bounds |
Controls whether string bounds are taken into consideration for type assignability. | |
boolean | ignore_member_names |
Controls whether member names are taken into consideration for type assignability. | |
boolean | prevent_type_widening |
Controls whether type widening is allowed. | |
boolean | force_type_validation |
Controls whether type information must be available in order to complete matching between a com.rti.dds.publication.DataWriter and a com.rti.dds.subscription.DataReader. | |
boolean | ignore_enum_literal_names |
Controls whether enumeration constant names are taken into consideration for type assignability. | |
Public Attributes inherited from QosPolicy | |
final QosPolicyId_t | id |
The ID of this QoS policy. | |
final String | policy_name |
The name of this QoS policy. | |
Additional Inherited Members | |
Public Member Functions inherited from Struct | |
abstract boolean | equals (Object obj) |
abstract int | hashCode () |
String | toString () |
Protected Member Functions inherited from Struct | |
Struct () | |
abstract void | pull_from_nativeI (long native_status) |
abstract void | push_to_nativeI (long native_status) |
Defines the rules for determining whether the type used to publish a given topic is consistent with that used to subscribe to it.
This policy defines a type consistency kind, which allows applications to select from among a set of predetermined behaviors. The following consistency kinds are specified: com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.DISALLOW_TYPE_COERCION, com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.ALLOW_TYPE_COERCION and com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.AUTO_TYPE_COERCION.
The type-consistency-enforcement rules consist of two steps:
Step 1. If both the DataWriter and DataReader specify a TypeObject, it is considered first. If the DataReader allows type coercion, then its type must be assignable from the DataWriter's type, taking into account the values of prevent_type_widening, ignore_sequence_bounds, ignore_string_bounds, ignore_member_names, and ignore_enum_literal_names. If the DataReader does not allow type coercion, then its type must be equivalent to the type of the DataWriter.
Step 2. If either the DataWriter or the DataReader does not provide a TypeObject definition, then the registered type names are examined. The DataReader's and DataWriter's registered type names must match exactly, as was true in RTI Connext releases prior to 5.0.0.
If either Step 1 or Step 2 fails, the Topics associated with the DataReader and DataWriter are considered to be inconsistent and the com.rti.dds.topic.InconsistentTopicStatus is updated.
The default enforcement kind is com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.AUTO_TYPE_COERCION. This default kind translates to com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.ALLOW_TYPE_COERCION except in the following cases:
For additional information on type consistency enforcement refer to the Addendum for Extensible Types and the OMG Extensible and Dynamic Topic Types for DDS Specification.
TypeConsistencyKind kind |
Type consistency kind.
[default] com.rti.dds.infrastructure.TypeConsistencyKind.TypeConsistencyKind.AUTO_TYPE_COERCION
boolean ignore_sequence_bounds |
Controls whether sequence bounds are taken into consideration for type assignability.
If the option is set to com.rti.dds.infrastructure.true, then sequence bounds (maximum lengths) are not considered as part of the type assignability. This means that a T2 sequence type with maximum length L2 would be assignable to a T1 sequence type with maximum length L1, even if L2 is greater than L1. If the option is set to com.rti.dds.infrastructure.false, then sequence bounds are taken into consideration for type assignability, and in order for T1 to be assignable from T2, it is required that L1 >= L2.
[default] com.rti.dds.infrastructure.false
boolean ignore_string_bounds |
Controls whether string bounds are taken into consideration for type assignability.
If the option is set to com.rti.dds.infrastructure.true, then string bounds (maximum lengths) are not considered as part of the type assignability. This means that a T2 string type with maximum length L2 would be assignable to a T1 string type with maximum length L1, even if L2 is greater than L1. If the option is set to com.rti.dds.infrastructure.false, then string bounds are taken into consideration for type assignability, and in order for T1 to be assignable from T2, it is required that L1 >= L2.
[default] com.rti.dds.infrastructure.false
boolean ignore_member_names |
Controls whether member names are taken into consideration for type assignability.
If the option is set to com.rti.dds.infrastructure.true, then member names are not considered as part of the type assignability. If the option is set to com.rti.dds.infrastructure.false, then member names are taken into consideration for type assignability, and in order for members with the same ID to be assignable, the members must also have the same name.
[default] com.rti.dds.infrastructure.false
boolean prevent_type_widening |
Controls whether type widening is allowed.
If the option is set to com.rti.dds.infrastructure.false, then type widening is permitted. If the option is set to com.rti.dds.infrastructure.true, then a wider type may not be assignable from a narrower type.
[default] com.rti.dds.infrastructure.false
boolean force_type_validation |
Controls whether type information must be available in order to complete matching between a com.rti.dds.publication.DataWriter and a com.rti.dds.subscription.DataReader.
If the option is set to com.rti.dds.infrastructure.true, then type information must be available in order to complete matching between a com.rti.dds.publication.DataWriter and a com.rti.dds.subscription.DataReader. If the option is set to com.rti.dds.infrastructure.false, then matching can occur without complete type information as long as the type names match exactly. Note that if the types have the same name but are not assignable, DataReaders may fail to deserialize incoming data samples.
[default] com.rti.dds.infrastructure.false
boolean ignore_enum_literal_names |
Controls whether enumeration constant names are taken into consideration for type assignability.
If the option is set to com.rti.dds.infrastructure.true, then enumeration constants may change their names, but not their values, and still maintain assignability. If the option is set to com.rti.dds.infrastructure.false, then in order for enumerations to be assignable, any constant that has the same value in both enumerations must also have the same name.
[default] com.rti.dds.infrastructure.false