Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.VM.interfaces.BombillaQueue.nc

Interface: BombillaQueue

Interface for operating on Bombilla context queues.

Components providing this interface:
tos.lib.VM.components.BQueue
tos.lib.VM.components.BQueueProxy

Components requiring this interface:
tos.lib.VM.components.BContextSynch
tos.lib.VM.components.BombillaEngineM
tos.lib.VM.opcodes.OPsendM
tos.lib.VM.opcodes.OPsendrM
tos.lib.VM.opcodes.OPsenseM
tos.lib.VM.opcodes.OPuartM

Commands

Commands - Details

init

result_t init(BombillaQueue *queue)

Initialize a queue.

Parameters:

queue - The queue to initialize.

Returns: SUCCESS if initialized properly, FAIL otherwise.

empty

bool empty(BombillaQueue *queue)

Whether a queue is empty.

Parameters:

queue - The queue whose emptiness is being queried.

Returns: TRUE if empty, FALSE otherwise.

enqueue

result_t enqueue(BombillaContext *context, BombillaQueue *queue, BombillaContext *element)

Enqueue a context onto a queue on behalf of a context. The context to be put on the queue cannot currently be on another queue.

Parameters:

context - The context performing the enqueue operation.

queue - The queue on which the element is to be placed.

element - The context to be placed on the queue.

Returns: SUCCESS if enqueued properly, FAIL otherwise.

dequeue

BombillaContext dequeue(BombillaContext *context, BombillaQueue *queue)

Dequeue the next context from a queue.

Parameters:

context - The context performing the dequeue operation.

queue - The queue from which the context is to be removed.

Returns: The removed context, NULL if queue was empty.

remove

result_t remove(BombillaContext *context, BombillaQueue *queue, BombillaContext *element)

Remove a specific context element from a queue.

Parameters:

context - The context performing the remove operation.

queue - The queue from which the element is to be removed.

element - The context to be removed from the queue.

Returns: SUCCESS if removed properly, FAIL if not removed or element was not on queue.