rclcpp  master
C++ ROS Client Library API
parameter_events_filter.hpp
Go to the documentation of this file.
1 // Copyright 2017 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 #ifndef RCLCPP__PARAMETER_EVENTS_FILTER_HPP_
16 #define RCLCPP__PARAMETER_EVENTS_FILTER_HPP_
17 
18 #include <memory>
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 #include "rcl_interfaces/msg/parameter.hpp"
24 #include "rcl_interfaces/msg/parameter_event.hpp"
25 #include "rcl_interfaces/msg/parameter_value.hpp"
26 #include "rclcpp/macros.hpp"
27 #include "rclcpp/parameter.hpp"
29 #include "rmw/rmw.h"
30 
31 namespace rclcpp
32 {
33 
35 {
36 public:
38  enum class EventType {NEW, DELETED, CHANGED};
41 
43 
63  rcl_interfaces::msg::ParameterEvent::SharedPtr event,
64  const std::vector<std::string> & names,
65  const std::vector<EventType> & types);
66 
68 
72  const std::vector<EventPair> & get_events() const;
73 
74 private:
75  // access only allowed via const accessor.
76  std::vector<EventPair> result_;
77  rcl_interfaces::msg::ParameterEvent::SharedPtr event_;
78 };
79 
80 } // namespace rclcpp
81 
82 #endif // RCLCPP__PARAMETER_EVENTS_FILTER_HPP_
rmw.h
std::pair
std::vector< std::string >
rclcpp
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
RCLCPP_PUBLIC
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
rclcpp::ParameterEventsFilter
Definition: parameter_events_filter.hpp:34
RCLCPP_SMART_PTR_DEFINITIONS
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
macros.hpp
rclcpp::ParameterEventsFilter::ParameterEventsFilter
ParameterEventsFilter(rcl_interfaces::msg::ParameterEvent::SharedPtr event, const std::vector< std::string > &names, const std::vector< EventType > &types)
Construct a filtered view of a parameter event.
rclcpp::ParameterEventsFilter::EventType
EventType
Definition: parameter_events_filter.hpp:38
parameter.hpp
rclcpp::ParameterEventsFilter::get_events
const std::vector< EventPair > & get_events() const
Get the result of the filter.
visibility_control.hpp
rclcpp::ParameterEventsFilter::EventPair
std::pair< EventType, rcl_interfaces::msg::Parameter * > EventPair
Used for the listed results.
Definition: parameter_events_filter.hpp:40