3.1 Generate Connext Project

  1. Run <NDDSHOME>/resource/scripts/rtisetenv_<architecture>.<shell> in a new command prompt window, to avoid issues with paths and licensing.
  2. <architecture> depends on your target machine (where you will deploy your completed application), and <shell> depends on the shell you are using (bash, zsh, bat…). Architecture strings are listed in the RTI Connext Core Libraries Platform Notes. Examples are x64Win64VS2017 and x64Linux4gcc7.3.0.

    (See Set Up Environment Variables (rtisetenv), in the RTI Connext Getting Started Guide.)

  3. Create an IDL file. For example, you may want to use the following (save it as ExampleLBED.idl):
  4. struct ExampleLBED {
        long data;
    };
  5. Run RTI Code Generator (rtiddsgen). This guide uses the Modern C++ programming language as reference. The steps are the same for the other supported languages. Feel free to choose the language that best suits your needs. It is recommended you generate an advanced example, if supported by your language and platform; the required code modifications that will be made later in this chapter will be easier if you use the advanced example. For a brief introduction to Code Generator, see Run Code Generator, in the RTI Connext Getting Started Guide. Full details are in the RTI Code Generator User's Manual.
  6. For Linux® systems:

    $ rtiddsgen -example <architecture> -language C++11 -exampleTemplate advanced ExampleLBED.idl

    For Windows® systems:

    > rtiddsgen -example <architecture> -language C++11 -exampleTemplate advanced -ppDisable ExampleLBED.idl

The generated example will be composed of the following files:

Table 3.1 Modern C++ Files Created for “ExampleLBED.idl

Generated Files

Description

ExampleLBED.hpp
ExampleLBED.cxx
ExampleLBEDPlugin.hpp
ExampleLBEDPlugin.cxx

Support for the generated type in C++11.

ExampleLBED_publisher.cxx

ExampleLBED_subscriber.cxx

Example Publisher and Subscriber applications.

Contains a DomainParticipant with a single DataWriter/DataReader for the type defined in ExampleLBED.idl.

application.hpp

Provides common utilities to the publisher and subscriber applications, like setting the verbosity and parsing the command-line arguments.

README_<architecture>.txt

See this README for instructions on how to open and modify the files.

Makefiles and Visual Studio® project files (for Windows applications)

Architecture-dependent build files.

USER_QOS_PROFILES.xml

The Quality of Service (QoS) configuration of the DDS entities in the generated example is loaded from this file.

The required configuration for using LBED in your application, as well as the static information of the endpoints, can be specified here.

In the following sections, some of the generated files mentioned above will be modified for using the Limited Bandwidth Endpoint Discovery Plugin.

Note: The completed XML file that we will be creating in this Getting Started exercise, if you follow the 3.5.1 Using the USER_QOS_PROFILES.xml option, can be found in <path to examples>/connext_dds/c++11/limited_bandwidth_plugins/lbediscovery/USER_QOS_PROFILES.xml, for your reference.