This example shows how to use DDS-XML Application Creation to define data-oriented interfaces and develop a modular distributed system architecture.
The example shows how to use DDS-XML with
- Compiled types with implementations in multiple languages
- Modern C++ API (C++11)
- Traditional C++ API (C++98)
- Dynamic types using the
rtiddsprototyper
(suitable for blackbox testing)
The datatypes used by this example are defined in the file res/types/ShapeType.idl, and compatible with those used by the RTI Shapes Demo.
The data-oriented inteterfaces using DDS-XML App Configuration are defined in the file if/Shapes_if.xml.
The NDDS_QOS_PROFILES
environment variable specifies the list of XML files to
be loaded automatically before a domain participant is created.
rtiddsgen -ppDisable -convertToXml -d res/types res/types/ShapeType.idl
Modern C++ (C++11):
rtiddsgen -ppDisable -language C++11 -unboundedSupport -stl -update typefiles -d src/c++11 res/types/ShapeType.idl
Traditional C++ (C++98):
rtiddsgen -ppDisable -language C++ -unboundedSupport -namespace -useStdString -update typefiles -d src/cpp res/types/ShapeType.idl
-
Determine your platform
For, example on Mac OSX:
export CONNEXTDDS_ARCH=x64Darwin17clang9.0
-
Generate makefile (needed for C++)
Modern C++ (C++11):
rtiddsgen -ppDisable -language C++11 -unboundedSupport -stl -platform $CONNEXTDDS_ARCH -update makefiles -d src/c++11 res/types/ShapeType.idl
Traditional C++ (C++98):
rtiddsgen -ppDisable -language C++ -unboundedSupport -namespace -useStdString -platform $CONNEXTDDS_ARCH -update makefiles -d src/cpp res/types/ShapeType.idl
-
Create a soft-link to the generated makefile (
makefile -> makefile_ShapeType_<platform>
)cd src/c++11 # OR cd src/cpp ln -s makefile_ShapeType_$CONNEXTDDS_ARCH makefile cd ../..
From the top-level directory (containing this README):
make
Ensure that the environment variable NDDS_QOS_PROFILES
list the DDS-XML files
to be loaded.
export NDDS_QOS_PROFILES="res/qos/endpoint_qos.xml;res/qos/participant_qos.xml;res/qos/Shapes_qos.xml;if/Shapes.xml"
Run the components from the top-level directory (containing this README) as follows.
-
c++11
./src/c++11/objs/$CONNEXTDDS_ARCH/ShapeType_publisher
-
c++98
./src/cpp/objs/$CONNEXTDDS_ARCH/ShapeType_publisher
-
lua
rtiddsprototyper -cfgName ShapesIfLib::Shapes_Pub -luaFile src/lua/ShapeType_publisher.lua
-
c++11
./src/c++11/objs/$CONNEXTDDS_ARCH/ShapeType_subscriber
-
c++98
./src/cpp/objs/$CONNEXTDDS_ARCH/ShapeType_subscriber
-
lua
rtiddsprototyper -cfgName ShapesIfLib::Shapes_Sub -luaFile src/lua/ShapeType_subscriber.lua
- Run the RTI Admin Console to view the domain
- Run the RTI Shapes Demo to publish and subscribe to shapes