@@ -174,37 +174,76 @@ class ExecutorEntitiesCollector
174174 rclcpp::GuardCondition::WeakPtr,
175175 std::owner_less<rclcpp::CallbackGroup::WeakPtr>>;
176176
177+ // / Implementation of removing a node from the collector.
178+ /* *
179+ * This will disassociate the node from the collector and remove any
180+ * automatically-added callback groups
181+ *
182+ * This takes and returns an iterator so it may be used as:
183+ *
184+ * it = remove_weak_node(it);
185+ *
186+ * \param[in] weak_node iterator to the weak node to be removed
187+ * \return Valid updated iterator in the same collection
188+ */
177189 RCLCPP_PUBLIC
178190 NodeCollection::iterator
179191 remove_weak_node (NodeCollection::iterator weak_node);
180192
193+ // / Implementation of removing a callback gruop from the collector.
194+ /* *
195+ * This will disassociate the callback group from the collector
196+ *
197+ * This takes and returns an iterator so it may be used as:
198+ *
199+ * it = remove_weak_callback_group(it);
200+ *
201+ * \param[in] weak_group_it iterator to the weak group to be removed
202+ * \param[in] collection the collection to remove the group from
203+ * (manually or automatically added)
204+ * \return Valid updated iterator in the same collection
205+ */
181206 RCLCPP_PUBLIC
182207 CallbackGroupCollection::iterator
183208 remove_weak_callback_group (
184209 CallbackGroupCollection::iterator weak_group_it,
185210 CallbackGroupCollection & collection);
186211
212+ // / Implementation of adding a callback group
213+ /* *
214+ * \param[in] group_ptr the group to add
215+ * \param[in] collection the collection to add the group to
216+ */
187217 RCLCPP_PUBLIC
188218 void
189219 add_callback_group_to_collection (
190220 rclcpp::CallbackGroup::SharedPtr group_ptr,
191221 CallbackGroupCollection & collection);
192222
223+ // / Implementation of removing a callback group
224+ /* *
225+ * \param[in] group_ptr the group to remove
226+ * \param[in] collection the collection to remove the group from
227+ */
193228 RCLCPP_PUBLIC
194229 void
195230 remove_callback_group_from_collection (
196231 rclcpp::CallbackGroup::SharedPtr group_ptr,
197232 CallbackGroupCollection & collection);
198233
234+ // / Iterate over queued added/remove nodes and callback_groups
199235 RCLCPP_PUBLIC
200236 void
201237 process_queues ();
202238
239+ // / Check a collection of nodes and add any new callback_groups that
240+ // / are set to be automatically associated via the node.
203241 RCLCPP_PUBLIC
204242 void
205243 add_automatically_associated_callback_groups (
206244 const NodeCollection & nodes_to_check);
207245
246+ // / Check all nodes and group for expired weak pointers and remove them.
208247 RCLCPP_PUBLIC
209248 void
210249 prune_invalid_nodes_and_groups ();
@@ -218,15 +257,28 @@ class ExecutorEntitiesCollector
218257 // / nodes that are associated with the executor
219258 NodeCollection weak_nodes_;
220259
260+ // / mutex to protect pending queues
221261 std::mutex pending_mutex_;
262+
263+ // / nodes that have been added since the last update.
222264 NodeCollection pending_added_nodes_;
265+
266+ // / nodes that have been removed since the last update.
223267 NodeCollection pending_removed_nodes_;
268+
269+ // / callback groups that have been added since the last update.
224270 CallbackGroupCollection pending_manually_added_groups_;
271+
272+ // / callback groups that have been removed since the last update.
225273 CallbackGroupCollection pending_manually_removed_groups_;
226274
275+ // / Track guard conditions associated with added nodes
227276 WeakNodesToGuardConditionsMap weak_nodes_to_guard_conditions_;
277+
278+ // / Track guard conditions associated with added callback groups
228279 WeakGroupsToGuardConditionsMap weak_groups_to_guard_conditions_;
229280
281+ // / Waitable to add guard conditions to
230282 std::shared_ptr<ExecutorNotifyWaitable> notify_waitable_;
231283};
232284} // namespace executors
0 commit comments