home
wiki
classes/clusters list
class information
+
Point of view
All features
ANY
INTERNALS_HANDLER
All features
class SIGNAL_2 [E, F]
Summary
top
See tutorial/signal/signals.txt for usage
Direct parents
insert list:
ANY
Class invariant
top
callbacks
/= Void
Overview
top
creation features
make
Initialize new signal object
features
callbacks
:
FAST_ARRAY
[
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]]]
index
:
INTEGER_32
work to do while emit is between index and last.
last
:
INTEGER_32
work to do while emit is between index and last.
make
Initialize new signal object
connect
(p:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]])
Connect procedure to be called when signal is emitted See also last_connect_id
emit
(val1: E, val2: F)
Emit signal, ie.
last_connect_id
:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]]
return identifier on the last connect which may be used for disconnect (unregister procedure)
disconnect
(connect_identifier:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]])
Unregister procedure for this signal.
is_empty
:
BOOLEAN
return True if no callback is registred for this signal
callbacks
:
FAST_ARRAY
[
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]]]
writable attribute
top
index
:
INTEGER_32
writable attribute
top
work to do while emit is between index and last.
last
:
INTEGER_32
writable attribute
top
work to do while emit is between index and last.
make
effective procedure
top
Initialize new signal object
ensure
callbacks
.is_empty
connect
(p:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]])
effective procedure
top
Connect procedure to be called when signal is emitted See also last_connect_id
require
p /= Void
ensure
not
callbacks
.is_empty
last_connect_id
= p
emit
(val1: E, val2: F)
effective procedure
top
Emit signal, ie.
already registred procedure will be called in registration order except if removed by another before.
last_connect_id
:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]]
effective function
top
return identifier on the last connect which may be used for disconnect (unregister procedure)
require
not
is_empty
ensure
Result /= Void
disconnect
(connect_identifier:
PROCEDURE
[
TUPLE
[
TUPLE 2
[E, F]]])
effective procedure
top
Unregister procedure for this signal.
If the same procedure was registred many times, only first is removed.
ensure
old
callbacks
.fast_has(connect_identifier) implies
callbacks
.count = old
callbacks
.count - 1
old not
callbacks
.fast_has(connect_identifier) implies
callbacks
.count = old
callbacks
.count
is_empty
:
BOOLEAN
effective function
top
return True if no callback is registred for this signal