Object <- InputQueue |
|
|
Clear ClearIfAnyTouchInputsInBox DequeueInput EachPendingInput NextTouchInputIfInBox QueueInput Reinitialize ReleaseInput |
|
HasElements |
| Field | Type | |
|---|---|---|
| InputQueue: | inputs: | SortedInputList |
| guard: | Semaphore |
instance InputQueue tag; inputs: nilObject; guard: nilObject; end instance;
// 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;