Class SimpleEventsQueue
Defined in File simple_events_queue.hpp
Inheritance Relationships
Base Type
public rclcpp::experimental::executors::EventsQueue
(Class EventsQueue)
Class Documentation
-
class SimpleEventsQueue : public rclcpp::experimental::executors::EventsQueue
This class implements an EventsQueue as a simple wrapper around a std::queue. It does not perform any checks about the size of queue, which can grow unbounded without being pruned. The simplicity of this implementation makes it suitable for optimizing CPU usage.
Public Functions
-
~SimpleEventsQueue() override = default
-
inline virtual void enqueue(const rclcpp::experimental::executors::ExecutorEvent &event) override
enqueue event into the queue Thread safe
- Parameters:
event – The event to enqueue into the queue
-
inline virtual bool dequeue(rclcpp::experimental::executors::ExecutorEvent &event, std::chrono::nanoseconds timeout = std::chrono::nanoseconds::max()) override
waits for an event until timeout, gets a single event Thread safe
- Returns:
true if event, false if timeout
-
inline virtual bool empty() const override
Test whether queue is empty Thread safe.
- Returns:
true if the queue’s size is 0, false otherwise.
-
inline virtual size_t size() const override
Returns the number of elements in the queue. Thread safe.
- Returns:
the number of elements in the queue.
-
~SimpleEventsQueue() override = default