ROS 2 rclcpp + rcl - jazzy  jazzy
ROS 2 C++ Client Library with ROS Client Library
Public Member Functions | List of all members
rclcpp::experimental::executors::EventsQueue Class Referenceabstract

This abstract class can be used to implement different types of queues where ExecutorEvent can be stored. The derived classes should choose which underlying container to use and the strategy for pushing and popping events. For example a queue implementation may be bounded or unbounded and have different pruning strategies. Implementations may or may not check the validity of events and decide how to handle the situation where an event is not valid anymore (e.g. a subscription history cache overruns) More...

#include <rclcpp/experimental/executors/events_executor/events_queue.hpp>

Inheritance diagram for rclcpp::experimental::executors::EventsQueue:
Inheritance graph
[legend]

Public Member Functions

virtual RCLCPP_PUBLIC ~EventsQueue ()=default
 Destruct the object.
 
virtual RCLCPP_PUBLIC void enqueue (const rclcpp::experimental::executors::ExecutorEvent &event)=0
 push event into the queue More...
 
virtual RCLCPP_PUBLIC bool dequeue (rclcpp::experimental::executors::ExecutorEvent &event, std::chrono::nanoseconds timeout=std::chrono::nanoseconds::max())=0
 Extracts an event from the queue, eventually waiting until timeout if none is available. More...
 
virtual RCLCPP_PUBLIC bool empty () const =0
 Test whether queue is empty. More...
 
virtual RCLCPP_PUBLIC size_t size () const =0
 Returns the number of elements in the queue. More...
 

Detailed Description

This abstract class can be used to implement different types of queues where ExecutorEvent can be stored. The derived classes should choose which underlying container to use and the strategy for pushing and popping events. For example a queue implementation may be bounded or unbounded and have different pruning strategies. Implementations may or may not check the validity of events and decide how to handle the situation where an event is not valid anymore (e.g. a subscription history cache overruns)

Definition at line 42 of file events_queue.hpp.

Member Function Documentation

◆ dequeue()

virtual RCLCPP_PUBLIC bool rclcpp::experimental::executors::EventsQueue::dequeue ( rclcpp::experimental::executors::ExecutorEvent event,
std::chrono::nanoseconds  timeout = std::chrono::nanoseconds::max() 
)
pure virtual

Extracts an event from the queue, eventually waiting until timeout if none is available.

Returns
true if event has been found, false if timeout

Implemented in rclcpp::experimental::executors::SimpleEventsQueue.

◆ empty()

virtual RCLCPP_PUBLIC bool rclcpp::experimental::executors::EventsQueue::empty ( ) const
pure virtual

Test whether queue is empty.

Returns
true if the queue's size is 0, false otherwise.

Implemented in rclcpp::experimental::executors::SimpleEventsQueue.

◆ enqueue()

virtual RCLCPP_PUBLIC void rclcpp::experimental::executors::EventsQueue::enqueue ( const rclcpp::experimental::executors::ExecutorEvent event)
pure virtual

push event into the queue

Parameters
eventThe event to push into the queue

Implemented in rclcpp::experimental::executors::SimpleEventsQueue.

◆ size()

virtual RCLCPP_PUBLIC size_t rclcpp::experimental::executors::EventsQueue::size ( ) const
pure virtual

Returns the number of elements in the queue.

Returns
the number of elements in the queue.

Implemented in rclcpp::experimental::executors::SimpleEventsQueue.


The documentation for this class was generated from the following file: