libsigc++
3.6.0
|
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 and Adaptors.
See also the libsigc++ tutorial, the libsigc++ website, and the Signals appendix of the Programming with gtkmm book.
Include the libsigc++ header:
(You may include individual headers, such as sigc++/bind
.h instead.)
If your source file is program.cc
, you can compile it with:
If your version of g++ is not C++17-compliant by default, add the -std=c++17
option.
If using Meson, include the following in meson.build:
Your dependencies:
keyword argument should also mention any other libraries that you need to use.
Alternatively, if using autoconf, use the following in configure.ac:
Then use the generated DEPS_CFLAGS
and DEPS_LIBS
variables in the project Makefile.am
files. For example:
Your PKG_CHECK_MODULES()
call should also mention any other libraries that you need to use via pkg-config.
If using CMake, use the following in CMakeList.txt:
Your pkg_check_modules()
call should also mention any other libraries that you need to use via pkg-config.