![]() |
jle_cpp_tk
0.0 2015-04-03 sh1:"d699093732dd5f321606d0ff7a6b63b229f1922c"
A small, safe, selft contained, soft-realtime C++ toolkit
|
signal instance to connect and emit More...
#include <signal_slot.hpp>
Public Member Functions | |
signal (const signal &)=delete | |
signal (signal &&)=default | |
signal & | operator= (const signal &)=delete |
signal & | operator= (signal &&)=default |
int | get_processing_emits (void) const |
it will give the number of emits on scope More... | |
template<typename TReceiver > | |
void | connect (TReceiver *receiver, void(TReceiver::*fpt)(Args...)) |
template<typename TReceiver > | |
bool | disconnect (TReceiver *receiver, void(TReceiver::*fpt)(Args...)) |
disconnect a signal from a method More... | |
void | disconnect_all (void) |
disconnect all signals More... | |
int | notify (Args...args) |
same as emit More... | |
int | emit (Args...args) |
call all connected to the signal More... | |
void | operator() (Args...args) |
same as emit More... | |
template<typename TReceiver > | |
void | connect (TReceiver *receiver) |
void | connect (void(*pt2Function)(Args...)) |
connect a signal to a function | |
bool | disconnect (void(*pt2Function)(Args...)) |
disonnect a signal from a function | |
![]() | |
signal_receptor (const signal_receptor &)=delete | |
signal_receptor (signal_receptor &&)=default | |
signal_receptor & | operator= (const signal_receptor &)=delete |
signal_receptor & | operator= (signal_receptor &&)=default |
signal instance to connect and emit
You can connect to functions methods and even other signals It is static, good performance and compiling time checked
Example:
|
inline |
it will give the number of emits on scope
Used internally to check if running on destructor
|
inline |
disconnect a signal from a method
If you have connected a signal more than one to a method (allowed), disconnect will remove only one of the connections
|
inline |
disconnect all signals
It will disconnect from functions, methods and other signals
|
inline |
same as emit
emit is defined as a macro on Qt toolkit. Using notify avoid conflicts with Qt
|
inline |
call all connected to the signal
Exceptions are not trapped. If an exception is thrown some slots couldn't receive the signal
Catching the error here to guaranty all slots are called has no cpu cost. But the context information, would be limited
|
inline |
same as emit
I don't like this option, but it is quite frecuent