Class Signal
Defined in File sim_signal.h
Nested Relationships
Nested Types
Inheritance Relationships
Derived Type
public DataSignal(Class DataSignal)
Class Documentation
-
class Signal
Signalling framework class.
Main class for raising signals. It implements a messaging passing system in the yasimavr simulation models, in a very similar fashion to simavr’s IRQ, or QT’s signal/slot frameworks.
Signals are connected to objects implementing the SignalHook interface. One signal can be connected to may hooks, whilst one hook can be connected to many signals.
Subclassed by DataSignal
Public Functions
-
Signal()
Build a signal.
-
virtual ~Signal()
Destroy a signal. Severs all the connections with hooks.
-
void connect(SignalHook &hook, int hooktag = 0)
Connect a hook to this signal.
See also
Note
The hootag can be useful when a single hook connects to several signals, in order to differentiate which one the raise comes from.
- Parameters:
hook – hook to be connected. If the hook is already connected, the call has no effect.
hooktag – identifier given to the hook when calling it. It has only a meaning for the hook and is passed though by the signal when called.
-
void disconnect(SignalHook &hook)
Disconnect a hook to this signal.
- Parameters:
hook – hook to be disconnected.
-
virtual void raise(const signal_data_t &sigdata)
Raise the signal with the given data
- Parameters:
sigdata –
-
Signal()