StuBS
GateQueue Class Reference

Queue for Gates. More...

#include <interrupt/gatequeue.h>

Public Member Functions

bool enqueue (Gate *item)
 Enqueues the provided item at the end of the queue. More...
 
Gatedequeue ()
 Removes the first element in the queue and returns it. More...
 

Detailed Description

Queue for Gates.

While for OOStuBS a simple linked list is sufficient (by having a head pointer in this calls and extending Gate with a next pointer), for multi-core systems like MPStuBS it needs to be able to enqueue the same Gate item on each Core (up to Core::MAX) at the same time (a multi-queue, requiring a head pointer array member in this class and a next pointer array in Gate).

Member Function Documentation

◆ enqueue()

bool GateQueue::enqueue ( Gate item)

Enqueues the provided item at the end of the queue.

In MPStuBS the item is added to the internal queue belonging to the core it is currently executed on.

Parameters
itemQueue element to be appended.
Returns
true if successfully added to the queue, false if it is already in the queue
Todo:
Implement Method

◆ dequeue()

Gate * GateQueue::dequeue ( )

Removes the first element in the queue and returns it.

In MPStuBS the item is retrieved from the internal queue belonging to the core it is currently executed on.

Returns
Pointer to the removed item or nullptr if the queue was empty.
Todo:
Implement Method

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