Program Listing for File qos_options.hpp

Return to documentation for file (include/domain_bridge/qos_options.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 DOMAIN_BRIDGE__QOS_OPTIONS_HPP_
#define DOMAIN_BRIDGE__QOS_OPTIONS_HPP_

#include <optional>

#include "rclcpp/qos.hpp"

#include "domain_bridge/visibility_control.hpp"

namespace domain_bridge
{

class QosOptions
{
public:

  DOMAIN_BRIDGE_PUBLIC
  QosOptions() = default;

  DOMAIN_BRIDGE_PUBLIC
  std::optional<rclcpp::ReliabilityPolicy>
  reliability() const;

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  reliability(const rclcpp::ReliabilityPolicy & reliability);

  DOMAIN_BRIDGE_PUBLIC
  std::optional<rclcpp::DurabilityPolicy>
  durability() const;

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  durability(const rclcpp::DurabilityPolicy & durability);

  DOMAIN_BRIDGE_PUBLIC
  rclcpp::HistoryPolicy
  history() const;

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  history(const rclcpp::HistoryPolicy & history);

  DOMAIN_BRIDGE_PUBLIC
  std::size_t
  depth() const;

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  depth(const std::size_t & depth);


  DOMAIN_BRIDGE_PUBLIC
  std::optional<std::int64_t>
  deadline() const;


  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  deadline(const std::int64_t & deadline);

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  deadline_auto();


  DOMAIN_BRIDGE_PUBLIC
  std::optional<std::int64_t>
  lifespan() const;


  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  lifespan(const std::int64_t & lifespan);

  DOMAIN_BRIDGE_PUBLIC
  QosOptions &
  lifespan_auto();

private:
  std::optional<rclcpp::ReliabilityPolicy> reliability_;
  std::optional<rclcpp::DurabilityPolicy> durability_;
  rclcpp::HistoryPolicy history_{rclcpp::HistoryPolicy::KeepLast};
  std::size_t depth_{10};
  std::optional<std::int64_t> deadline_{0};
  std::optional<std::int64_t> lifespan_{0};
};  // class QosOptions

}  // namespace domain_bridge

#endif  // DOMAIN_BRIDGE__QOS_OPTIONS_HPP_