From 8fb38f971ec19e1a25839e3716350330eee7bd4b Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 11:15:08 -0700 Subject: [PATCH 1/3] add rmw_get_encoding_identifier --- rmw_opensplice_cpp/CMakeLists.txt | 1 + rmw_opensplice_cpp/src/identifier.cpp | 1 + rmw_opensplice_cpp/src/identifier.hpp | 1 + .../src/rmw_get_encoding_identifier.cpp | 27 +++++++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp diff --git a/rmw_opensplice_cpp/CMakeLists.txt b/rmw_opensplice_cpp/CMakeLists.txt index 7027c5e2..0d19cad1 100644 --- a/rmw_opensplice_cpp/CMakeLists.txt +++ b/rmw_opensplice_cpp/CMakeLists.txt @@ -52,6 +52,7 @@ add_library(rmw_opensplice_cpp SHARED 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_opensplice_cpp/src/identifier.cpp b/rmw_opensplice_cpp/src/identifier.cpp index 473747d0..4fe932c0 100644 --- a/rmw_opensplice_cpp/src/identifier.cpp +++ b/rmw_opensplice_cpp/src/identifier.cpp @@ -15,3 +15,4 @@ #include "identifier.hpp" const char * opensplice_cpp_identifier = "rmw_opensplice_cpp"; +const char * opensplice_cpp_encoding_identifier = "cdr"; diff --git a/rmw_opensplice_cpp/src/identifier.hpp b/rmw_opensplice_cpp/src/identifier.hpp index ca360d71..5f7c1810 100644 --- a/rmw_opensplice_cpp/src/identifier.hpp +++ b/rmw_opensplice_cpp/src/identifier.hpp @@ -16,5 +16,6 @@ #define IDENTIFIER_HPP_ extern const char * opensplice_cpp_identifier; +extern const char * opensplice_cpp_encoding_identifier; #endif // IDENTIFIER_HPP_ diff --git a/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp new file mode 100644 index 00000000..f9ea953d --- /dev/null +++ b/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp @@ -0,0 +1,27 @@ +// Copyright 2014-2015 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 "identifier.hpp" + +// The extern "C" here enforces that overloading is not used. +extern "C" +{ +const char * +rmw_get_encoding_identifier() +{ + return opensplice_cpp_encoding_identifier; +} +} // extern "C" From 030ac5a29473e799de0e5e3bd7e8e9bc0403f1a0 Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 13:27:31 -0700 Subject: [PATCH 2/3] update copyright year --- rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp index f9ea953d..e0c5fea7 100644 --- a/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp +++ b/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp @@ -1,4 +1,4 @@ -// Copyright 2014-2015 Open Source Robotics Foundation, Inc. +// 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 ffc64fc79e9cbb6f2ad1ad98dfb836566ff2ac4c Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 16 Jul 2018 14:28:00 -0700 Subject: [PATCH 3/3] encoding -> serialization format --- rmw_opensplice_cpp/CMakeLists.txt | 3 ++- rmw_opensplice_cpp/src/identifier.cpp | 1 - rmw_opensplice_cpp/src/identifier.hpp | 1 - ...r.cpp => rmw_get_serialization_format.cpp} | 6 +++--- .../src/serialization_format.cpp | 17 ++++++++++++++++ .../src/serialization_format.hpp | 20 +++++++++++++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) rename rmw_opensplice_cpp/src/{rmw_get_encoding_identifier.cpp => rmw_get_serialization_format.cpp} (86%) create mode 100644 rmw_opensplice_cpp/src/serialization_format.cpp create mode 100644 rmw_opensplice_cpp/src/serialization_format.hpp diff --git a/rmw_opensplice_cpp/CMakeLists.txt b/rmw_opensplice_cpp/CMakeLists.txt index 0d19cad1..082b2dc7 100644 --- a/rmw_opensplice_cpp/CMakeLists.txt +++ b/rmw_opensplice_cpp/CMakeLists.txt @@ -52,9 +52,9 @@ add_library(rmw_opensplice_cpp SHARED 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 @@ -73,6 +73,7 @@ add_library(rmw_opensplice_cpp SHARED src/rmw_trigger_guard_condition.cpp src/rmw_wait.cpp src/rmw_wait_set.cpp + src/serialization_format.cpp src/types.cpp ) ament_target_dependencies(rmw_opensplice_cpp diff --git a/rmw_opensplice_cpp/src/identifier.cpp b/rmw_opensplice_cpp/src/identifier.cpp index 4fe932c0..473747d0 100644 --- a/rmw_opensplice_cpp/src/identifier.cpp +++ b/rmw_opensplice_cpp/src/identifier.cpp @@ -15,4 +15,3 @@ #include "identifier.hpp" const char * opensplice_cpp_identifier = "rmw_opensplice_cpp"; -const char * opensplice_cpp_encoding_identifier = "cdr"; diff --git a/rmw_opensplice_cpp/src/identifier.hpp b/rmw_opensplice_cpp/src/identifier.hpp index 5f7c1810..ca360d71 100644 --- a/rmw_opensplice_cpp/src/identifier.hpp +++ b/rmw_opensplice_cpp/src/identifier.hpp @@ -16,6 +16,5 @@ #define IDENTIFIER_HPP_ extern const char * opensplice_cpp_identifier; -extern const char * opensplice_cpp_encoding_identifier; #endif // IDENTIFIER_HPP_ diff --git a/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp b/rmw_opensplice_cpp/src/rmw_get_serialization_format.cpp similarity index 86% rename from rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp rename to rmw_opensplice_cpp/src/rmw_get_serialization_format.cpp index e0c5fea7..9a843301 100644 --- a/rmw_opensplice_cpp/src/rmw_get_encoding_identifier.cpp +++ b/rmw_opensplice_cpp/src/rmw_get_serialization_format.cpp @@ -14,14 +14,14 @@ #include "rmw/rmw.h" -#include "identifier.hpp" +#include "serialization_format.hpp" // The extern "C" here enforces that overloading is not used. extern "C" { const char * -rmw_get_encoding_identifier() +rmw_get_serialization_format() { - return opensplice_cpp_encoding_identifier; + return opensplice_cpp_serialization_format; } } // extern "C" diff --git a/rmw_opensplice_cpp/src/serialization_format.cpp b/rmw_opensplice_cpp/src/serialization_format.cpp new file mode 100644 index 00000000..e66b89c0 --- /dev/null +++ b/rmw_opensplice_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 "serialization_format.hpp" + +const char * opensplice_cpp_serialization_format = "cdr"; diff --git a/rmw_opensplice_cpp/src/serialization_format.hpp b/rmw_opensplice_cpp/src/serialization_format.hpp new file mode 100644 index 00000000..620cac58 --- /dev/null +++ b/rmw_opensplice_cpp/src/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 SERIALIZATION_FORMAT_HPP_ +#define SERIALIZATION_FORMAT_HPP_ + +extern const char * opensplice_cpp_serialization_format; + +#endif // SERIALIZATION_FORMAT_HPP_