Basic signals and slots support. More...
#include <Signals.hpp>
Inherits TRTK::Signals::SignalBase.
Public Member Functions | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | connect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static non-constant member function with four parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | connect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static non-constant member function with three parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | connect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static non-constant member function with two parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type > | |
void | connect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static non-constant member function with one parameter. | |
template<typename slot_class_type , typename slot_return_type > | |
void | connect (slot_class_type *object, slot_return_type(slot_class_type::*function)(), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static non-constant member function with zero parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | connect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static constant member function with four parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | connect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static constant member function with three parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | connect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static constant member function with two parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type > | |
void | connect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static constant member function with one parameter. | |
template<typename slot_class_type , typename slot_return_type > | |
void | connect (const slot_class_type *object, slot_return_type(slot_class_type::*function)() const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects to a non-static constant member function with zero parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | connect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects a global or a static member function with four parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | connect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects a global or a static member function with three parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | connect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects a global or a static member function with two parameters. | |
template<typename slot_return_type , typename slot_arg1_type > | |
void | connect (slot_return_type(*function)(slot_arg1_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects a global or a static member function with one parameter. | |
template<typename slot_return_type > | |
void | connect (slot_return_type(*function)(), ConnectionType connection_type=SINGLE_CONNECTION) const |
Connects a global or a static member function with zero parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | disconnect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static non-constant member function with four parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | disconnect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static non-constant member function with three parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | disconnect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static non-constant member function with two parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type > | |
void | disconnect (slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static non-constant member function with one parameter. | |
template<typename slot_class_type , typename slot_return_type > | |
void | disconnect (slot_class_type *object, slot_return_type(slot_class_type::*function)(), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static non-constant member function with zero parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | disconnect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static constant member function with four parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | disconnect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static constant member function with three parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | disconnect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type, slot_arg2_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static constant member function with two parameters. | |
template<typename slot_class_type , typename slot_return_type , typename slot_arg1_type > | |
void | disconnect (const slot_class_type *object, slot_return_type(slot_class_type::*function)(slot_arg1_type) const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static constant member function with one parameter. | |
template<typename slot_class_type , typename slot_return_type > | |
void | disconnect (const slot_class_type *object, slot_return_type(slot_class_type::*function)() const, ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a non-static constant member function with zero parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type , typename slot_arg4_type > | |
void | disconnect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a global or a static member function with four parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type , typename slot_arg3_type > | |
void | disconnect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type, slot_arg3_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a global or a static member function with three parameters. | |
template<typename slot_return_type , typename slot_arg1_type , typename slot_arg2_type > | |
void | disconnect (slot_return_type(*function)(slot_arg1_type, slot_arg2_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a global or a static member function with two parameters. | |
template<typename slot_return_type , typename slot_arg1_type > | |
void | disconnect (slot_return_type(*function)(slot_arg1_type), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a global or a static member function with one parameter. | |
template<typename slot_return_type > | |
void | disconnect (slot_return_type(*function)(), ConnectionType connection_type=SINGLE_CONNECTION) const |
Disconnects a global or a static member function with zero parameters. | |
void | send (arg1_type arg1, arg2_type arg2, arg3_type arg3, arg4_type arg4) const |
Emits a signal. | |
void | connect (SlotAdapterBase *slot, const ConnectionType connection_type=SINGLE_CONNECTION) const |
void | disconnect (SlotAdapterBase *slot, const ConnectionType connection_type=SINGLE_CONNECTION) const |
void | disconnectReceiver (const SlotAdapterBase *slot) const |
bool | isConnected (const SlotAdapterBase *slot) const |
Protected Attributes | |
std::list< SlotAdapterBase * > | m_slots |
std::set< const Receiver * > | m_receivers |
Related Functions | |
(Note that these are not member functions.) | |
enum | ConnectionType { MULTIPLE_CONNECTIONS, SINGLE_CONNECTION } |
Slot connection type. More... |
Basic signals and slots support.
Signals and slots are callbacks with multiple targets. They work according to the publish/subscribe pattern which facilitates decoupling and modularization. A signal with certain properties is defined and subscribers with the same method signature are able to connect to this signal (or in other words: if a signal is instanciated, only a defined set of functions is able to be connected to the signal). If the signal is called (or emitted or send), the subscribers are informed (or called) as well. A publisher does not care about its subscribers---it just publishes and the subscribers are informed. All this is done fully transparently. (See below for some examples.)
This signals and slots implementation is compatible with Qt, which means that it does not interfere with Qt's own signals and slots concept as well as its defined keywords emit, signals and slots.
The interface is designed to be flexible and easy to use. Connections are even managed fully automatically in the case that objects are (virtually) derived from the Receiver class.
class Object : virtual public Receiver { // ... };
A signal is defined by instanciating the Signal template class. For instance:
Signal<int> signal;
All functions that take an integer as its first argument can be connected to the above defined signal. This implies global functions as well as all kinds of member functions where the type of the return value can be arbitrary.
void function(double);
void function();
Up to four parameters can be specified:
Signal<arg1_type, arg2_type, arg3_type, arg4_type> signal;
Now, a connection can be established as follows:
signal.connect(&function); // global function slot signal.connect(&object, &function); // member function slot
If a signal is emitted (or send) the connected functions are called in the order they were connected to a signal. Connections can either be unique or multiple-connected. The former is the default behaviour. To change this, you can specify the connection type, for instance:
signal.connect(&function, TRTK::Signals::MULTIPLE_CONNECTIONS);
A slot is disconnected as follows:
signal.disconnect(&function); // global function slot signal.disconnect(&object, &function); // member function slot
Always, the last found/connected slot is disconnected (or all slots if MULTIPLE_CONNECTIONS
is passed as an additional argument). It follows, that the former connection order is preserved. If object
in the former example is derived from the Receiver class, all connections are disconnected automatically during the destruction of this object. This avoids hanging references within the signal.
Now, we will present an example to show, how signals and slots can be used.
Example:
#include <iostream> #include <TRTK/Clock.hpp> #include <TRTK/Signals.hpp> using namespace std; using namespace TRTK; class DisplayClass // This could be a status bar, for instance. { public: void print(unsigned int value) { cout << value << endl; } }; class CountDown { public: CountDown(unsigned int counter) : m_counter(counter) {} void start() { for (int i = m_counter; i >= 0; --i) { Clock().wait_seconds(1); state.send(i); } finished.send(); } Signal<unsigned int> state; Signal<void> finished; private: unsigned int m_counter; }; void print() { cout << "print() was called." << endl; } int main() { CountDown countDown(10); DisplayClass displayClass; countDown.state.connect(&displayClass, &DisplayClass::print); countDown.finished.connect(&print); countDown.finished.connect(&print, MULTIPLE_CONNECTIONS); // print is called twice countDown.start(); // The next line could be ommited, if DisplayClass was derived from Receiver. countDown.state.disconnect(&displayClass, &DisplayClass::print); countDown.finished.connect(&print, MULTIPLE_CONNECTIONS); return 0; }
Output:
10 9 8 7 6 5 4 3 2 1 0 print() was called. print() was called.
As we can see, now, the CountDown class is fully decoupled from its graphical representation.
Definition at line 1656 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static non-constant member function with four parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1677 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static non-constant member function with three parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1698 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static non-constant member function with one parameter.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1740 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static constant member function with two parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1824 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static constant member function with one parameter.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1845 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)() | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static non-constant member function with zero parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1761 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)() const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static constant member function with zero parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1866 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects a global or a static member function with four parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&function);
Definition at line 1886 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static non-constant member function with two parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1719 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static constant member function with four parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1782 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects a global or a static member function with three parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&function);
Definition at line 1906 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects a global or a static member function with two parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&function);
Definition at line 1926 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects to a non-static constant member function with three parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&object, &class::function);
Definition at line 1803 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_return_type(*)(slot_arg1_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects a global or a static member function with one parameter.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&function);
Definition at line 1946 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::connect | ( | slot_return_type(*)() | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Connects a global or a static member function with zero parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
Example:
signal.connect(&function);
Definition at line 1966 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a global or a static member function with two parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&function);
Definition at line 2300 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static non-constant member function with one parameter.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2069 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static non-constant member function with four parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 1991 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static non-constant member function with three parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2017 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static constant member function with two parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2173 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static constant member function with one parameter.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2199 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a global or a static member function with four parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&function);
Definition at line 2250 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_return_type(*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a global or a static member function with three parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&function);
Definition at line 2275 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_return_type(*)() | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a global or a static member function with zero parameters.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&function);
Definition at line 2350 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)() | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static non-constant member function with zero parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2095 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type) | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static non-constant member function with two parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2043 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | slot_return_type(*)(slot_arg1_type) | function, |
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a global or a static member function with one parameter.
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&function);
Definition at line 2325 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static constant member function with three parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2147 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)() const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static constant member function with zero parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2225 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::disconnect | ( | const slot_class_type * | object, |
slot_return_type(slot_class_type::*)(slot_arg1_type, slot_arg2_type, slot_arg3_type, slot_arg4_type) const | function, | ||
ConnectionType | connection_type = SINGLE_CONNECTION |
||
) | const [inline] |
Disconnects a non-static constant member function with four parameters.
[in] | object | Instance whose function shall be called. |
[in] | function | Function to be called. |
[in] | connection_type | Type of connection. |
If connection_type is SINGLE_CONNECTION, only the last found connection is deleted.
If connection_type is MULTIPLE_CONNECTIONS, all connections found are deleted.
Example:
signal.disconnect(&object, &class::function);
Definition at line 2121 of file Signals.hpp.
void TRTK::Signals::Signal< arg1_type, arg2_type, arg3_type, arg4_type >::send | ( | arg1_type | arg1, |
arg2_type | arg2, | ||
arg3_type | arg3, | ||
arg4_type | arg4 | ||
) | const [inline] |
Emits a signal.
[in] | arg1 | First input argument of the called slot. |
[in] | arg2 | Second input argument of the called slot. |
[in] | arg3 | Third input argument of the called slot. |
[in] | arg4 | Fourth input argument of the called slot. |
Currently, only up to four arguments are supported. An argument may only (and then must) be given, if the signal and the corresponding slots provide the particular signature.
Example:
Signal<void> signal1;
Signal<string> signal2;
signal1.send();
signal2.send("Some text.");
Definition at line 2380 of file Signals.hpp.
enum ConnectionType [related] |
Slot connection type.
Definition at line 1267 of file Signals.hpp.
Documentation generated by Doxygen