libosmscout
0.1
|
Signal and Slot is tool for connecting source of events and its consumers. More...
#include <Signal.h>
Public Member Functions | |
void | Connect (Slot< Args... > &slot) |
Connect Signal to given Slot. More... | |
void | Disconnect () |
Disconnect from all slots. More... | |
void | Disconnect (Slot< Args... > &slot) |
Disconnect from specific slot. More... | |
void | Emit (const Args &... args) const |
Emit signal. More... | |
Signal & | operator= (const Signal &)=delete |
Signal & | operator= (Signal &&)=delete |
Signal ()=default | |
Signal (const Signal &)=delete | |
Signal (Signal &&)=delete | |
virtual | ~Signal () |
Friends | |
class | Slot< Args... > |
Signal and Slot is tool for connecting source of events and its consumers.
It is similar to Qt's signal, but it lacks some advanced functionality, like asynchronous connection. Slot callback is called in thread context of the signal. Locking or asynchronicity have to be solved differently.
Signal and Slot are thread safe. Their live cycle may be independent.
Args |
|
default |
|
delete |
|
delete |
|
virtual |
void osmscout::Signal< Args >::Connect | ( | Slot< Args... > & | slot | ) |
void osmscout::Signal< Args >::Disconnect |
Disconnect from all slots.
void osmscout::Signal< Args >::Disconnect | ( | Slot< Args... > & | slot | ) |
Disconnect from specific slot.
When there is no connection with given slot, Method is no-op.
slot |
void osmscout::Signal< Args >::Emit | ( | const Args &... | args | ) | const |
Emit signal.
All connected slots are called.
args |
|
delete |
|
delete |
|
friend |