This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Libsigc++" – news ·newspapers ·books ·scholar ·JSTOR(March 2020) (Learn how and when to remove this message) |
This articlemay rely excessively on sourcestoo closely associated with the subject, potentially preventing the article from beingverifiable andneutral. Please helpimprove it by replacing them with more appropriatecitations toreliable, independent sources.(April 2024) (Learn how and when to remove this message) |
Stable release | |
---|---|
Repository | |
Written in | C++ |
Type | library orframework |
Website | libsigcplusplus![]() |
libsigc++ is aC++ library fortypesafecallbacks.
libsigc++ implements a callback system for use in abstract interfaces and general programming. libsigc++ is one of the earliest implementations of thesignals 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 inQt. libsigc++ originated as part of thegtkmm 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 producefunction objects (functors) which can be bound to a signal. Each signal can be connected to multiple functors thus creating anobserver 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 theC++ 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 theboost C++ libraries.
libsigc++ is released asfree software under theGNU Lesser General Public License (LGPL).
![]() | Thisprogramming-tool-related article is astub. You can help Wikipedia byexpanding it. |