From c59a09af88deaeafd004290938f841e4b9f26e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20N=C3=BA=C3=B1ez?= Date: Tue, 23 Jul 2024 11:41:02 +0200 Subject: [PATCH] EVALG-77: Initial C++11 example --- .../application_design/c++11/CMakeLists.txt | 83 +++++++++++++++++++ .../VehicleModeling_metrics_publisher.cxx | 20 +++++ .../VehicleModeling_metrics_subscriber.cxx | 21 +++++ .../VehicleModeling_transit_publisher.cxx | 20 +++++ .../VehicleModeling_transit_subscriber.cxx | 22 +++++ 5 files changed, 166 insertions(+) create mode 100644 tutorials/application_design/c++11/CMakeLists.txt create mode 100644 tutorials/application_design/c++11/VehicleModeling_metrics_publisher.cxx create mode 100644 tutorials/application_design/c++11/VehicleModeling_metrics_subscriber.cxx create mode 100644 tutorials/application_design/c++11/VehicleModeling_transit_publisher.cxx create mode 100644 tutorials/application_design/c++11/VehicleModeling_transit_subscriber.cxx diff --git a/tutorials/application_design/c++11/CMakeLists.txt b/tutorials/application_design/c++11/CMakeLists.txt new file mode 100644 index 000000000..dd6ca77df --- /dev/null +++ b/tutorials/application_design/c++11/CMakeLists.txt @@ -0,0 +1,83 @@ +# +# (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +# +# RTI grants Licensee a license to use, modify, compile, and create derivative +# works of the Software. Licensee has the right to distribute object form +# only for use with RTI products. The Software is provided "as is", with no +# warranty of any type, including any warranty for fitness for any purpose. +# RTI is under no obligation to maintain or support the Software. RTI shall +# not be liable for any incidental or consequential damages arising out of the +# use or inability to use the software. +# + +cmake_minimum_required(VERSION 3.11) +project(connext-tutorial-application-design) +list(APPEND CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/../../../resources/cmake/Modules" +) +include(ConnextDdsConfigureCmakeUtils) +connextdds_configure_cmake_utils() + +# Include ConnextDdsAddExample.cmake from resources/cmake +include(ConnextDdsAddExample) + +connextdds_rtiddsgen_convert( + INPUT "VehicleModeling.xml" + FROM XML + TO IDL +) + +connextdds_call_codegen( + IDL_FILE "VehicleModeling.xml" + LANG "C++11" + PREFIX "VehicleModeling" +) + +connextdds_rtiddsgen_run( + IDL_FILE + "${CMAKE_CURRENT_SOURCE_DIR}/../VehicleModeling.xml" + OUTPUT_DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/" + LANG C++11 +) + + +connextdds_add_application( + TARGET "transit_publisher" + LANG "C++11" + OUTPUT_NAME "VehicleModeling_transit_publisher" + SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/VehicleModeling_transit_publisher.cxx" + DEPENDENCIES + ${_CONNEXT_DEPENDENCIES} +) + +connextdds_add_application( + TARGET "transit_subscriber" + LANG "C++11" + OUTPUT_NAME "VehicleModeling_transit_subscriber" + SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/VehicleModeling_transit_subscriber.cxx" + DEPENDENCIES + ${_CONNEXT_DEPENDENCIES} +) + +connextdds_add_application( + TARGET "metrics_subscriber" + LANG "C++11" + OUTPUT_NAME "VehicleModeling_metrics_subscriber" + SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/VehicleModeling_metrics_subscriber.cxx" + DEPENDENCIES + ${_CONNEXT_DEPENDENCIES} +) + +connextdds_add_application( + TARGET "metrics_publisher" + LANG "C++11" + OUTPUT_NAME "VehicleModeling_metrics_publisher" + SOURCES + "${CMAKE_CURRENT_SOURCE_DIR}/VehicleModeling_metrics_publisher.cxx" + DEPENDENCIES + ${_CONNEXT_DEPENDENCIES} +) diff --git a/tutorials/application_design/c++11/VehicleModeling_metrics_publisher.cxx b/tutorials/application_design/c++11/VehicleModeling_metrics_publisher.cxx new file mode 100644 index 000000000..404964fea --- /dev/null +++ b/tutorials/application_design/c++11/VehicleModeling_metrics_publisher.cxx @@ -0,0 +1,20 @@ +// +// (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +// +// RTI grants Licensee a license to use, modify, compile, and create derivative +// works of the Software. Licensee has the right to distribute object form +// only for use with RTI products. The Software is provided "as is", with no +// warranty of any type, including any warranty for fitness for any purpose. +// RTI is under no obligation to maintain or support the Software. RTI shall +// not be liable for any incidental or consequential damages arising out of the +// use or inability to use the software. +// + +#include +#include +#include +#include "VehicleModeling.hpp" + +int main(int argc, char **argv) +{ +} diff --git a/tutorials/application_design/c++11/VehicleModeling_metrics_subscriber.cxx b/tutorials/application_design/c++11/VehicleModeling_metrics_subscriber.cxx new file mode 100644 index 000000000..4a24f5dad --- /dev/null +++ b/tutorials/application_design/c++11/VehicleModeling_metrics_subscriber.cxx @@ -0,0 +1,21 @@ +// +// (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +// +// RTI grants Licensee a license to use, modify, compile, and create derivative +// works of the Software. Licensee has the right to distribute object form +// only for use with RTI products. The Software is provided "as is", with no +// warranty of any type, including any warranty for fitness for any purpose. +// RTI is under no obligation to maintain or support the Software. RTI shall +// not be liable for any incidental or consequential damages arising out of the +// use or inability to use the software. +// + +#include +#include + +#include "rti/rti.hpp" +#include "VehicleModeling.hpp" + +int main(int argc, char **argv) +{ +} diff --git a/tutorials/application_design/c++11/VehicleModeling_transit_publisher.cxx b/tutorials/application_design/c++11/VehicleModeling_transit_publisher.cxx new file mode 100644 index 000000000..404964fea --- /dev/null +++ b/tutorials/application_design/c++11/VehicleModeling_transit_publisher.cxx @@ -0,0 +1,20 @@ +// +// (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +// +// RTI grants Licensee a license to use, modify, compile, and create derivative +// works of the Software. Licensee has the right to distribute object form +// only for use with RTI products. The Software is provided "as is", with no +// warranty of any type, including any warranty for fitness for any purpose. +// RTI is under no obligation to maintain or support the Software. RTI shall +// not be liable for any incidental or consequential damages arising out of the +// use or inability to use the software. +// + +#include +#include +#include +#include "VehicleModeling.hpp" + +int main(int argc, char **argv) +{ +} diff --git a/tutorials/application_design/c++11/VehicleModeling_transit_subscriber.cxx b/tutorials/application_design/c++11/VehicleModeling_transit_subscriber.cxx new file mode 100644 index 000000000..52d2479c4 --- /dev/null +++ b/tutorials/application_design/c++11/VehicleModeling_transit_subscriber.cxx @@ -0,0 +1,22 @@ +// +// (c) 2024 Copyright, Real-Time Innovations, Inc. All rights reserved. +// +// RTI grants Licensee a license to use, modify, compile, and create derivative +// works of the Software. Licensee has the right to distribute object form +// only for use with RTI products. The Software is provided "as is", with no +// warranty of any type, including any warranty for fitness for any purpose. +// RTI is under no obligation to maintain or support the Software. RTI shall +// not be liable for any incidental or consequential damages arising out of the +// use or inability to use the software. +// + +#include +#include + +#include "rti/rti.hpp" +#include "VehicleModeling.hpp" + +int main(int argc, char **argv) +{ + +}