libsigc++  2.3.1
libsigc++ Reference Manual

Description

libsigc++ provides a typesafe (at compile time) callback system for standard C++. It allows you to define signals and to connect those signals to any callback function, either a global or a member function, regardless of whether it is static or virtual. It also contains adaptor classes for connection of dissimilar callbacks.

For instance, see the Signals, Functors, Slots, Adaptors, and Lambdas.

See also the libsigc++ tutorial, the the libsigc++ website, and the Signals appendix of the Programming with gtkmm book.

Features

Basic Usage

Include the libsigc++ header:

#include <sigc++/sigc++.h>

(You may include individual headers, such as sigc++/bind.h instead.)

If your source file is program.cc, you can compile it with:

g++ program.cc -o program `pkg-config --cflags --libs sigc++-2.0`

Alternatively, if using autoconf, use the following in configure.ac:

PKG_CHECK_MODULES([LIBSIGC], [sigc++-2.0])

Then use the generated LIBSIGC_CFLAGS and LIBSIGC_LIBS variables in the project Makefile.am files. For example:

program_CPPFLAGS = $(LIBSIGC_CFLAGS)
program_LDADD = $(LIBSIGC_LIBS)