rclcpp
master
C++ ROS Client Library API
|
#include <parameter_events_filter.hpp>
Public Types | |
enum | EventType { EventType::NEW, EventType::DELETED, EventType::CHANGED } |
using | EventPair = std::pair< EventType, rcl_interfaces::msg::Parameter * > |
Used for the listed results. More... | |
Public Member Functions | |
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. More... | |
const std::vector< EventPair > & | get_events () const |
Get the result of the filter. More... | |
using rclcpp::ParameterEventsFilter::EventPair = std::pair<EventType, rcl_interfaces::msg::Parameter *> |
Used for the listed results.
|
strong |
rclcpp::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.
[in] | event | The parameter event message to filter. |
[in] | names | A list of parameter names of interest. |
[in] | types | A list of the types of parameter events of iterest. EventType NEW, DELETED, or CHANGED |
Example Usage: If you have recieved a parameter event and are only interested in parameters foo and bar being added or changed but don't care about deletion. auto res = rclcpp::ParameterEventsFilter( event_shared_ptr, {"foo", "bar"}, {rclcpp::ParameterEventsFilter::EventType::NEW, rclcpp::ParameterEventsFilter::EventType::CHANGED});
const std::vector<EventPair>& rclcpp::ParameterEventsFilter::get_events | ( | ) | const |
Get the result of the filter.