RTI Connext Modern C++ API  Version 5.2.3
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rtiddsgen

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

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

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

See Also
Working with IDL types

Usage

  rtiddsgen [-help]
                 [-autoGenFiles <arch>]
                 [-convertToIdl | -convertToXml]
                 [-corba [client header file] [-orb <CORBA C++ ORB>]]
                 [-create <typefiles, examplefiles,makefiles>]
                 [-D <name>[=<value>]]
                 [-d <outdir>]
                 [-dataReaderSuffix <Suffix>]
                 [-dataWriterSuffix <Suffix>]
                 [-dllExportMacroSuffix <suffix>]
                 [-enableEscapeChar]
                 [-example <arch>]
                 [-I <directory>]
                 [[-inputIdl] <IDLInputFile.idl> |
                  [-inputXml] <XMLInputFile.xml>] |
                 [-language <C|C++|C++03|C++11|Java|C++/CLI|C#|Ada|microC|microC++>]
                 [-metp]
                 [-micro]
                 [-namespace]
                 [-noCopyable]
                 [-notypecode]
                 [-obfuscate]
                 [-package <packagePrefix>]
                 [-platform <arch>]
                 [-ppDisable]
                 [-ppPath <path to the preprocessor>]
                 [-ppOption <option>]
                 [-reader]
                 [-replace]
                 [-sequenceSize <Unbounded sequences size>]
                 [-sharedLib]
                 [-stringSize <Unbounded strings size>]
                 [-typeSequenceSuffix <Suffix>]
                 [-U <name>]
                 [-unboundedSupport]
                 [-update <typefiles, examplefiles,makefiles>]
                 [-use42eAlignment]
                 [-V <name>[=<value>]]
                 [-verbosity <1-3>]
                 [-version]
                 [-writer]

-help: Prints this message

-autoGenFiles <arch>: Updates the autogenerated files, i.e, typefiles and makefile/project files shortcut for: -update <typefiles> -update<makefiles> -platform <arch>

-convertToIdl: Convert the input XML file into an equivalent IDL file

-convertToXml: Convert the input IDL file into an equivalent XML file

-corba [client header file] [-orb <CORBA orb>="">]: Produces CORBA-compliant code Use [client header file] and [-orb <CORBA orb>="">] for C++ only. The majority of code generated is independent of the ORB. However, for some IDL features the code generated depends on the ORB. This version of rtiddsgen generates code compatible with ACE-TAO or JacORB. To pick the ACE_TAO version, use the -orb parameter. The default is ACE_TAO1.6

-create <typefiles|examplefiles|makefiles>: Creates the files indicated if they do not exist. Warns and does not modify if they already exist. There can be multiple -create options. If used as -create<makefiles>, the -platform <arch> option is required If both -create and -update are specified for the same file type, -update will be applied.

-D <name>[=<value>]: Defines preprocessor macros

-d <outdir>: Generates output in the specified file (default: IDL input file's directory)

-dataReaderSuffix <Suffix>: Assigns a suffix to the name of the DataReader interface. The option is valid only for CORBA code generation. By default, the suffix is 'DataReader'. For example, given the type 'Foo', the name of the DataReader interface would be 'FooDataReader'

-dataWriterSuffix <Suffix>: Assigns a suffix to the name of the DataWriter interface. The option is valid only for CORBA code generation. By default, the suffix is 'DataWriter'. For example, given the type 'Foo', the name of the DataWriter interface would be 'FooDataWriter'

-enableEscapeChar: Enables use of the escape character '_' in IDL identifiers.

-example <arch>: Generates type files, example files, and makefile shortcut for: -create <typefiles> -create<examplefiles> -create<makefiles> -platform <arch>

For a list of current valid <arch> arguments run rtiddsgen -help

For a current list specific architectures and languages supported by your version of rtiddsgen, run 'rtiddsgen -help' on your host system.

For all example publisher & subscriber that will build on all supported architectures use the keyword 'universal' (universal will not generate makefiles or project files).

-I <directory>: Adds the directory to the list of directories to be searched for header files

-inputIdl <IDL file>: Indicates that the input file is an IDL file, regardless of the file extension

-inputXml <XML file>: Indicate that the input file is a XML file, regardless of the file extension

-language <C|C++|C++03|C++11|Java|C++/CLI|C#|Ada|microC|microC++>: Generates output for one of: C (Connext DDS or Connext DDS Micro), C++ (default or Connext DDS Micro), C++03, C++11, C++/CLI, C#, Java or Ada

C++ generates code for the traditional C++ API.

C++03 and C++11 generate code for the modern C++ API. C++03 and C++11 only differ when the option -example is also specified. In that case, using C++11 has the following effects:

Use of generated Ada code requires installation of RTI Ada Language Support. Please contact suppo.nosp@m.rt@r.nosp@m.ti.co.nosp@m.m for more information.

Languages microC and microC++ are supported for backwards compatibility. Users wishing to generate code for RTI Connext Micro should use languages C/C++ along with the -micro option.

-metp Generates code for the Multi-Encapsulation Type Support (METP) library

-micro: Generates code and support files for Connext DDS Micro, instead of Connext DDS. Use "-micro -help" to list command line arguments supported by rtiddsgen when targeting RTI Connext DDS Micro.

-namespace: This parameter should be included to use C++ namespaces when the language option is C++

-noCopyable: Forces rtiddsgen to put copy logic into the corresponding TypeSupport class rather than the type itself. This option is only used for Java code generation. This option is not compatible with the use of ndds_standalone_type.jar

-notypecode: Do not generate type code information

-obfuscate: obfuscates the input IDL file

-package <packagePrefix>: Uses <packagePrefix> as the root package (Java only)

-platform <arch>: Required if you use -create makefiles or -update makefiles Valid <arch> arguments are the same as for -example <arch> (See above)

-ppDisable: Disables running the preprocessor

-ppPath <path to the preprocessor>: Preprocessor path The default value is "cpp" for non-Windows architectures and "cl.exe" for Windows architectures. -ppOption <option>: Preprocessor option

-reader: Generates support for DataReader (only with -micro).

-replace: Deprecated option. Please use -update for the proper files (typefiles, examplefiles, makefiles). This option is maintained for backwards compatibility. It allows rtiddsgen to overwrite any existing generated files. If it is not present and existing files are found, rtiddsgen will print a warning but will not overwriten them

-sequenceSize <Unbounded sequences size>: Assigns Size to unbounded sequences. The default value is 100

-sharedLib: Generates makefile compiling with the dynamic libraries

-stringSize <Unbounded strings size>: Assigns size to unbounded strings. The default value is 255

-typeSequenceSuffix <Suffix>: Assigns a suffix to the name of the implicit sequence defined for IDL types. The option is valid only for CORBA code generation. By default, the suffix is 'Seq'. For example, given the type 'Foo' the name of the sequence would be 'FooSeq'

-U <name>: Cancels any previous definition of name

-unboundedSupport Generates code that supports unbounded sequences and strings

This option is only supported with the C, C++, C++/CLI, and C# languages.

When the option is used, the command-line options -sequenceSize and -stringSize are ignored.

This option also affects the way unbounded sequences are deserialized. When a sequence is being received into a sample from the DataReader's cache, the old memory for the sequence will be deallocated and memory of sufficient size to hold the deserialized data will be allocated. When initially constructed, sequences will not preallocate any elements having a maximum of zero elements.

-update <typeFiles|exampleFiles|makefiles>: Creates the files indicated if they don not exist. Overwrites the file without warning if it already exists. There can be multiple -update options If both -create and -update are specified for the same file type, -update will be applied. If used as -update<makefiles>, the -platform <arch> option is required

-use42eAlignment: The generated code uses RTI Data Distribution Service 4.2e alignment. This option should be used when compatibility with 4.2e is required and the topic data types contain double , long long, or long double members. The usage of this option also requires setting the following properties to 1 in the DataWriter and DataReader QoS:

-V <name>[=<value>]: Defines a user variable that can be used in the templates as $userVarList.name or $userVarList.name.equals(value)

-verbosity [1-3]: Sets rtiddsgen verbosity 1: exceptions 2: exceptions + warnings 3: exceptions + warnings + information The default value is 3

-version: Prints the version

-writer: Generates support for DataWriter (only with -micro).

Description

rtiddsgen takes a language-independent specification of the data (in IDL or XML 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 or XML 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>

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

rtiddsgen myFileName.(idl|xml)

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.

rtiddsgen does not support the full IDL language.

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

The supported IDL types are:

The following non-IDL types are also supported:

Use of Unsupported Types in an IDL File

You may include unsupported data types in the IDL file. rtiddsgen does not consider this an error. This allows you to use types that are defined in non-IDL languages with either hand-written or non-rtiddsgen written plug-ins. For example, the following is allowable:

//@copy #include "Bar.h"
//@copy #include "BarHandGeneratedPlugin.h"
struct Foo {
short height;
Bar barMember;
};

In the above case, Bar is defined externally by the user.

Multiple Types in a Single File

You can specify multiple types in a single IDL file. This can simplify management of files in your distributed program.

Use of Directives in an IDL File

The following directives can be used in your IDL file: Note: Do not put a space between the slashes and the @ sign. Note: Directives are case-sensitive (for example: use key, not Key).

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>.

For detailed information about the mapping between IDL and XML, 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:


RTI Connext Modern C++ API Version 5.2.3 Copyright © Wed Apr 27 2016 Real-Time Innovations, Inc