Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RMW function to check QoS compatibility #511

Merged
merged 5 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rmw_fastrtps_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ add_library(rmw_fastrtps_cpp
src/rmw_node_names.cpp
src/rmw_publish.cpp
src/rmw_publisher.cpp
src/rmw_qos.cpp
src/rmw_request.cpp
src/rmw_response.cpp
src/rmw_serialize.cpp
Expand Down
32 changes: 32 additions & 0 deletions rmw_fastrtps_cpp/src/rmw_qos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2021 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_shared_cpp/rmw_common.hpp"

extern "C"
{

rmw_ret_t
rmw_qos_profile_check_compatible(
const rmw_qos_profile_t publisher_profile,
const rmw_qos_profile_t subscription_profile,
rmw_qos_compatibility_type_t * compatibility,
char * reason,
size_t reason_size)
{
return rmw_fastrtps_shared_cpp::__rmw_qos_profile_check_compatible(
publisher_profile, subscription_profile, compatibility, reason, reason_size);
}

} // extern "C"
1 change: 1 addition & 0 deletions rmw_fastrtps_dynamic_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ add_library(rmw_fastrtps_dynamic_cpp
src/rmw_node_names.cpp
src/rmw_publish.cpp
src/rmw_publisher.cpp
src/rmw_qos.cpp
src/rmw_request.cpp
src/rmw_response.cpp
src/rmw_serialize.cpp
Expand Down
32 changes: 32 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/rmw_qos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2021 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_shared_cpp/rmw_common.hpp"

extern "C"
{

rmw_ret_t
rmw_qos_profile_check_compatible(
const rmw_qos_profile_t publisher_profile,
const rmw_qos_profile_t subscription_profile,
rmw_qos_compatibility_type_t * compatibility,
char * reason,
size_t reason_size)
{
return rmw_fastrtps_shared_cpp::__rmw_qos_profile_check_compatible(
publisher_profile, subscription_profile, compatibility, reason, reason_size);
}

} // extern "C"
1 change: 1 addition & 0 deletions rmw_fastrtps_shared_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ add_library(rmw_fastrtps_shared_cpp
src/rmw_node_names.cpp
src/rmw_publish.cpp
src/rmw_publisher.cpp
src/rmw_qos.cpp
src/rmw_request.cpp
src/rmw_response.cpp
src/rmw_security_logging.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ __rmw_get_subscriptions_info_by_topic(
bool no_mangle,
rmw_topic_endpoint_info_array_t * subscriptions_info);

RMW_FASTRTPS_SHARED_CPP_PUBLIC
rmw_ret_t
__rmw_qos_profile_check_compatible(
const rmw_qos_profile_t publisher_profile,
const rmw_qos_profile_t subscription_profile,
rmw_qos_compatibility_type_t * compatibility,
char * reason,
size_t reason_size);

} // namespace rmw_fastrtps_shared_cpp

#endif // RMW_FASTRTPS_SHARED_CPP__RMW_COMMON_HPP_
34 changes: 34 additions & 0 deletions rmw_fastrtps_shared_cpp/src/rmw_qos.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2021 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/types.h"

#include "rmw_dds_common/qos.hpp"

namespace rmw_fastrtps_shared_cpp
{

rmw_ret_t
__rmw_qos_profile_check_compatible(
const rmw_qos_profile_t publisher_profile,
const rmw_qos_profile_t subscription_profile,
rmw_qos_compatibility_type_t * compatibility,
char * reason,
size_t reason_size)
{
return rmw_dds_common::qos_profile_check_compatible(
publisher_profile, subscription_profile, compatibility, reason, reason_size);
}

} // namespace rmw_fastrtps_shared_cpp