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 authored May 17, 2024
1 parent 99f1ce9 commit 4f3846d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rclpy/rclpy/waitable.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ 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 4f3846d

Please sign in to comment.