[operations] [attributes] [fields] [template] [definition]
[implementation] [documentation]
To use the search tool you need to use a browser which supports JAVA (c)

[next] [prev] [superclass] [next peer] [prev peer] [subclass] [index] [hierarchy]

InputQueue

inherits from Object
inherits from HasReinitialize

Object <- InputQueue



Operations

Get list of all operations

Clear
ClearIfAnyTouchInputsInBox
DequeueInput
EachPendingInput
NextTouchInputIfInBox
QueueInput
Reinitialize
ReleaseInput


Attributes

Get list of all attributes

HasElements


Fields

Field Type
InputQueue: inputs: SortedInputList
guard: Semaphore


Instance template

instance InputQueue tag;
         inputs: nilObject;
          guard: nilObject;
end instance;

Class definition

// InputQueue keeps inputs pending
Define Class InputQueue;
    inherits from Object, HasReinitialize;

    field inputs: SortedInputList;
    field guard: Semaphore;

    // queueing inputs
    operation QueueInput(input: Input);
        // queue one input and kick the user actor

    // examining and dequeueing inputs
    operation DequeueInput(): Input;
        // return oldest input (do not block)
    operation EachPendingInput(function: EachFunction; parameters: Pointer): Object;
        // if an Input is returned, dequeue it (must call ReleaseInput later)
    operation ReleaseInput(input: Input);
        // done with input previously dequeued

    // queue as a whole
    attribute HasElements: Boolean, readOnly;
        // are there any inputs on the queue?
    operation Clear(), noFail;
        // flush all inputs

    // useful covers
    operation NextTouchInputIfInBox(box: Box): TouchInput, intrinsic;
    operation ClearIfAnyTouchInputsInBox(box: Box), intrinsic;

    overrides Reinitialize;
end class;