Class ParameterEventsFilter

Class Documentation

class ParameterEventsFilter

Public Types

enum class EventType

Values:

enumerator NEW
enumerator DELETED
enumerator CHANGED
using EventPair = std::pair<EventType, const rcl_interfaces::msg::Parameter*>

Used for the listed results.

Public Functions

ParameterEventsFilter(std::shared_ptr<const rcl_interfaces::msg::ParameterEvent> event, const std::vector<std::string> &names, const std::vector<EventType> &types)

Construct a filtered view of a parameter event.

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});
Parameters:
  • event[in] The parameter event message to filter.

  • names[in] A list of parameter names of interest.

  • types[in] A list of the types of parameter events of iterest. EventType NEW, DELETED, or CHANGED

const std::vector<EventPair> &get_events() const

Get the result of the filter.

Returns:

A std::vector<EventPair> of all matching parameter changes in this event.