Callback Framework for C++
libsigc++ implements a typesafe callback system for standard C++. It
allows you to define signals and to connect those signals to any
callback function, either global or a member function, regardless of
whether it is static or virtual.
It also contains adaptor classes for connection of dissimilar
callbacks and has an ease of use unmatched by other
C++ callback libraries. Libsigc++ is licensed under
the GNU Library General Public License, LGPL.
- Compile time typesafe callbacks (faster than run time checks)
- Typesafety violations report line number correctly with
template names (no tracing template failures into headers)
- No compiler extensions or meta compilers required
- Proper handling of dynamic objects and signals
(deleted objects will not cause seg faults)
- Extendable API at any level:
signal, slot, connection and trackable
- Extensions do not require alteration of basic components
- User definable accumulators
- A variety of adaptors to change the callback signature:
bind, hide, retype, compose
- Most C++ compilers can be used. libsigc++ version 2.5.1 and later require
a compiler with C++11 support
libsigc++ has reached the major version 2.0.
libsigc++ 2.0 has been rewritten from scratch adapting modern C++ coding techniques that
allow for a flexible and powerful but yet simple-to-use API.
In particular the API improvements from libsigc++ 1.2 to 2.0 include:
- Provides unnumbered signal and slot templates.
- Supports arbitrary functor types.
- Supports implicit argument type conversions on signal emission.
- Adds support for overloaded functions.
- Borrows powerful accumulator interface from boost::signal.
- Simplifies use of adaptors like sigc::hide(): argument types need
not be specified any more (except for sigc::retype_return()).
- More powerful adaptors: position of arguments to hide or bind can
be chosen freely; up to 7 arguments can be bound at a time.
- Adds two useful adaptors: sigc::compose(), sigc::exception_catch().
- Performs only one indirect function call during slot invokation
regardless of the number of adaptors used; the direct function
calls involved are inline and can be optimized away by the compiler.
- Conforms to the STL naming scheme: only uses small letters.
- libsigc++ 2.0 until 2.4.x supported a sigc::group() adaptor and
lambda functions. This support is discontinued in later releases, because
lambdas are supported by standard C++11.
Also good to check out are the Erik Thiele and Andreas Rottmann sites which
include some interesting libsigc++ tools like cross-thread support.
The original library was composed by Tero Pulkkinen for the
gtkmm system, a C++ wrapper for the Gtk+ widget set. The revised
library was written and mantained by Karl Nelson. Special thanks
to Esa Pulkkinen for development tips.
The 1.2 phase was maintained by Murray Cumming after Karl provided the initial 1.2 code.
A long 1.9 phase led to the major release 2.0 which was previously maintained by Martin Schulze
and is currently being maintained by Murray Cumming and Kjell Ahlstedt.