From 2c4fc3759dcdde42a3823fd581ee162e4bddecb0 Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 11:12:23 -0700 Subject: [PATCH 1/4] add rmw_get_encoding_identifier --- rmw_fastrtps_cpp/CMakeLists.txt | 1 + .../include/rmw_fastrtps_cpp/identifier.hpp | 1 + rmw_fastrtps_cpp/src/identifier.cpp | 1 + .../src/rmw_get_encoding_identifier.cpp | 26 +++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp diff --git a/rmw_fastrtps_cpp/CMakeLists.txt b/rmw_fastrtps_cpp/CMakeLists.txt index b70d179d3..4faa72d9d 100644 --- a/rmw_fastrtps_cpp/CMakeLists.txt +++ b/rmw_fastrtps_cpp/CMakeLists.txt @@ -55,6 +55,7 @@ add_library(rmw_fastrtps_cpp src/rmw_client.cpp src/rmw_compare_gids_equal.cpp src/rmw_count.cpp + src/rmw_get_encoding_identifier.cpp src/rmw_get_gid_for_publisher.cpp src/rmw_get_implementation_identifier.cpp src/rmw_guard_condition.cpp diff --git a/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp index aa1ac3947..3385b9ff3 100644 --- a/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp +++ b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp @@ -16,5 +16,6 @@ #define RMW_FASTRTPS_CPP__IDENTIFIER_HPP_ extern const char * const eprosima_fastrtps_identifier; +extern const char * const eprosima_fastrtps_encoding_identifier; #endif // RMW_FASTRTPS_CPP__IDENTIFIER_HPP_ diff --git a/rmw_fastrtps_cpp/src/identifier.cpp b/rmw_fastrtps_cpp/src/identifier.cpp index e25ab9b5d..24bd2dd61 100644 --- a/rmw_fastrtps_cpp/src/identifier.cpp +++ b/rmw_fastrtps_cpp/src/identifier.cpp @@ -15,3 +15,4 @@ #include "rmw_fastrtps_cpp/identifier.hpp" const char * const eprosima_fastrtps_identifier = "rmw_fastrtps_cpp"; +const char * const eprosima_fastrtps_encoding_identifier = "cdr"; diff --git a/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp new file mode 100644 index 000000000..b6b6164a3 --- /dev/null +++ b/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp @@ -0,0 +1,26 @@ +// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "rmw/rmw.h" + +#include "rmw_fastrtps_cpp/identifier.hpp" + +extern "C" +{ +const char * +rmw_get_encoding_identifier() +{ + return eprosima_fastrtps_encoding_identifier; +} +} // extern "C" From fa3d7a57781474825b82034e3dced4317db690ce Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 13:24:58 -0700 Subject: [PATCH 2/4] update copyright notice --- rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp index b6b6164a3..d886431d0 100644 --- a/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp +++ b/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp @@ -1,4 +1,4 @@ -// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima). +// Copyright 2018 Open Source Robotics Foundation, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 3cd4133678cdc737b3d20779a0f3e7bcae126e88 Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 14:17:59 -0700 Subject: [PATCH 3/4] encoding -> serialization format --- rmw_fastrtps_cpp/CMakeLists.txt | 3 ++- .../include/rmw_fastrtps_cpp/identifier.hpp | 1 - .../rmw_fastrtps_cpp/serialization_format.hpp | 20 +++++++++++++++++++ rmw_fastrtps_cpp/src/identifier.cpp | 1 - ...r.cpp => rmw_get_serialization_format.cpp} | 6 +++--- rmw_fastrtps_cpp/src/serialization_format.cpp | 17 ++++++++++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/serialization_format.hpp rename rmw_fastrtps_cpp/src/{rmw_get_encoding_identifier.cpp => rmw_get_serialization_format.cpp} (83%) create mode 100644 rmw_fastrtps_cpp/src/serialization_format.cpp diff --git a/rmw_fastrtps_cpp/CMakeLists.txt b/rmw_fastrtps_cpp/CMakeLists.txt index 4faa72d9d..788e57d3e 100644 --- a/rmw_fastrtps_cpp/CMakeLists.txt +++ b/rmw_fastrtps_cpp/CMakeLists.txt @@ -55,9 +55,9 @@ add_library(rmw_fastrtps_cpp src/rmw_client.cpp src/rmw_compare_gids_equal.cpp src/rmw_count.cpp - src/rmw_get_encoding_identifier.cpp src/rmw_get_gid_for_publisher.cpp src/rmw_get_implementation_identifier.cpp + src/rmw_get_serialization_format.cpp src/rmw_guard_condition.cpp src/rmw_init.cpp src/rmw_node.cpp @@ -76,6 +76,7 @@ add_library(rmw_fastrtps_cpp src/rmw_trigger_guard_condition.cpp src/rmw_wait.cpp src/rmw_wait_set.cpp + src/serialization_format.cpp src/type_support_common.cpp ) target_link_libraries(rmw_fastrtps_cpp diff --git a/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp index 3385b9ff3..aa1ac3947 100644 --- a/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp +++ b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/identifier.hpp @@ -16,6 +16,5 @@ #define RMW_FASTRTPS_CPP__IDENTIFIER_HPP_ extern const char * const eprosima_fastrtps_identifier; -extern const char * const eprosima_fastrtps_encoding_identifier; #endif // RMW_FASTRTPS_CPP__IDENTIFIER_HPP_ diff --git a/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/serialization_format.hpp b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/serialization_format.hpp new file mode 100644 index 000000000..f21f41cdf --- /dev/null +++ b/rmw_fastrtps_cpp/include/rmw_fastrtps_cpp/serialization_format.hpp @@ -0,0 +1,20 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RMW_FASTRTPS_CPP__SERIALIZATION_FORMAT_HPP_ +#define RMW_FASTRTPS_CPP__SERIALIZATION_FORMAT_HPP_ + +extern const char * const eprosima_fastrtps_serialization_format; + +#endif // RMW_FASTRTPS_CPP__SERIALIZATION_FORMAT_HPP_ diff --git a/rmw_fastrtps_cpp/src/identifier.cpp b/rmw_fastrtps_cpp/src/identifier.cpp index 24bd2dd61..e25ab9b5d 100644 --- a/rmw_fastrtps_cpp/src/identifier.cpp +++ b/rmw_fastrtps_cpp/src/identifier.cpp @@ -15,4 +15,3 @@ #include "rmw_fastrtps_cpp/identifier.hpp" const char * const eprosima_fastrtps_identifier = "rmw_fastrtps_cpp"; -const char * const eprosima_fastrtps_encoding_identifier = "cdr"; diff --git a/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_fastrtps_cpp/src/rmw_get_serialization_format.cpp similarity index 83% rename from rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp rename to rmw_fastrtps_cpp/src/rmw_get_serialization_format.cpp index d886431d0..834090fa2 100644 --- a/rmw_fastrtps_cpp/src/rmw_get_encoding_identifier.cpp +++ b/rmw_fastrtps_cpp/src/rmw_get_serialization_format.cpp @@ -14,13 +14,13 @@ #include "rmw/rmw.h" -#include "rmw_fastrtps_cpp/identifier.hpp" +#include "rmw_fastrtps_cpp/serialization_format.hpp" extern "C" { const char * -rmw_get_encoding_identifier() +rmw_get_serialization_format() { - return eprosima_fastrtps_encoding_identifier; + return eprosima_fastrtps_serialization_format; } } // extern "C" diff --git a/rmw_fastrtps_cpp/src/serialization_format.cpp b/rmw_fastrtps_cpp/src/serialization_format.cpp new file mode 100644 index 000000000..06ef1bf79 --- /dev/null +++ b/rmw_fastrtps_cpp/src/serialization_format.cpp @@ -0,0 +1,17 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "rmw_fastrtps_cpp/serialization_format.hpp" + +const char * const eprosima_fastrtps_serialization_format = "cdr"; From c3a708f89abdf824fe52dc4f1a667f4292dcd156 Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Thu, 26 Jul 2018 14:15:21 -0700 Subject: [PATCH 4/4] fastrtps dynamic --- rmw_fastrtps_dynamic_cpp/CMakeLists.txt | 2 ++ .../serialization_format.hpp | 20 ++++++++++++++ .../src/rmw_get_serialization_format.cpp | 26 +++++++++++++++++++ .../src/serialization_format.cpp | 17 ++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp create mode 100644 rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp create mode 100644 rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp diff --git a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt index 33c8e9ddb..3122a5aca 100644 --- a/rmw_fastrtps_dynamic_cpp/CMakeLists.txt +++ b/rmw_fastrtps_dynamic_cpp/CMakeLists.txt @@ -58,6 +58,7 @@ add_library(rmw_fastrtps_dynamic_cpp src/rmw_count.cpp src/rmw_get_gid_for_publisher.cpp src/rmw_get_implementation_identifier.cpp + src/rmw_get_serialization_format.cpp src/rmw_guard_condition.cpp src/rmw_init.cpp src/rmw_node.cpp @@ -77,6 +78,7 @@ add_library(rmw_fastrtps_dynamic_cpp src/rmw_wait.cpp src/rmw_wait_set.cpp src/type_support_common.cpp + src/serialization_format.cpp ) target_link_libraries(rmw_fastrtps_dynamic_cpp fastcdr fastrtps) diff --git a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp new file mode 100644 index 000000000..de429b844 --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/serialization_format.hpp @@ -0,0 +1,20 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ +#define RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ + +extern const char * const eprosima_fastrtps_dynamic_serialization_format; + +#endif // RMW_FASTRTPS_DYNAMIC_CPP__SERIALIZATION_FORMAT_HPP_ diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp new file mode 100644 index 000000000..7978b1ecc --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_get_serialization_format.cpp @@ -0,0 +1,26 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "rmw/rmw.h" + +#include "rmw_fastrtps_dynamic_cpp/serialization_format.hpp" + +extern "C" +{ +const char * +rmw_get_serialization_format() +{ + return eprosima_fastrtps_dynamic_serialization_format; +} +} // extern "C" diff --git a/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp b/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp new file mode 100644 index 000000000..03534979a --- /dev/null +++ b/rmw_fastrtps_dynamic_cpp/src/serialization_format.cpp @@ -0,0 +1,17 @@ +// Copyright 2018 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "rmw_fastrtps_dynamic_cpp/serialization_format.hpp" + +const char * const eprosima_fastrtps_dynamic_serialization_format = "cdr";