|
| 1 | +// Copyright 2024 Open Source Robotics Foundation, Inc. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +#include "rclcpp/executor_options.hpp" |
| 16 | + |
| 17 | +using rclcpp::ExecutorOptions; |
| 18 | + |
| 19 | +namespace rclcpp |
| 20 | +{ |
| 21 | + |
| 22 | +class ExecutorOptionsImplementation {}; |
| 23 | + |
| 24 | +} // namespace rclcpp |
| 25 | + |
| 26 | +ExecutorOptions::ExecutorOptions() |
| 27 | +: memory_strategy(rclcpp::memory_strategies::create_default_strategy()), |
| 28 | + context(rclcpp::contexts::get_global_default_context()), |
| 29 | + max_conditions(0), |
| 30 | + impl_(nullptr) |
| 31 | +{} |
| 32 | + |
| 33 | +ExecutorOptions::~ExecutorOptions() |
| 34 | +{} |
| 35 | + |
| 36 | +ExecutorOptions::ExecutorOptions(const ExecutorOptions & other) |
| 37 | +{ |
| 38 | + *this = other; |
| 39 | +} |
| 40 | + |
| 41 | +ExecutorOptions & ExecutorOptions::operator=(const ExecutorOptions & other) |
| 42 | +{ |
| 43 | + if (this == &other) { |
| 44 | + return *this; |
| 45 | + } |
| 46 | + |
| 47 | + this->memory_strategy = other.memory_strategy; |
| 48 | + this->context = other.context; |
| 49 | + this->max_conditions = other.max_conditions; |
| 50 | + if (nullptr != other.impl_) { |
| 51 | + this->impl_ = std::make_unique<ExecutorOptionsImplementation>(*other.impl_); |
| 52 | + } |
| 53 | + |
| 54 | + return *this; |
| 55 | +} |
0 commit comments