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 and lambda call groups
- Various compilers and platforms are supported:
gcc, cygwin, mingw32, MS .NET 2003, Sun Forte C++, Compaq C++, Intel C++, IBM AIX, Tru64, IRIX MipsPro.
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().
- Adds all-in-one operator sigc::group() with support for lambdas
featuring a complete set of lambda selectors and lambda operators.
- 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.
The libsigc++-1.2 series still is an alternative because it has less
prerequisites for the comiler.
Andreas Rottmann released some code for CORBA support with libsigc++-1.2.
Please send him an email
if you think that this is interesting for you!
CORBA for libsigc++.
Also good to check out are the Erik Thiele and Andreas Rottmann siztes 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 lead to the major relase 2.0 which is currently being maintained
by Martin Schulze and Murray Cumming.