Interface: tos.interfaces.ResourceQueue

interface ResourceQueue

A queue interface for managing client ids when performing resource arbitration. A single slot in the queue is guaranteed to each resource client, with the actual queing policy determined by the implementation of the interface.

Author:
Kevin Klues <klueska@cs.wustl.edu>
Date:
$Date: 2006/12/12 18:23:15 $

Commands
command resource_client_id_t dequeue() Retreive the cleint id of the next resource in the queue.
command error_t enqueue(resource_client_id_t id) Enqueue a cleint id
command bool isEmpty() Check to see if the queue is empty.
command bool isEnqueued(resource_client_id_t id) Check to see if a given cleint id has already been enqueued and is waiting to be processed.

Commands - Details

dequeue

command resource_client_id_t dequeue()

Retreive the cleint id of the next resource in the queue. If the queue is empty, the return value is undefined.

Returns:
The cleint id at the head of the queue.

enqueue

command error_t enqueue(resource_client_id_t id)

Enqueue a cleint id

Parameters:
cleintId - - the cleint id to enqueue
Returns:
SUCCESS if the client id was enqueued successfully
EBUSY if it has already been enqueued.

isEmpty

command bool isEmpty()

Check to see if the queue is empty.

Returns:
TRUE if the queue is empty.
FALSE if there is at least one entry in the queue

isEnqueued

command bool isEnqueued(resource_client_id_t id)

Check to see if a given cleint id has already been enqueued and is waiting to be processed.

Returns:
TRUE if the client id is in the queue.
FALSE if it does not