15#ifndef CONTROLLER_INTERFACE__HELPERS_HPP_
16#define CONTROLLER_INTERFACE__HELPERS_HPP_
22namespace controller_interface
40bool get_ordered_interfaces(
41 std::vector<T> & unordered_interfaces,
const std::vector<std::string> & ordered_names,
42 const std::string & interface_type, std::vector<std::reference_wrapper<T>> & ordered_interfaces)
44 ordered_interfaces.reserve(ordered_names.size());
45 for (
const auto & name : ordered_names)
47 for (
auto & interface : unordered_interfaces)
49 if (!interface_type.empty())
54 ((name == interface.get_prefix_name()) &&
55 (interface_type == interface.get_interface_name())) ||
56 ((name +
"/" + interface_type) == interface.get_name()))
58 ordered_interfaces.push_back(std::ref(interface));
63 if (name == interface.get_name())
65 ordered_interfaces.push_back(std::ref(interface));
71 return ordered_names.size() == ordered_interfaces.size();
74inline bool interface_list_contains_interface_type(
75 const std::vector<std::string> & interface_type_list,
const std::string & interface_type)
77 return std::find(interface_type_list.begin(), interface_type_list.end(), interface_type) !=
78 interface_type_list.end();