Skip to content

Commit ba7e72f

Browse files
committed
cleanup linter errors
Signed-off-by: Alberto Soragna <[email protected]>
1 parent 08914c4 commit ba7e72f

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

rclcpp/include/rclcpp/executors/events_executor_entities_collector.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <list>
1919
#include <map>
2020
#include <memory>
21+
#include <unordered_map>
2122
#include <vector>
2223

2324
#include "rclcpp/executors/event_waitable.hpp"

rclcpp/include/rclcpp/executors/timers_manager.hpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <memory>
2323
#include <mutex>
2424
#include <thread>
25+
#include <utility>
2526
#include <vector>
2627

2728
#include "rclcpp/context.hpp"
@@ -147,7 +148,7 @@ class TimersManager
147148
*/
148149
class WeakTimersHeap
149150
{
150-
public:
151+
public:
151152
/**
152153
* @brief Try to add a new timer to the heap.
153154
* After the addition, the heap property is preserved.
@@ -177,12 +178,12 @@ class TimersManager
177178
{
178179
TimersHeap locked_heap = this->validate_and_lock();
179180
bool removed = locked_heap.remove_timer(std::move(timer));
180-
181+
181182
if (removed) {
182183
// Re-create the weak heap with the timer removed
183184
this->store(locked_heap);
184185
}
185-
186+
186187
return removed;
187188
}
188189

@@ -208,7 +209,7 @@ class TimersManager
208209
it = weak_heap_.erase(it);
209210
any_timer_destroyed = true;
210211
}
211-
}
212+
}
212213

213214
// If a timer has gone out of scope, then the remaining elements may not represent
214215
// a valid heap anymore. We need to re heapify the timers heap.
@@ -218,13 +219,13 @@ class TimersManager
218219
this->store(locked_heap);
219220
}
220221

221-
return locked_heap;
222+
return locked_heap;
222223
}
223224

224225
/**
225226
* @brief This function allows to recreate the heap of weak pointers
226227
* from an heap of owned pointers.
227-
* @param heap
228+
* @param heap timers heap to store as weak pointers
228229
*/
229230
void store(const TimersHeap & heap)
230231
{
@@ -242,7 +243,7 @@ class TimersManager
242243
weak_heap_.clear();
243244
}
244245

245-
private:
246+
private:
246247
std::vector<WeakTimerPtr> weak_heap_;
247248
};
248249

@@ -253,7 +254,7 @@ class TimersManager
253254
*/
254255
class TimersHeap
255256
{
256-
public:
257+
public:
257258
/**
258259
* @brief Try to add a new timer to the heap.
259260
* After the addition, the heap property is preserved.
@@ -291,7 +292,7 @@ class TimersManager
291292
owned_heap_.erase(it);
292293
std::make_heap(owned_heap_.begin(), owned_heap_.end(), timer_greater);
293294

294-
return true;
295+
return true;
295296
}
296297

297298
/**
@@ -341,14 +342,14 @@ class TimersManager
341342
*/
342343
void heapify()
343344
{
344-
std::make_heap(owned_heap_.begin(), owned_heap_.end(), timer_greater);
345+
std::make_heap(owned_heap_.begin(), owned_heap_.end(), timer_greater);
345346
}
346347

347348
/**
348349
* @brief Convenience function that allows to push an element at the bottom of the heap.
349350
* It will not perform any check on whether the heap remains valid or not.
350351
* Those checks are responsibility of the calling code.
351-
*
352+
*
352353
* @param timer timer to push at the back of the data structure representing the heap
353354
*/
354355
void push_back(TimerPtr timer)
@@ -360,10 +361,9 @@ class TimersManager
360361
* @brief Friend declaration to allow the store function to access the underlying
361362
* heap container
362363
*/
363-
friend void WeakTimersHeap::store(const TimersHeap& heap);
364-
365-
private:
364+
friend void WeakTimersHeap::store(const TimersHeap & heap);
366365

366+
private:
367367
/**
368368
* @brief Comparison function between timers.
369369
*/

rclcpp/src/rclcpp/executors/events_executor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ EventsExecutor::execute_event(const rmw_listener_event_t & event)
274274
{
275275
auto subscription = entities_collector_->get_subscription(event.entity);
276276

277-
if(subscription) {
277+
if (subscription) {
278278
execute_subscription(subscription);
279279
}
280280
break;
@@ -284,7 +284,7 @@ EventsExecutor::execute_event(const rmw_listener_event_t & event)
284284
{
285285
auto service = entities_collector_->get_service(event.entity);
286286

287-
if(service) {
287+
if (service) {
288288
execute_service(service);
289289
}
290290
break;
@@ -294,7 +294,7 @@ EventsExecutor::execute_event(const rmw_listener_event_t & event)
294294
{
295295
auto client = entities_collector_->get_client(event.entity);
296296

297-
if(client) {
297+
if (client) {
298298
execute_client(client);
299299
}
300300
break;
@@ -304,7 +304,7 @@ EventsExecutor::execute_event(const rmw_listener_event_t & event)
304304
{
305305
auto waitable = entities_collector_->get_waitable(event.entity);
306306

307-
if(waitable) {
307+
if (waitable) {
308308
waitable->execute();
309309
}
310310
break;

rclcpp/src/rclcpp/executors/events_executor_entities_collector.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ EventsExecutorEntitiesCollector::get_subscription(const void * subscription_id)
506506
auto subscription_weak_ptr = it->second;
507507
auto subscription_shared_ptr = subscription_weak_ptr.lock();
508508

509-
if(subscription_shared_ptr) {
509+
if (subscription_shared_ptr) {
510510
return subscription_shared_ptr;
511511
}
512512

@@ -525,7 +525,7 @@ EventsExecutorEntitiesCollector::get_client(const void * client_id)
525525
auto client_weak_ptr = it->second;
526526
auto client_shared_ptr = client_weak_ptr.lock();
527527

528-
if(client_shared_ptr) {
528+
if (client_shared_ptr) {
529529
return client_shared_ptr;
530530
}
531531

@@ -544,7 +544,7 @@ EventsExecutorEntitiesCollector::get_service(const void * service_id)
544544
auto service_weak_ptr = it->second;
545545
auto service_shared_ptr = service_weak_ptr.lock();
546546

547-
if(service_shared_ptr) {
547+
if (service_shared_ptr) {
548548
return service_shared_ptr;
549549
}
550550

@@ -563,7 +563,7 @@ EventsExecutorEntitiesCollector::get_waitable(const void * waitable_id)
563563
auto waitable_weak_ptr = it->second;
564564
auto waitable_shared_ptr = waitable_weak_ptr.lock();
565565

566-
if(waitable_shared_ptr) {
566+
if (waitable_shared_ptr) {
567567
return waitable_shared_ptr;
568568
}
569569

0 commit comments

Comments
 (0)