17
17
18
18
#include < queue>
19
19
20
- #include " rclcpp/executors/events_executor_entities_collector.hpp"
21
20
#include " rclcpp/macros.hpp"
21
+ #include " rclcpp/visibility_control.hpp"
22
22
23
23
#include " rmw/listener_event_types.h"
24
24
@@ -30,10 +30,14 @@ namespace buffers
30
30
{
31
31
32
32
/* *
33
- * @brief This abstract class is intended to be used as
34
- * a wrapper around a queue. The derived classes should chose
35
- * which container to use and the strategies for push and prune
36
- * events from the queue.
33
+ * @brief This abstract class can be used to implement different types of queues
34
+ * where `rmw_listener_event_t` can be stored.
35
+ * The derived classes should choose which underlying container to use and
36
+ * the strategy for pushing and popping events.
37
+ * For example a queue implementation may be bounded or unbounded and have
38
+ * different pruning strategies.
39
+ * Implementations may or may not check the validity of events and decide how to handle
40
+ * the situation where an event is not valid anymore (e.g. a subscription history cache overruns)
37
41
*/
38
42
class EventsQueue
39
43
{
@@ -56,9 +60,7 @@ class EventsQueue
56
60
push (const rmw_listener_event_t & event) = 0 ;
57
61
58
62
/* *
59
- * @brief removes front element from the queue
60
- * The element removed is the "oldest" element in the queue whose
61
- * value can be retrieved by calling member front().
63
+ * @brief removes front element from the queue.
62
64
*/
63
65
RCLCPP_PUBLIC
64
66
virtual
@@ -101,14 +103,13 @@ class EventsQueue
101
103
init () = 0 ;
102
104
103
105
/* *
104
- * @brief gets a queue with all events accumulated on it since
105
- * the last call. The member queue is empty when the call returns.
106
+ * @brief pops out all events stored in the object into an output queue.
106
107
* @return queue with events
107
108
*/
108
109
RCLCPP_PUBLIC
109
110
virtual
110
111
std::queue<rmw_listener_event_t >
111
- get_all_events () = 0 ;
112
+ pop_all_events () = 0 ;
112
113
};
113
114
114
115
} // namespace buffers
0 commit comments