How data is stored or laid out in memory can vary from language to language, compiler to compiler, operating system to operating system, and processor to processor. This combination of language/compiler/operating system/processor is called a platform. Any modern middleware must be able to take data from one specific platform (say C/gcc.3.2.2/Solaris/Sparc) and transparently deliver it to another (for example, Java/JDK 1.6/Windows/Pentium). This process is commonly called serialization/deserialization, or marshalling/demarshalling.
Messaging products have typically taken one of two approaches to this problem:
The “do nothing” approach is lightweight on its surface but forces you, the user of the middleware API, to consider all data encoding, alignment, and padding issues. The “send everything” alternative results in large amounts of redundant information being sent with every packet, impacting performance.
Connext DDS takes an intermediate approach. Just as objects in your application program belong to some data type, DDS data samples sent on the same Connext DDS topic share a data type. This type defines the fields that exist in the DDS data samples and what their constituent types are. The middleware stores and propagates this meta-information separately from the individual DDS data samples, allowing it to propagate DDS samples efficiently while handling byte ordering and alignment issues for you.
To publish and/or subscribe to data with Connext DDS, you will carry out the following steps:
You have a number of choices. You can choose one of these options, or you can mix and match them.
This option may be sufficient if your data typing needs are very simple. If your data is highly structured, or you need to be able to examine fields within that data for filtering or other purposes, this option may not be appropriate. The built-in types are described in Built-in Data Types.
Code generation offers two strong benefits not available with dynamic type definition: (1) it allows you to share type definitions across programming languages, and (2) because the structure of the type is known at compile time, it provides rigorous static type safety.
The RTI Code Generator accepts input the following formats:
This method may be appropriate for applications with dynamic data description needs: applications for which types change frequently or cannot be known ahead of time. It is described in Defining New Types.
If you've chosen to use a built-in type instead of defining your own, you can omit this step; the middleware pre-registers the built-in types for you.
This step is described in the Defining New Types.
If you've chosen to use a built-in type instead of defining your own, you will use the API constant corresponding to that type's name.
Creating and working with Topics is discussed in Topics.
The concrete types of these objects depend on the concrete data type you've selected, in order to provide you with a measure of type safety.
Creating and working with DataWriters and DataReaders are described in Sending Data and Receiving Data, respectively.
Whether publishing or subscribing to data, you will need to know how to create and delete DDS data samples and how to get and set their fields. These tasks are described in Working with DDS Data Samples.
This section describes:
Introduction to the Type System
Creating User Data Types with IDL
Creating User Data Types with Extensible Markup Language (XML)
Using RTI Code Generator (rtiddsgen)
Using Generated Types without Connext DDS (Standalone)
© 2015 RTI