GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
SIGNAL_2
+
Point of view
All features
ANY
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
{
ANY
}
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
{
ANY
}
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 registered 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
{
ANY
}
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
{
ANY
}
top
Emit signal, ie.
already registered procedure will be called in registration order except if removed by another before.
last_connect_id
:
PROCEDURE
[
TUPLE
[TUPLE 2[E_, F_]]]
effective function
{
ANY
}
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
{
ANY
}
top
Unregister procedure for this signal.
If the same procedure was registered 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
{
ANY
}
top
return True if no callback is registered for this signal