FreeNOS
|
Array of items as a First-In-First-Out (FIFO) datastructure. More...
#include <Queue.h>
Public Member Functions | |
Queue () | |
Default constructor. More... | |
bool | push (const T &item) |
Add item to the head of the Queue. More... | |
T & | pop () |
Remove item from the tail of the Queue. More... | |
bool | contains (const T &item) const |
Look if an item exists on the Queue. More... | |
Size | remove (T value) |
Remove all items with the given value. More... | |
virtual void | clear () |
Removes all items from the Queue. More... | |
virtual Size | size () const |
Returns the maximum size of this Queue. More... | |
virtual Size | count () const |
Returns the number of items in the Queue. More... | |
Public Member Functions inherited from Container | |
Container () | |
Constructor. More... | |
virtual | ~Container () |
Destructor. More... | |
virtual bool | isEmpty () const |
Check if the Container is empty. More... | |
virtual bool | reserve (Size size) |
Ensure that at least the given size is available. More... | |
virtual bool | shrink (Size size) |
Shrink the container size by the given amount of items. More... | |
virtual Size | squeeze () |
Try to minimize the memory required in the Container. More... | |
virtual bool | resize (Size size) |
Change the size of the Container. More... | |
Private Attributes | |
T | m_array [N] |
The actual array where the data is stored. More... | |
uint | m_head |
Head of the queue. More... | |
uint | m_tail |
Tail of the queue. More... | |
uint | m_count |
Number of items in the queue. More... | |
Array of items as a First-In-First-Out (FIFO) datastructure.
|
inlinevirtual |
Removes all items from the Queue.
Implements Container.
Definition at line 131 of file Queue.h.
Referenced by Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::Queue().
|
inline |
Look if an item exists on the Queue.
item | Item reference |
Definition at line 92 of file Queue.h.
Referenced by ProcessManager::sleep().
Returns the number of items in the Queue.
Implements Container.
Definition at line 153 of file Queue.h.
Referenced by Scheduler::count(), Scheduler::dequeue(), Sun8iEmac::interrupt(), ProcessManager::schedule(), Scheduler::select(), Sun8iEmac::startDMA(), and Sun8iEmac::transmit().
|
inline |
Remove item from the tail of the Queue.
Definition at line 76 of file Queue.h.
Referenced by Scheduler::dequeue(), Sun8iEmac::interrupt(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::remove(), ProcessManager::schedule(), Scheduler::select(), and Sun8iEmac::startDMA().
|
inline |
Add item to the head of the Queue.
item | The item to add |
Definition at line 55 of file Queue.h.
Referenced by Scheduler::dequeue(), Scheduler::enqueue(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::remove(), ProcessManager::schedule(), Scheduler::select(), ProcessManager::sleep(), Sun8iEmac::startDMA(), and Sun8iEmac::transmit().
Remove all items with the given value.
value | Value to remove. |
Definition at line 110 of file Queue.h.
Referenced by ProcessManager::enqueueProcess(), and ProcessManager::remove().
|
private |
The actual array where the data is stored.
Definition at line 161 of file Queue.h.
Referenced by Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::contains(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::pop(), and Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::push().
Number of items in the queue.
Definition at line 170 of file Queue.h.
Referenced by Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::clear(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::contains(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::count(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::pop(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::push(), and Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::remove().
Head of the queue.
Definition at line 164 of file Queue.h.
Referenced by Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::clear(), and Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::push().
Tail of the queue.
Definition at line 167 of file Queue.h.
Referenced by Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::clear(), Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::contains(), and Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >::pop().