this text is a overview. if you are a genius and know everything already, straightly go to postyyyman.

What are signals and slots?

we are talking C++ here.
signals and slots is a programming concept. when you write classes or modules and those classes want to send out some data, i.e.:
class mygame {
  void startgame(); // returns immediately
now whenever the game is finished, the class wants to tell the others about this. this can be done by events, overloading or other ill concepts. in signals and slots way of doing things, mygame would emit a signal called gameterminated() and if someone is connected to the signal he will receive the information in his slot function. This explanation was just for filtering out uninterested users ;) you should read the documentation of libsigc++ (see below) for much better explanation.

libsigc++ is a very good library implementing signals and slots. it is completely independent of GUI stuff. it is pure C++. no precompilers needed.

libqt is a GUI class, that uses an own signals and slots implementation to communicate between the widgets. the implementation is NOT independend of the GUI, so if you want to use qt signals and slots you are always some way linked to the GUI stuff. the qt implementation uses a meta object compiler ((extended C++) -> (C++)) to implement signals and slots.


this is my own signal and slot implementation from summer 1997 (!). read its README file.
it is small and primitive. you can read it if you want to understand how signals and slots can be implemented. (libsigc++ is much more complex).
This library is currently running in a production environment of many computers, many users and used all day for years now.
but anyway, i recommend using libsigc++ since it has more features and is more widely used.
yyysigslot and libsigc++ are not compatible. (i.e. you cannot cross connect signals ;)


with this one you can connect libsigc++ signals through any kind of binary streams. i.e. networks. it is highly generic. so it does not force you into some silly network classes you do not want to use! it works with GTK,GTK--,plain, and a little bit with qt. There are also some other signal tools in there.

(erikyyy at erikyyy dot de, Erik Thiele) back