Skip to content

Commit

Permalink
Correct line length
Browse files Browse the repository at this point in the history
Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Dec 17, 2020
1 parent cf91480 commit eba8500
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 38 deletions.
31 changes: 12 additions & 19 deletions rmw_fastrtps_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ rmw_create_client(
delete info;
});

info = new CustomClientInfo();
info->participant_ = participant;
info->typesupport_identifier_ = type_support->typesupport_identifier;
info->request_publisher_matched_count_ = 0;
Expand Down Expand Up @@ -167,22 +166,19 @@ rmw_create_client(
_register_type(participant, info->response_type_support_);
}

// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill subscriber attributes with a subscriber profile located
// based of topic name defined by _create_topic_name(). If no profile is found, a search with profile_name "client"
// is attempted. Else, use the default attributes.
// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill subscriber attributes with a subscriber profile
// located based of topic name defined by _create_topic_name(). If no profile is found, a search
// with profile_name "client" is attempted. Else, use the default attributes.
std::string topic_name_fallback = "client";
eprosima::fastrtps::SubscriberAttributes subscriberParam;
eprosima::fastrtps::fixed_string<255> sub_topic_name = _create_topic_name(
qos_policies, ros_service_response_prefix, service_name, "Reply");
Domain::getDefaultSubscriberAttributes(subscriberParam);

if (std::getenv("FASTRTPS_DEFAULT_PROFILES_FILE") != nullptr)
if (XMLProfileManager::fillSubscriberAttributes(
sub_topic_name.to_string(), subscriberParam, false) != XMLP_ret::XML_OK)
{
if (XMLProfileManager::fillSubscriberAttributes(sub_topic_name.to_string(), subscriberParam) !=
XMLP_ret::XML_OK)
{
XMLProfileManager::fillSubscriberAttributes(topic_name_fallback, subscriberParam);
}
XMLProfileManager::fillSubscriberAttributes(topic_name_fallback, subscriberParam, false);
}

if (!participant_info->leave_middleware_default_qos) {
Expand All @@ -194,21 +190,18 @@ rmw_create_client(
subscriberParam.topic.topicDataType = response_type_name;
subscriberParam.topic.topicName = sub_topic_name;

// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill publisher attributes with a publisher profile located
// based of topic name defined by _create_topic_name(). If no profile is found, a search with profile_name "client"
// is attempted. Else, use the default attributes.
// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill publisher attributes with a publisher profile
// located based of topic name defined by _create_topic_name(). If no profile is found, a search
// with profile_name "client" is attempted. Else, use the default attributes.
eprosima::fastrtps::fixed_string<255> pub_topic_name = _create_topic_name(
qos_policies, ros_service_requester_prefix, service_name, "Request");
eprosima::fastrtps::PublisherAttributes publisherParam;
Domain::getDefaultPublisherAttributes(publisherParam);

if (std::getenv("FASTRTPS_DEFAULT_PROFILES_FILE") != nullptr)
if (XMLProfileManager::fillPublisherAttributes(
pub_topic_name.to_string(), publisherParam, false) != XMLP_ret::XML_OK)
{
if (XMLProfileManager::fillPublisherAttributes(pub_topic_name.to_string(), publisherParam) !=
XMLP_ret::XML_OK)
{
XMLProfileManager::fillPublisherAttributes(topic_name_fallback, publisherParam);
}
XMLProfileManager::fillPublisherAttributes(topic_name_fallback, publisherParam, false);
}

if (!participant_info->leave_middleware_default_qos) {
Expand Down
31 changes: 12 additions & 19 deletions rmw_fastrtps_cpp/src/rmw_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ rmw_create_service(
delete info;
});

info = new CustomServiceInfo();
info->participant_ = participant;
info->typesupport_identifier_ = type_support->typesupport_identifier;

Expand Down Expand Up @@ -177,22 +176,19 @@ rmw_create_service(
_register_type(participant, info->response_type_support_);
}

// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill subscriber attributes with a subscriber profile located
// based of topic name defined by _create_topic_name(). If no profile is found, a search with profile_name "service"
// is attempted. Else, use the default attributes.
// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill subscriber attributes with a subscriber profile
// located based of topic name defined by _create_topic_name(). If no profile is found, a search
// with profile_name "service" is attempted. Else, use the default attributes.
std::string topic_name_fallback = "service";
eprosima::fastrtps::SubscriberAttributes subscriberParam;
eprosima::fastrtps::fixed_string<255> sub_topic_name = _create_topic_name(
qos_policies, ros_service_requester_prefix, service_name, "Request");
Domain::getDefaultSubscriberAttributes(subscriberParam);

if (std::getenv("FASTRTPS_DEFAULT_PROFILES_FILE") != nullptr)
if (XMLProfileManager::fillSubscriberAttributes(
sub_topic_name.to_string(), subscriberParam, false) != XMLP_ret::XML_OK)
{
if (XMLProfileManager::fillSubscriberAttributes(sub_topic_name.to_string(), subscriberParam) !=
XMLP_ret::XML_OK)
{
XMLProfileManager::fillSubscriberAttributes(topic_name_fallback, subscriberParam);
}
XMLProfileManager::fillSubscriberAttributes(topic_name_fallback, subscriberParam, false);
}

if (!impl->leave_middleware_default_qos) {
Expand All @@ -203,21 +199,18 @@ rmw_create_service(
subscriberParam.topic.topicDataType = request_type_name;
subscriberParam.topic.topicName = sub_topic_name;

// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill publisher attributes with a publisher profile located
// based of topic name defined by _create_topic_name(). If no profile is found, a search with profile_name "service"
// is attempted. Else, use the default attributes.
// If FASTRTPS_DEFAULT_PROFILES_FILE defined, fill publisher attributes with a publisher profile
// located based of topic name defined by _create_topic_name(). If no profile is found, a search
// with profile_name "service" is attempted. Else, use the default attributes.
eprosima::fastrtps::fixed_string<255> pub_topic_name = _create_topic_name(
qos_policies, ros_service_response_prefix, service_name, "Reply");
eprosima::fastrtps::PublisherAttributes publisherParam;
Domain::getDefaultPublisherAttributes(publisherParam);

if (std::getenv("FASTRTPS_DEFAULT_PROFILES_FILE") != nullptr)
if (XMLProfileManager::fillPublisherAttributes(
pub_topic_name.to_string(), publisherParam, false) != XMLP_ret::XML_OK)
{
if (XMLProfileManager::fillPublisherAttributes(pub_topic_name.to_string(), publisherParam) !=
XMLP_ret::XML_OK)
{
XMLProfileManager::fillPublisherAttributes(topic_name_fallback, publisherParam);
}
XMLProfileManager::fillPublisherAttributes(topic_name_fallback, publisherParam, false);
}

if (!impl->leave_middleware_default_qos) {
Expand Down

0 comments on commit eba8500

Please sign in to comment.