26std::string to_string(
const std::vector<T> & list)
30 for (
const auto & elem : list)
37 ss.seekp(-2, std::ios_base::end);
44std::vector<std::string> get_names(
const std::vector<T> & handles)
46 std::set<std::string> names;
48 handles.cbegin(), handles.cend(), std::inserter(names, names.end()),
49 [](
const auto & handle) { return handle.get_prefix_name(); });
50 return std::vector<std::string>(names.begin(), names.end());
54std::vector<T> get_ordered_handles(
55 const std::vector<T> & unordered_handles,
const std::vector<std::string> & names,
56 const std::string & interface_type)
58 std::vector<T> result;
59 for (
const auto & name : names)
62 unordered_handles.cbegin(), unordered_handles.cend(), std::back_inserter(result),
63 [&](
const auto & handle)
65 return (handle.get_prefix_name() == name) &&
66 (handle.get_interface_name() == interface_type) && handle;