RTI Connext .NET API (legacy)  Version 6.1.2

Generates source code from data types declared in IDL, XML, or XSD files. More...

Generates source code from data types declared in IDL, XML, or XSD files.

Generates code necessary to allocate, send, receive, and print user-defined data types.

Usage

The code generator tool can be executed using the rtiddsgen script located under <RTI Connext Home>/bin or by clicking on the "Code generator" button in the Utility tab of RTI Connext Launcher.

For information on command-line parameters:

Description

rtiddsgen takes a language-independent specification of the data (in IDL, XML, or XSD notation) and generates supporting classes and code to distribute instances of the data over RTI Connext.

To use rtiddsgen, you must first write a description of your data types in IDL, XML, or XSD format.

C++ Example

The following is an example that generates the RTI Connext type myDataType:

IDL notation

struct myDataType {
    long value;
};

XML notation

<?xml version="1.0" encoding="UTF-8"?>
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="rti_dds_topic_types.xsd">
    <struct name="myDataType">
        <member name="value" type="long"/>
    </struct>
</types>

XSD notation

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dds="http://www.omg.org/dds" xmlns:tns="http://www.omg.org/IDL-Mapped/" targetNamespace="http://www.omg.org/IDL-Mapped/"> 
    <xsd:import namespace="http://www.omg.org/dds" schemaLocation="rti_dds_topic_types_common.xsd"/>
    <xsd:complexType name= "myDataType">
        <xsd:sequence>
            <xsd:element name="value" minOccurs="1" maxOccurs="1" type="xsd:int"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>

Assuming the name of the IDL file is myFileName.(idl|xml|xsd), all you need to do is type:

rtiddsgen myFileName.(idl|xml|xsd)

This generates myFileName.cxx, myFileName.h, myFileNamePlugin.cxx, myFileNamePlugin.h, myFileNameSupport.cxx and myFileNameSupport.h. By default, rtiddsgen will not overwrite these files. You must use the -replace argument to do that.

IDL Language

In the IDL language, data types are described in a fashion almost identical to structures in "C." The complete description of the language can be found at the OMG website.

For detailed information about IDL support in RTI Connext see Chapter 3 in the User's Manual.

XML Language

The data types can be described using XML.

RTI Connext provides DTD and XSD files that describe the XML format.

The DTD definition of the XML elements can be found in rti_dds_topic_types.dtd under <NDDSHOME>/resource/app/app_support/rtiddsgen/schema.

The XSD definition of the XML elements can be found in rti_dds_topic_types.xsd under <NDDSHOME>/resource/app/app_support/rtiddsgen/schema.

The XML validation performed by rtiddsgen always uses the DTD definition. If the <!DOCTYPE> tag is not present in the XML file, rtiddsgen will look for the DTD document under <NDDSHOME>/resource/app/app_support/rtiddsgen/schema. Otherwise, it will use the location specified in <!DOCTYPE>.

XSD Language

The data types can be described using XSD.

For detailed information about XSD support in RTI Connext see Chapter 3 in the User's Manual.

For detailed information about the mapping between IDL, XML, and XSD see Chapter 3 in the User's Manual.

Using Generated Types Without RTI Connext (Standalone)

You can use the generated type-specific source and header files without linking the RTI Connext libraries or even including the RTI Connext header files. That is, the generated files for your data types can be used standalone.

The directory <NDDSHOME>resource/app/app_support/rtiddsgen/standalone/include contains the helper files required to work in standalone mode:

Using Standalone Types in C

The generated files that can be used standalone are:

You cannot use the type plug-in (<idl file>Plugin.c <idl file>Plugin.h) or the type support (<idl file>Support.c <idl file>Support.h) code standalone.

To use the rtiddsgen-generated types in a standalone manner:

Using Standalone Types in C++

The generated files that can be used standalone are:

You cannot use the type plugin (<idl file>Plugin.cxx <idl file>Plugin.h) or the type support (<idl file>Support.cxx <idl file>Support.h) code standalone.

To use the generated types in a standalone manner:

Standalone Types in Java

The generated files that can be used standalone are:

You cannot use the type code (<idl file>TypeCode.java), the type support (<idl type>TypeSupport.java), the data reader (<idl file>DataReader.java) or the data writer code (<idl file>DataWriter.java) standalone.

To use the generated types in a standalone manner: