RTI Connext Modern C++ API  Version 5.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::core::policy::TypeConsistencyEnforcement Class Reference

Defines the rules for determining whether the type used to publish a given topic is consistent with that used to subscribe to it. More...

#include <dds/core/policy/CorePolicy.hpp>

Public Member Functions

 TypeConsistencyEnforcement ()
 Creates the default policy.
 
 TypeConsistencyEnforcement (dds::core::policy::TypeConsistencyEnforcementKind the_kind)
 Creates an instance with a specific enforcement kind.
 
TypeConsistencyEnforcementkind (dds::core::policy::TypeConsistencyEnforcementKind value)
 Sets the enforcement kind.
 
dds::core::policy::TypeConsistencyEnforcementKind kind () const
 Gets the enforcement kind.
 

Static Public Member Functions

static TypeConsistencyEnforcement AllowTypeCoercion ()
 Creates an instance with TypeConsistencyEnforcementKind::ALLOW_TYPE_COERCION.
 
static TypeConsistencyEnforcement DisallowTypeCoercion ()
 Creates an instance with TypeConsistencyEnforcementKind::DISALLOW_TYPE_COERCION.
 

Detailed Description

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: TypeConsistencyKind::DISALLOW_TYPE_COERCION and TypeConsistencyKind::ALLOW_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. If the DataReader does not allow type coercion, then its type must be structurally identical 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 dds::core::status::InconsistentTopicStatus is updated.

The default enforcement kind is TypeConsistencyKind::ALLOW_TYPE_COERCION. However, when the middleware is introspecting the built-in topic data declaration of a remote DataReader in order to determine whether it can match with a local DataWriter, if it observes that no TypeConsistencyEnforcementQosPolicy value is provided (as would be the case when communicating with a Service implementation not in conformance with this specification), it assumes a kind of TypeConsistencyKind::DISALLOW_TYPE_COERCION.

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.

Entity:
dds::sub::DataReader
Properties:
RxO = N/A
Changeable = UNTIL ENABLE

Constructor & Destructor Documentation

dds::core::policy::TypeConsistencyEnforcement::TypeConsistencyEnforcement ( )
inline

Creates the default policy.

dds::core::policy::TypeConsistencyEnforcement::TypeConsistencyEnforcement ( dds::core::policy::TypeConsistencyEnforcementKind  the_kind)
inlineexplicit

Creates an instance with a specific enforcement kind.

Member Function Documentation

TypeConsistencyEnforcement& dds::core::policy::TypeConsistencyEnforcement::kind ( dds::core::policy::TypeConsistencyEnforcementKind  value)
inline

Sets the enforcement kind.

[default] TypeConsistencyKind::ALLOW_TYPE_COERCION

dds::core::policy::TypeConsistencyEnforcementKind dds::core::policy::TypeConsistencyEnforcement::kind ( ) const
inline

Gets the enforcement kind.

static TypeConsistencyEnforcement dds::core::policy::TypeConsistencyEnforcement::AllowTypeCoercion ( )
inlinestatic

Creates an instance with TypeConsistencyEnforcementKind::ALLOW_TYPE_COERCION.

static TypeConsistencyEnforcement dds::core::policy::TypeConsistencyEnforcement::DisallowTypeCoercion ( )
inlinestatic

Creates an instance with TypeConsistencyEnforcementKind::DISALLOW_TYPE_COERCION.


RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc