RTI Connext Modern C++ API  Version 6.1.2
Namespaces and headers

This section describes the headers and namespaces in the modern C++ API.

Header Files

The modern C++ API is organized using a set of standard header files that you will find in the $NDDSHOME/include/hpp/dds directory of your installation. The headers in this directory are organized into 5 modules defined by the DDS v1.2 Platform Independent Mapping (PIM):

You will also find an $NDDSHOME/include/hpp/rti directory in your installation. This directory contains RTI Connext implementation specific details along with extensions to the standard API.

To import the DDS API into your application you must include these header files. There are several ways to do this:

  1. Include the entire standard API:
    #include <dds/dds.hpp>
  2. Include the standard API plus all the extensions:
    #include <rti/rti.hpp>
  3. Include complete namespaces, for example:
    #include <dds/domain/ddsdomain.hpp>
    #include <dds/sub/ddssub.hpp>
  4. Include individual headers, for example:
    #include <dds/domain/DomainParticipant.hpp>
    #include <dds/sub/DataReader.hpp>

All of the Programming How-To pages start with a section showing which header that the code snippets on that page require.

Namespaces

There are a number of different namespaces in the modern C++ API that organize the API into logical groups. The two main namespaces are dds and rti.

The dds namespace includes all of the standard types, classes and methods. The rti namespace includes all RTI extensions to the standard API.


namespaces.png
The dds namespace.


The dds and rti namespaces both contain several nested namespaces. There is a namespace for each of the 5 modules: dds::core, dds::domain, dds::topic, dds::pub, dds::sub (and the corresponding rti::core, rti::domain, rti::topic, rti::pub, rti::sub).

The rti namespace also contains rti::util and rti::config.

There are further specialized namespaces within each module namespace.

All of the modules, excluding core, contain a qos namespace that contains the Qos classes for the entities contained in that module:

All of the individual Qos policies can be accessed from either the dds::core::policy namespace for standard Qos policies or the rti::core::policy namespace for RTI extension Qos policies.

In addition to the policy namespace, the core namespace contains two other nested namespaces.

The sub namespace also contains the status and cond nested namespaces.

Two convenience namespaces bring all the symbols into a single place: dds::all and rti::all.