|
33 | 33 | #include <chrono> |
34 | 34 | #include <vector> |
35 | 35 |
|
36 | | -#include <boost/foreach.hpp> |
37 | | -#include <boost/lexical_cast.hpp> |
38 | 36 | #include <boost/algorithm/string/predicate.hpp> |
39 | 37 | #include <opencv2/opencv.hpp> |
40 | 38 |
|
@@ -137,23 +135,20 @@ void WebVideoServer::restreamFrames(double max_age) |
137 | 135 | { |
138 | 136 | std::scoped_lock lock(subscriber_mutex_); |
139 | 137 |
|
140 | | - typedef std::vector<std::shared_ptr<ImageStreamer>>::iterator itr_type; |
141 | | - |
142 | | - for (itr_type itr = image_subscribers_.begin(); itr < image_subscribers_.end(); ++itr) { |
143 | | - (*itr)->restreamFrame(max_age); |
| 138 | + for (auto& subscriber : image_subscribers_) { |
| 139 | + subscriber->restreamFrame(max_age); |
144 | 140 | } |
145 | 141 | } |
146 | 142 |
|
147 | 143 | void WebVideoServer::cleanup_inactive_streams() |
148 | 144 | { |
149 | 145 | std::unique_lock lock(subscriber_mutex_, std::try_to_lock); |
150 | 146 | if (lock) { |
151 | | - typedef std::vector<std::shared_ptr<ImageStreamer>>::iterator itr_type; |
152 | | - itr_type new_end = std::partition( |
| 147 | + auto new_end = std::partition( |
153 | 148 | image_subscribers_.begin(), image_subscribers_.end(), |
154 | 149 | !boost::bind(&ImageStreamer::isInactive, _1)); |
155 | 150 | if (verbose_) { |
156 | | - for (itr_type itr = new_end; itr < image_subscribers_.end(); ++itr) { |
| 151 | + for (auto itr = new_end; itr < image_subscribers_.end(); ++itr) { |
157 | 152 | RCLCPP_INFO(node_->get_logger(), "Removed Stream: %s", (*itr)->getTopic().c_str()); |
158 | 153 | } |
159 | 154 | } |
@@ -326,8 +321,7 @@ bool WebVideoServer::handle_list_streams( |
326 | 321 | "<head><title>ROS Image Topic List</title></head>" |
327 | 322 | "<body><h1>Available ROS Image Topics:</h1>"); |
328 | 323 | connection->write("<ul>"); |
329 | | - BOOST_FOREACH(std::string & camera_info_topic, camera_info_topics) |
330 | | - { |
| 324 | + for(std::string & camera_info_topic : camera_info_topics) { |
331 | 325 | if (boost::algorithm::ends_with(camera_info_topic, "/camera_info")) { |
332 | 326 | std::string base_topic = camera_info_topic.substr( |
333 | 327 | 0, |
|
0 commit comments