|
Open Model Railroad Network (OpenMRN)
|
A simple fast single-linked stack class with non-virtual methods. More...
#include <SimpleQueue.hxx>
Classes | |
| class | end_iterator |
| Static iterator class pointing to the "end" of the queue. More... | |
| class | iterator |
| STL-compatible iterator for SimpleQueue. More... | |
| class | typed_iterator |
| STL-compatible iterator for TypedQueue. More... | |
Public Member Functions | |
| bool | empty () |
| void | push_front (QMember *member) |
| Adds an entry to the front of the queue. | |
| QMember * | pop_front () |
| Removes the entry at the front of the queue. | |
| QMember * | front () const |
| peeks. | |
| iterator | begin () |
| end_iterator | end () |
| void | insert (const iterator &position, QMember *entry) |
| Inserts the element entry before the position. | |
| void | erase (const iterator &position) |
| Removes the entry pointed to by the iterator. | |
Protected Attributes | |
| QMember * | head_ |
| Top pointer for the stack. | |
Static Protected Attributes | |
| static QMember *const | PTR_END = nullptr |
| Used as a guard for comparing against for the end of the queue. | |
A simple fast single-linked stack class with non-virtual methods.
This structure allows putting QMember descendants (including buffers, stateflows, exeutables etc) into a queue without incurring the overhead of the virtual methods and allocation semantics of BufferQueue.
SimpleQueue does not support asynchronous access, allocation/deallocation and notification, but supports strongly typed access (via TypedQueue) and queueing types other than Buffers. Almost all functions on SimpleQueue compile into just a few machine instructions.
Definition at line 49 of file SimpleQueue.hxx.
|
inline |
Definition at line 51 of file SimpleQueue.hxx.
|
inline |
Definition at line 144 of file SimpleQueue.hxx.
|
inline |
Definition at line 54 of file SimpleQueue.hxx.
|
inline |
Definition at line 151 of file SimpleQueue.hxx.
|
inline |
Removes the entry pointed to by the iterator.
The iterator will afterwards point to the next member after the removed one (or end() if this was the last member). Invalidates any other iterator pointing just behind the marked position (but not iterators pointing elsewhere).
| position | iterator to entry to remove |
Definition at line 171 of file SimpleQueue.hxx.
|
inline |
Inserts the element entry before the position.
The iterator will point to the new member.
| position | which entry to insert before |
| entry | what to insert before *position. |
Definition at line 160 of file SimpleQueue.hxx.
|
inline |
Removes the entry at the front of the queue.
Definition at line 67 of file SimpleQueue.hxx.
|
inline |
Adds an entry to the front of the queue.
| member | entry to add. |
Definition at line 59 of file SimpleQueue.hxx.
|
protected |
Top pointer for the stack.
Definition at line 183 of file SimpleQueue.hxx.
|
staticprotected |
Used as a guard for comparing against for the end of the queue.
Definition at line 180 of file SimpleQueue.hxx.