class SIGNAL_0

All features

See tutorial/signal/signals.txt for usage

Direct parents

non-conformant parents

ANY

Summary

creation features

exported features

Details

make

Initialize new signal object

ensure

  • callbacks.is_empty

callbacks: FAST_ARRAY [E_][PROCEDURE [O_ -> TUPLE][TUPLE]]
index: INTEGER
last: INTEGER

work to do while emit is between index and last.

make

Initialize new signal object

ensure

  • callbacks.is_empty

connect (p: PROCEDURE [O_ -> TUPLE][TUPLE])

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

Emit signal, ie. already registred procedure will be called in registration order except if removed by another before.

last_connect_id: PROCEDURE [O_ -> TUPLE][TUPLE]

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 [O_ -> TUPLE][TUPLE])

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

return True if no callback is registred for this signal

Class invariant