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

Indicate missing support for unique network flows #13

Merged
merged 11 commits into from
Apr 5, 2021
27 changes: 27 additions & 0 deletions rmw_connextdds/src/rmw_api_impl_ndds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,3 +820,30 @@ rmw_qos_profile_check_compatible(
reason,
reason_size);
}

/*****************************************************************************
* Network Flow Endpoints API
*****************************************************************************/
rmw_ret_t
rmw_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
return rmw_api_connextdds_publisher_get_network_flow_endpoints(
publisher,
allocator,
network_flow_endpoint_array);
}

rmw_ret_t
rmw_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
return rmw_api_connextdds_subscription_get_network_flow_endpoints(
subscription,
allocator,
network_flow_endpoint_array);
}
1 change: 1 addition & 0 deletions rmw_connextdds_common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ set(RMW_CONNEXT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(RMW_CONNEXT_COMMON_SOURCE_CPP
src/common/rmw_context.cpp
src/common/rmw_discovery.cpp
src/common/rmw_network_flow_endpoints.cpp
src/common/rmw_graph.cpp
src/common/rmw_event.cpp
src/common/rmw_impl.cpp
Expand Down
4 changes: 4 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@

#include "rcpputils/scope_exit.hpp"

#include "rmw/get_network_flow_endpoints.h"
#include "rmw/rmw.h"
#include "rmw/types.h"

extern DDS_DomainParticipantFactory * RMW_Connext_gv_DomainParticipantFactory;
extern size_t RMW_Connext_gv_ContextCount;

Expand Down
17 changes: 17 additions & 0 deletions rmw_connextdds_common/include/rmw_connextdds/rmw_api_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,4 +561,21 @@ rmw_api_connextdds_qos_profile_check_compatible(
char * reason,
size_t reason_size);

/*****************************************************************************
* Network Flow Endpoints API
*****************************************************************************/
RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array);

RMW_CONNEXTDDS_PUBLIC
rmw_ret_t
rmw_api_connextdds_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array);

#endif // RMW_CONNEXTDDS__RMW_API_IMPL_HPP_
41 changes: 41 additions & 0 deletions rmw_connextdds_common/src/common/rmw_network_flow_endpoints.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Copyright 2021 Ericsson AB
//
// 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_connextdds/rmw_impl.hpp"

rmw_ret_t
rmw_api_connextdds_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
UNUSED_ARG(publisher);
UNUSED_ARG(allocator);
UNUSED_ARG(network_flow_endpoint_array);
RMW_CONNEXT_LOG_NOT_IMPLEMENTED
return RMW_RET_UNSUPPORTED;
}

rmw_ret_t
rmw_api_connextdds_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
UNUSED_ARG(subscription);
UNUSED_ARG(allocator);
UNUSED_ARG(network_flow_endpoint_array);
RMW_CONNEXT_LOG_NOT_IMPLEMENTED
return RMW_RET_UNSUPPORTED;
}
7 changes: 7 additions & 0 deletions rmw_connextdds_common/src/common/rmw_publication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ rmw_api_connextdds_create_publisher(
RMW_CHECK_ARGUMENT_FOR_NULL(topic_name, nullptr);
RMW_CHECK_ARGUMENT_FOR_NULL(qos_policies, nullptr);
RMW_CHECK_ARGUMENT_FOR_NULL(publisher_options, nullptr);
if (publisher_options->require_unique_network_flow_endpoints ==
RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_STRICTLY_REQUIRED)
{
RMW_CONNEXT_LOG_ERROR_SET(
"Strict requirement on unique network flow endpoints for publishers not supported");
return nullptr;
}
anamud marked this conversation as resolved.
Show resolved Hide resolved

RMW_CONNEXT_LOG_DEBUG_A(
"creating new publisher: topic=%s",
Expand Down
7 changes: 7 additions & 0 deletions rmw_connextdds_common/src/common/rmw_subscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ rmw_api_connextdds_create_subscription(
RMW_CHECK_ARGUMENT_FOR_NULL(topic_name, nullptr);
RMW_CHECK_ARGUMENT_FOR_NULL(qos_policies, nullptr);
RMW_CHECK_ARGUMENT_FOR_NULL(subscription_options, nullptr);
if (subscription_options->require_unique_network_flow_endpoints ==
RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_STRICTLY_REQUIRED)
{
RMW_CONNEXT_LOG_ERROR_SET(
"Strict requirement on unique network flow endpoints for subscriptions not supported");
return nullptr;
}

RMW_CONNEXT_LOG_DEBUG_A(
"creating new subscription: topic=%s",
Expand Down
27 changes: 27 additions & 0 deletions rmw_connextddsmicro/src/rmw_api_impl_rtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,3 +819,30 @@ rmw_qos_profile_check_compatible(
reason,
reason_size);
}

/*****************************************************************************
* Network Flow Endpoints API
*****************************************************************************/
rmw_ret_t
rmw_publisher_get_network_flow_endpoints(
const rmw_publisher_t * publisher,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
return rmw_api_connextdds_publisher_get_network_flow_endpoints(
publisher,
allocator,
network_flow_endpoint_array);
}

rmw_ret_t
rmw_subscription_get_network_flow_endpoints(
const rmw_subscription_t * subscription,
rcutils_allocator_t * allocator,
rmw_network_flow_endpoint_array_t * network_flow_endpoint_array)
{
return rmw_api_connextdds_subscription_get_network_flow_endpoints(
subscription,
allocator,
network_flow_endpoint_array);
}