/tutorial/signal/a.e
http://github.com/tybor/Liberty · Specman e · 28 lines · 20 code · 6 blank · 2 comment · 1 complexity · 2917b098cced032aeebccb798c177d3e MD5 · raw file
- class A
- creation {ANY}
- make
- feature {ANY}
- value_changed: SIGNAL_1[INTEGER] --declare variable of SIGNAL type, never inherit form SIGNAL.
- value: INTEGER
- feature {}
- make is
- do
- create value_changed.make
- end
- feature {ANY}
- set_val (v: INTEGER) is
- do
- -- Only emit if value really change (see signals.txt: when
- -- to use). Avoid infinite looping in case of cyclic connections.
- if v /= value then
- value := v
- value_changed.emit(v)
- end
- end
- end -- class A