Signals and slots. More...
#include <itpp/protocol/signals_slots.h>
Public Member Functions | |
Signal (const std::string signal_name="Unamed Signal", const bool single_shot=false, const bool enable_debug=false) | |
Default constructor. | |
~Signal () | |
Destructor. | |
void | connect (Base_Slot< DataType > *slot) |
Connect a slot to the signal. | |
void | disconnect (Base_Slot< DataType > *slot=NULL) |
Disconnect the slot from the signal. | |
Base_Event * | operator() (DataType signal, const Ttype delta_time=0) |
Issue a signal. | |
void | cancel () |
cancel signal | |
void | set_name (const std::string &signal_name) |
set name of signal | |
void | set_debug (const bool enable_debug=true) |
Set debug mode. If true all signals are printed to stdout. | |
void | trigger (DataType u) |
ADD DOCUMENTATION HERE. | |
Protected Types | |
typedef std::list< Base_Slot < DataType > *, std::allocator < Base_Slot< DataType > * > >::iterator | Base_Slot_Iterator |
ADD DOCUMENTATION HERE. | |
Protected Member Functions | |
void | _disconnect (Base_Slot< DataType > *slot) |
ADD DOCUMENTATION HERE. | |
Protected Attributes | |
std::list< Base_Slot< DataType > *, std::allocator< Base_Slot < DataType > * > > | connected_slots |
ADD DOCUMENTATION HERE. | |
std::string | name |
ADD DOCUMENTATION HERE. | |
Friends | |
class | Base_Slot< DataType > |
Signals and slots.
A simple example where to objects A and B are communicating through signals and slots. Each object has one signal and one slot. The A_signal is used to send a signal to the B_slot and vice versa. When a signal is received by the B_slot it is forwarded to the function forward(). The class definition includes the definition of the signals, slots and forward functions including a name and the type of data to transmit.
Definition at line 124 of file signals_slots.h.
Generated on Sat May 25 2013 16:32:33 for IT++ by Doxygen 1.8.2