Download User`s Manual - Community RTI Connext Users

Transcript
Chapter 3 Data Types and DDS Data Samples
1. Select a type to describe your data.
You have a number of choices. You can choose one of these options, or you can mix and match
them.
l Use a built-in type provided by the middleware.
l
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 (Section 3.2 on page 29).
Use the RTI Code Generator to define a type at compile-time using a language-independent
description language.
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:
l
l
l
OMG IDL. This format is a standard component of both the DDS and CORBA specifications. It describes data types with a C++-like syntax. This format is described in
Creating User Data Types with IDL (Section 3.3 on page 67).
XML in a DDS-specific format. This XML format is terser, and therefore easier to
read and write by hand, than an XSD file. It offers the general benefits of XML-extensibility and ease of integration, while fully supporting DDS-specific data types and concepts. This format is described in Creating User Data Types with Extensible Markup
Language (XML) (Section 3.4 on page 119).
Define a type programmatically at run time.
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 (Section 3.7.2 on page 129).
2. Register your type with a logical name.
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 (Section 3.7.2 on page 129).
3. Create a Topic using the type name you previously registered.
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 (Section Chapter 5 on page 194).
24