RTI Routing Service Version 7.1.0
RTI Routing Service Adapter API

This module describes the C++ Adapter API. More...

Data Structures

class  rti::routing::adapter::AdapterPlugin
 The top-level plug-in class. More...
 
class  rti::routing::adapter::Connection
 A Connection provides access to a data domain (such as a DDS domain or a JMS network provider). More...
 
class  StreamReaderListener
 Listener representation used by StreamReader to notify RTI Routing Service when new data is available. More...
 
class  rti::routing::adapter::DiscoveryStreamReader
 Definition of a special StreamReader to read information about data streams. More...
 
class  rti::routing::adapter::Session
 
class  rti::routing::adapter::StreamReader
 Provides a way to read samples of a specific type from a data domain. In the XML configuration file, StreamReaders are associated with the tag <input> within <route> and <auto_route>. More...
 
class  rti::routing::adapter::TStreamReader< Data, Info >
 A wrapper implementation of a StreamReader that provides a strongly-typed interface through template parameters for data and info representation. More...
 
class  rti::routing::adapter::NoOpStreamReader< Data, Info >
 An empty implementation of the TStreamReader interface. More...
 
class  rti::routing::adapter::SelectorState
 Defines a set of attributes that can be used to read a subset of data from StreamReader. More...
 
class  rti::routing::adapter::StreamWriter
 Provides a way to write samples of a specific type in a data domain. More...
 
class  rti::routing::adapter::TStreamWriter< Data, Info >
 A wrapper implementation of a StreamWriter that provides a strongly-typed interface through template parameters for data and info representation. More...
 

Macros

#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL(ADAPTER_CLASS)
 Utility macro that declares a native extern function that can be used to load an AdapterPlugin through a shared library. More...
 
#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DEF(ADAPTER_CLASS)
 Utility macro that implements the AdapterPlugin entry point declared with RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL. More...
 

Typedefs

typedef NoOpStreamReader< dds::core::xtypes::DynamicData, dds::sub::SampleInfo > rti::routing::adapter::DynamicDataStreamReader
 Convenient definition of typed StreamReader that requires dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo for info samples. More...
 
typedef TStreamWriter< dds::core::xtypes::DynamicData, dds::sub::SampleInfo > rti::routing::adapter::DynamicDataStreamWriter
 Convenient definition of typed StreamWriter that requires dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo for info samples. More...
 

Detailed Description

This module describes the C++ Adapter API.

Adapters are pluggable components that allow RTI Routing Service to consume and produce data for different data domains (e.g., Connext DDS, MQTT, Socket, etc.).

By default, Routing Service is distributed with a builtin DDS adapter. Any other adapter plugins must be provided as external components registered through the XML configuration or through the Library API.

The following figure shows an overview of the Routing Service adapter.

Input adapters are used to collect data samples from different data domains, such as DDS or MQTT. The input samples are processed by the Routing Service engine and are passed along to output adapters through the Processor, applying any Transformation beforehand if present.

For additional details about Adapter configuration see the RTI Routing Service User's Manual.

Development Requirements

Linux/macOS Systems Windows Systems
Shared Libraries libnddscpp2.so nddscpp2.dll
librtirsinfrastructure.so rtirsinfrastructure.dll
libnddsc.so nddsc.dll
libnddscore.so nddscore.dll
Headers rti/routing/adapter/AdapterPlugin.hpp

Architecture

The Adapter architecture is shown in the class diagram below.

The sequence diagram in this figure shows when the different adapter entities are created.

Stream Discovery

A Route cannot forward data until the type representations (e.g., TypeCode) associated with the input and output streams are available.

If a Route refers to types that are not defined in the configuration file, RTI Routing Service has to discover their type representation (e.g., TypeCode) before creating the StreamReader and StreamWriter. The adapter discovery API is used to provide stream and type information in a data domain to Routing Service*.

The discovery API consists of the following methods:

These methods provide access to StreamReader used to discover streams in the data domain associated with a connection.

The input stream discovery StreamReader provides information about input streams. An input stream is a stream from which an input's StreamReader reads data. Notification of disposed scenarios, where an input stream disappears, are also made using the input stream discovery StreamReader.

In the builtin DDS adapter, the input stream discovery StreamReader is associated with the publication builtin DataReader of the DomainParticipant.

The output stream discovery StreamReader provides information about output streams. An output stream is a stream to which an output's StreamWriter can write data. Notification of disposed scenarios, where an output stream disappears, are also made using the output stream discovery StreamReader.

In the builtin DDS adapter, the output stream discovery StreamReader is associated with the subscription builtin DataReader of the DomainParticipant.

The samples provided by the stream discovery StreamReaders have the type rti::routing::StreamInfo.

Macro Definition Documentation

◆ RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL

#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL (   ADAPTER_CLASS)
Value:
extern "C" RTI_USER_DLL_EXPORT struct RTI_RoutingServiceAdapterPluginExt * \
ADAPTER_CLASS ## _create_adapter_plugin(\
const struct RTI_RoutingServiceProperties *, \
RTI_RoutingServiceEnvironment *); \

Utility macro that declares a native extern function that can be used to load an AdapterPlugin through a shared library.

The prototype of the function is given by RTI_RoutingServiceAdapterPlugin_CreateFcn.

To register an AdapterPlugin plugin with RTI Routing Service, you must use the tag <adapter_plugin> within <plugin_library>. For example:

<dds>
...
<plugin_library name="MyPluginLib">
<adapter_plugin name="MyAdapterPlugin">
<dll>mycadapter</dll>
<create_function>
MyAdapterPlugin_create
</create_function>
</adapter_plugin>
...
</plugin_library>
...
<routing_service>
...
</routing_service>
...
</dds>

Once an AdapterPlugin is registered, a Connection can refer to it as follows:

For example:

<dds>
<routing_service name="example">
<domain_route name="myadapter_to_dds">
<connection name="MyConnection" plugin_name="MyAdapter">
<property>
<value>
<element>
<name>my_property_name</name>
<value>my_property_value</value>
</element>
</value>
</property>
</connection>
...
</domain_route>
</routing_service>
</dds>

For additional information on configuring adapters, see the RTI Routing Service User's Manual.

Parameters
ADAPTER_CLASSClass name of an AdapterPlugin implementation

◆ RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DEF

#define RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DEF (   ADAPTER_CLASS)
Value:
struct RTI_RoutingServiceAdapterPluginExt * ADAPTER_CLASS ## _create_adapter_plugin( \
const struct RTI_RoutingServiceProperties * native_properties, \
RTI_RoutingServiceEnvironment *environment) \
{ \
PropertySet properties; \
rti::routing::PropertyAdapter::add_properties_from_native(\
properties,\
native_properties); \
try { \
return rti::routing::adapter::detail::AdapterForwarder::create_plugin(new ADAPTER_CLASS(properties)); \
} catch (const std::exception& ex) {\
RTI_RoutingServiceEnvironment_set_error(\
environment,\
"%s",\
ex.what());\
} catch (...) {}\
\
return NULL; \
}

Utility macro that implements the AdapterPlugin entry point declared with RTI_ADAPTER_PLUGIN_CREATE_FUNCTION_DECL.

Typedef Documentation

◆ DynamicDataStreamReader

typedef NoOpStreamReader<dds::core::xtypes::DynamicData, dds::sub::SampleInfo> rti::routing::adapter::DynamicDataStreamReader

Convenient definition of typed StreamReader that requires dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo for info samples.

◆ DynamicDataStreamWriter

typedef TStreamWriter<dds::core::xtypes::DynamicData, dds::sub::SampleInfo> rti::routing::adapter::DynamicDataStreamWriter

Convenient definition of typed StreamWriter that requires dds::core::xtypes::DynamicData for data samples and dds::sub::SampleInfo for info samples.