Interface: tos.interfaces.Queue
interface Queue<typedef t>
Interface to a FIFO list (queue) that contains items
of a specific type. The queue has a maximum size.
- Author:
-
Philip Levis
-
Kyle Jamieson
- Date:
-
$Date: 2008/06/04 03:00:31 $
Commands
command t dequeue()
command t element(uint8_t idx)
command bool empty()
command error_t enqueue(t newVal)
command t head()
command uint8_t maxSize()
command uint8_t size()
Commands - Details
dequeue
command t dequeue()
- Returns:
-
't ONE' The head of the queue.
element
command t element(uint8_t idx)
- Parameters:
-
index - - the index of the element to return
- Returns:
-
't ONE' the requested element in the queue.
empty
command bool empty()
- Returns:
-
Whether the queue is empty.
enqueue
command error_t enqueue(t newVal)
- Parameters:
-
't ONE newVal' - the element to enqueue
- Returns:
-
SUCCESS if the element was enqueued successfully, FAIL
if it was not enqueued.
head
command t head()
- Returns:
-
't ONE' The head of the queue.
maxSize
command uint8_t maxSize()
- Returns:
-
The maximum queue size.
size
command uint8_t size()
- Returns:
-
The number of elements in the queue.