Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Remove domain_id and localhost_only from node API #438

Merged
merged 1 commit into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 2 additions & 4 deletions rmw_connext_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ rmw_node_t *
rmw_create_node(
rmw_context_t * context,
const char * name,
const char * namespace_,
size_t domain_id,
bool localhost_only)
const char * namespace_)
{
return create_node(
rti_connext_identifier, context, name, namespace_, domain_id, localhost_only);
rti_connext_identifier, context, name, namespace_);
}

rmw_ret_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ create_node(
const char * implementation_identifier,
rmw_context_t * context,
const char * name,
const char * namespace_,
size_t domain_id,
bool localhost_only);
const char * namespace_);

RMW_CONNEXT_SHARED_CPP_PUBLIC
rmw_ret_t
Expand Down
21 changes: 11 additions & 10 deletions rmw_connext_shared_cpp/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ create_node(
const char * implementation_identifier,
rmw_context_t * context,
const char * name,
const char * namespace_,
size_t domain_id,
bool localhost_only)
const char * namespace_)
{
RCUTILS_CHECK_ARGUMENT_FOR_NULL(context, NULL);
RMW_CHECK_TYPE_IDENTIFIERS_MATCH(
Expand All @@ -57,7 +55,7 @@ create_node(
return NULL;
}

if (localhost_only) {
if (context->options.localhost_only == RMW_LOCALHOST_ONLY_ENABLED) {
status = DDS::PropertyQosPolicyHelper::add_property(
participant_qos.property,
"dds.transport.UDPv4.builtin.parent.allow_interfaces",
Expand Down Expand Up @@ -275,12 +273,15 @@ create_node(
}

// No custom handling of RMW_DEFAULT_DOMAIN_ID. Simply use a reasonable domain id.
participant = dpf_->create_participant(
static_cast<DDS::DomainId_t>(
domain_id != RMW_DEFAULT_DOMAIN_ID ? domain_id : 0u),
participant_qos,
NULL,
DDS::STATUS_MASK_NONE);
{
size_t domain_id = context->options.domain_id;
participant = dpf_->create_participant(
static_cast<DDS::DomainId_t>(
domain_id != RMW_DEFAULT_DOMAIN_ID ? domain_id : 0u),
participant_qos,
NULL,
DDS::STATUS_MASK_NONE);
}
if (!participant) {
RMW_SET_ERROR_MSG("failed to create participant");
goto fail;
Expand Down