local static instance (id) current;
instance (id) current;
RunLoop
, creating it if it does not yet
exist.
DescriptorSet read_set;
DescriptorSet write_set;
tom.Heap timers;
public mutable RunLoopDelegate delegate;
boolean d_changed;
TRUE
, one of the descriptor sets was changed, indicating to
the run
method that it should update some of its local variables.
boolean t_changed;
TRUE
, the timers
was changed.
public mutable boolean time_manipulation;
TRUE
, we perform time manipulation (which is only advisable
in a single-threaded environment), in which case select is always
done with a 0 timeout. If no events are pending on any descriptor
being watched, the earliest timer fires immediately, and time is
adjusted accordingly (but only if its fire date does not lie in the
past).
id (self) init;
void run;
void addDescriptorForRead tom.Descriptor descriptor delegate DescriptorReadDelegate delegate;
descriptor
to this runloop, read events on which are to be
handled by the delegate
. This does not protect against adding the
descriptor
to only a single runloop.
void addDescriptorForWrite tom.Descriptor descriptor delegate DescriptorWriteDelegate delegate;
addDescriptorForRead delegate
, add the descriptor
to
this runloop, write events on which are to be handled by the
delegate
.
void removeReadDescriptor tom.Descriptor descriptor;
descriptor
from this runloop. No check is performed on
whether the descriptor
actually is registered for reading with this
runloop.
void removeWriteDescriptor tom.Descriptor descriptor;
removeReadDescriptor
, but the descriptor
is removed
from the write set.
void add_timer Timer timer;
timer
to the current run loop.
void remove_timer Timer timer;
timer
which is scheduled with this run loop.
deferred void runLoopWillSelect RunLoop loop;
RunLoop
loop
will do another select.
tom.All
provides delayed perform
ance.
void perform selector sel after double seconds with dynamic arguments pre seconds >= 0;
sel
with the arguments
after seconds
delay. Even if seconds
is 0, the invocation is not fired
immediately; a timer is always set to have the RunLoop
fire the
invocation.