Program Listing for File qos.hpp

Return to documentation for file (include/rmw_dds_common/qos.hpp)

// 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.

#ifndef RMW_DDS_COMMON__QOS_HPP_
#define RMW_DDS_COMMON__QOS_HPP_

#include <functional>
#include <string>

#include "rmw/qos_profiles.h"
#include "rmw/topic_endpoint_info_array.h"
#include "rmw/types.h"

#include "rmw_dds_common/visibility_control.h"

namespace rmw_dds_common
{


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
qos_profile_check_compatible(
  const rmw_qos_profile_t publisher_qos,
  const rmw_qos_profile_t subscription_qos,
  rmw_qos_compatibility_type_t * compatibility,
  char * reason,
  size_t reason_size);


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
qos_profile_get_best_available_for_subscription(
  const rmw_topic_endpoint_info_array_t * publishers_info,
  rmw_qos_profile_t * subscription_profile);


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
qos_profile_get_best_available_for_publisher(
  const rmw_topic_endpoint_info_array_t * subscriptions_info,
  rmw_qos_profile_t * publisher_profile);

using GetEndpointInfoByTopicFunction = std::function<rmw_ret_t(
      const rmw_node_t *,
      rcutils_allocator_t *,
      const char *,
      bool,
      rmw_topic_endpoint_info_array_t *)>;


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
qos_profile_get_best_available_for_topic_subscription(
  const rmw_node_t * node,
  const char * topic_name,
  rmw_qos_profile_t * qos_profile,
  const GetEndpointInfoByTopicFunction & get_endpoint_info);


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
qos_profile_get_best_available_for_topic_publisher(
  const rmw_node_t * node,
  const char * topic_name,
  rmw_qos_profile_t * qos_profile,
  const GetEndpointInfoByTopicFunction & get_endpoint_info);


RMW_DDS_COMMON_PUBLIC
rmw_qos_profile_t
qos_profile_update_best_available_for_services(const rmw_qos_profile_t & qos_profile);


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
parse_type_hash_from_user_data(
  const uint8_t * user_data,
  size_t user_data_size,
  rosidl_type_hash_t & type_hash_out);


RMW_DDS_COMMON_PUBLIC
rmw_ret_t
encode_type_hash_for_user_data_qos(
  const rosidl_type_hash_t & type_hash,
  std::string & string_out);

}  // namespace rmw_dds_common

#endif  // RMW_DDS_COMMON__QOS_HPP_