Rose
|
The transmitter portion of a Signal-Slot transmitter receiver pair. More...
#include <Signals.h>
Public Types | |
using | signal_function = std::function< void(Args...)> |
Public Member Functions | |
operator bool () | |
void | clean () |
Groom the Slot list. | |
void | connect (std::shared_ptr< Slot< Args... >> &slot) |
Connect a Slot to the Signal only if it has not already been connected. More... | |
void | disconnect (std::shared_ptr< Slot< Args... >> &slot) |
Disconnect a Slot from the Signal, if it is connected. More... | |
void | transmit (Args ... args) |
Transmit the Signal data to all connected and non-expired Slots. More... | |
Protected Attributes | |
std::vector< std::weak_ptr< Slot< Args... > > > | callList {} |
The transmitter portion of a Signal-Slot transmitter receiver pair.
Args | The signature of the Signal. |
The signature of the Signal also sets the signature of the transmit() function. Signals and Slots must share the same signature to be connected. The Signal maintains a list of std::weak_ptr to the Slots with which is is connected. This list is groomed to remove expired Slots on each call to transmit, connect and disconnect.
|
inline |
|
inline |
|
inline |