Signal Class Reference
|
yasimavr
|
Signalling framework class. More...
#include <sim_signal.h>
Public Member Functions | |
| Signal () | |
| Signal (const Signal &other) | |
| Signal (const Signal &&)=delete | |
| virtual | ~Signal () |
| void | connect (SignalHook &hook, int hooktag=0) |
| void | disconnect (SignalHook &hook) |
| virtual void | raise (const signal_data_t &sigdata) |
| void | raise (int sigid=0, const vardata_t &v=vardata_t(), long long index=0) |
| Signal & | operator= (const Signal &) |
| Signal & | operator= (const Signal &&)=delete |
Friends | |
| class | SignalHook |
Detailed Description
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.
Constructor & Destructor Documentation
◆ Signal() [1/3]
| Signal::Signal | ( | ) |
Build a signal.
◆ Signal() [2/3]
| Signal::Signal | ( | const Signal & | other | ) |
Copy construction ensuring the connection with hooks is consistent.
◆ Signal() [3/3]
|
delete |
◆ ~Signal()
|
virtual |
Destroy a signal. Severs all the connections with hooks.
Member Function Documentation
◆ connect()
| void Signal::connect | ( | SignalHook & | hook, |
| int | hooktag = 0 |
||
| ) |
Connect a hook to this signal.
- 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.
- Note
- The hootag can be useful when a single hook connects to several signals, in order to differentiate which one the raise comes from.
- See also
- SignalHook::raised()
◆ disconnect()
| void Signal::disconnect | ( | SignalHook & | hook | ) |
Disconnect a hook to this signal.
- Parameters
-
hook hook to be disconnected.
◆ operator=() [1/2]
◆ operator=() [2/2]
Copy assignment ensuring the connection with hooks is consistent.
◆ raise() [1/2]
|
virtual |
Raise the signal with the given data
- Parameters
-
sigdata
Reimplemented in DataSignal, and DataSignal.
◆ raise() [2/2]
Raise the signal with the given data.
- Parameters
-
data
Friends And Related Symbol Documentation
◆ SignalHook
|
friend |
The documentation for this class was generated from the following files:
Generated by