libsigc++

libsigc++ is a C++ library for typesafe callbacks.

libsigc++
Stable release
3.0.3 / March 25, 2020 (2020-03-25)[1]
Preview release
2.99.12 / October 30, 2018 (2018-10-30)[1]
Repository
Written inC++
Typelibrary or framework
Websitelibsigcplusplus.github.io/libsigcplusplus/ Edit this on Wikidata

libsigc++ implements a callback system for use in abstract interfaces and general programming. libsigc++ is one of the earliest implementations of the signals and slots concept implemented using C++ template metaprogramming. It was created as an alternative to the use of a meta compiler such as found in the signals and slots implementation in Qt. libsigc++ originated as part of the gtkmm project in 1997 and later was rewritten to be a standalone library. Each signal has a particular function profile which designates the number of arguments and argument type associated with the callback. Functions and methods are then wrapped using template calls to produce function objects (functors) which can be bound to a signal. Each signal can be connected to multiple functors thus creating an observer pattern through which a message can be distributed to multiple anonymous listener objects. Reference counting based object lifespan tracking was used to disconnect the functors from signals as objects are deleted. The use of templates allowed for compile time typesafe verification of connections. The addition of this strict compile time checking required the addition of template typecasting adapters which convert the functor callback profile to match the required signal pattern.

libsigc++ was a natural expansion of the C++ standard library functors to the tracking of objects necessary to implement the observer pattern. It inspired multiple C++ template based signal and slot implementations including the signal implementation used in the boost C++ libraries.

libsigc++ is released as free software under the GNU Lesser General Public License (LGPL).

References

  1. "Releases - libsigcplusplus/libsigcplusplus". Retrieved 25 March 2020 via GitHub.


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.