DequeEventQueue Class
Concrete implementation of an EventQueue that uses a Deque as its underlying queue strategy. Adding and removing events follows a FIFO strategy. More...
Declaration
Base class
| class | EventQueue |
|
Abstract base class defining an interface for an EventQueue. More... | |
Public Member Functions Index
| EventQueue & | add (std::unique_ptr< const Event > event) override |
|
Takes ownership of the event and moves it at the end of the queue. More... | |
| EventQueue & | addOrReplace (std::unique_ptr< const Event > event, const std::function< bool(const std::unique_ptr< const Event > &evt, const std::unique_ptr< const Event > &e)> &cmpFunc) override |
|
Adds an event to the queue or replaces an existing one. More... | |
| bool | empty () const noexcept override |
|
Returns true if the queue is empty, otherwise false. More... | |
| std::unique_ptr< const Event > | next () override |
|
Retrieves and returns the next event from the front of the queue. More... | |
Private Member Attributes Index
| std::deque< std::unique_ptr< const Event > > | events |
|
The internal deque for storing the events. More... | |
Description
Concrete implementation of an EventQueue that uses a Deque as its underlying queue strategy. Adding and removing events follows a FIFO strategy.
Definition at line 28 of file DequeEventQueue.ixx.
Public Member Functions
add()
| inline virtual |
Takes ownership of the event and moves it at the end of the queue.
- Parameters
-
event A unique_ptr to the event that should be managed by this class.
- Returns
Definition at line 45 of file DequeEventQueue.ixx.
addOrReplace()
| inline virtual |
Adds an event to the queue or replaces an existing one.
- Parameters
-
event A unique_ptr to the event this queue takes the ownership of.
cmpFunc The cmp function that is used for looking up and replacing an existing event with the soecified event.
- Returns
Definition at line 60 of file DequeEventQueue.ixx.
empty()
| inline nodiscard noexcept virtual |
Returns true if the queue is empty, otherwise false.
- Returns
True if the queue is empty, otherwise false.
Definition at line 78 of file DequeEventQueue.ixx.
next()
| inline virtual |
Retrieves and returns the next event from the front of the queue.
- Returns
A unique_ptr to the next event in teh queue, i.e. from the front position of the queue.
Definition at line 89 of file DequeEventQueue.ixx.
Private Member Attributes
events
|
The internal deque for storing the events.
Definition at line 34 of file DequeEventQueue.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.