Event::AsyncEventPlainQueue Class Reference
A simple FIFO queue for events. More...
#include <AsyncEventRef.h>
Inheritance diagram for Event::AsyncEventPlainQueue:
Public Member Functions | |
| void | Insert (AsyncEvent *event) |
| Insert in queue. | |
| virtual void | extract () |
| Subordinate extract mechanism. | |
| AsyncEvent * | First () |
| Remove first element of queue. | |
| AsyncEvent * | Last () |
| Remove last element of queue. | |
| bool | HasEvents () const |
| Return true if there are queued events. | |
Detailed Description
A simple FIFO queue for events.
Definition at line 26 of file AsyncEventRef.h.
Constructor & Destructor Documentation
◆ AsyncEventPlainQueue()
|
inline |
Definition at line 37 of file AsyncEventRef.h.
37 {
38 _next = _prev = this;
39 }
Member Function Documentation
◆ Insert()
|
inline |
Insert in queue.
Definition at line 42 of file AsyncEventRef.h.
42 {
43 AsyncEventPlainQueue *newq = _freelist;
44 if ( newq ) {
45 _freelist = newq->_next;
46 newq->Set (event);
47 } else {
48 newq = new AsyncEventPlainQueue (event);
49 }
50
51 _prev->_next = newq;
52 newq->_prev = _prev;
53 newq->_next = this;
54 _prev = newq;
55 }
◆ extract()
|
inlinevirtual |
Subordinate extract mechanism.
Definition at line 58 of file AsyncEventRef.h.
58 {
59 _prev->_next = _next;
60 _next->_prev = _prev;
61 _next = _freelist;
62
63 _freelist = this;
64 }
◆ First()
|
inline |
Remove first element of queue.
Definition at line 67 of file AsyncEventRef.h.
67 {
68 if ( _next == this )
69 return 0;
70
71 return _next->Extract();
72 }
◆ Last()
|
inline |
Remove last element of queue.
Definition at line 75 of file AsyncEventRef.h.
75 {
76 if ( _prev == this )
77 return 0;
78
79 return _prev->Extract();
80 }
◆ HasEvents()
|
inline |
Return true if there are queued events.
Definition at line 83 of file AsyncEventRef.h.
83 {
84 return _next != this;
85 }
The documentation for this class was generated from the following files: