Skip to content

Commit

Permalink
(NumberOfEntities) add __iadd__
Browse files Browse the repository at this point in the history
Signed-off-by: Matthijs van der Burgh <[email protected]>
  • Loading branch information
MatthijsBurgh committed May 17, 2024
1 parent 99f1ce9 commit 7ccbf53
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions rclpy/rclpy/waitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ def __add__(self, other):
setattr(result, attr, left + right)
return result

def __iadd__(self, other):
self.num_subscriptions += other.num_subscriptions
self.num_guard_conditions += other.num_guard_conditions
self.num_timers += other.num_timers
self.num_clients += other.num_clients
self.num_services += other.num_services
self.num_events += other.num_events
return self

def __repr__(self):
return '<{0}({1}, {2}, {3}, {4}, {5}, {6})>'.format(
self.__class__.__name__, self.num_subscriptions,
Expand Down

0 comments on commit 7ccbf53

Please sign in to comment.