Class: SEventQueue

Environment: Siren
Superclass: SequenceableCollection
Category: Music-Support
Instance variables: first last
Indexed variables: objects
Class variables: CurrentRecord RecordPool

An SEventQueue is a doubly-linked list that has methods for inserting elements in time-sorted order.
These are used for real-time schedules because they can have faster search methods than using SortedCollections of OrderedCollections for the EventScheduler.
The current implementation uses a simple linear search. For really big schedules, this could be made faster with a binary search or tree-based schedule.

Instance Variables:
first The first event in the Q
last The last event in the Q

accessing

add: eventAss
Add the given eventAssociation to the receiver in the right place.

add: eventAss loop: aBool
Add the given eventAssociation to the receiver in the right place.

asOrderedCollection
Answer a copy of the receiver's items

detect: aBlock
Walk the list looking

do: aBlock
Refer to the comment in Collection|do:.

includes: sought

isEmpty

itemNamed: theName
Answer a copy of the receiver's items

ready: now
Answer whether there's an event ready within 5000 usec of the given time

removeAllSuchThat: aBlock
Remove each element for which aBlock evaluates to true.

removeFirst
Remove and answer the first item from the list.

size
Answer how many elements the receiver contains.

private

locateSlotFor: start
Find the proper slot for inserting a new event with the given start time.

printing

printOn: aStream
Append to the argument aStream a sequence of characters that identifies the receiver.

MetaClass: SEventQueue class

record pool

initialize
Set up the class's record pool

nextRecord
Set up the class's record pool