<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libsigc++: libsigc++ Reference Manual</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <h1>libsigc++ Reference Manual </h1> </div> </div> <div class="contents"> <h3 class="version">2.2.9 </h3><h2><a class="anchor" id="description"></a> Description</h2> <p>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.</p> <p>For instance, see the <a class="el" href="group__signal.html">Signals</a>, <a class="el" href="group__sigcfunctors.html">Functors</a>, <a class="el" href="group__slot.html">Slots</a>, <a class="el" href="group__adaptors.html">Adaptors</a>, and <a class="el" href="group__lambdas.html">Lambdas</a>.</p> <p>See also the <a href="http://libsigc.sourceforge.net/libsigc2/docs/manual/html/index.html">libsigc++ tutorial</a>, the <a href="http://libsigc.sourceforge.net/">the libsigc++ website</a>, and the <a href="http://library.gnome.org/devel/gtkmm-tutorial/unstable/chapter-signals.html">Signals appendix of the Programming with gtkmm book</a>.</p> <h2><a class="anchor" id="features"></a> Features</h2> <ul> <li>Compile-time typesafe callbacks (also faster than run time checks)</li> <li>Type-safety violations report the line number correctly with template names (no tracing template failures into headers)</li> <li>No compiler extensions or meta compilers required</li> <li>Proper handling of dynamic objects and signals (deleted objects will not cause crashes)</li> <li>Extendable API at any level: signal, slot, connection and trackable</li> <li>Extensions do not require alteration of basic components</li> <li>User-definable accumulators</li> <li>A variety of adaptors to change the callback signature: bind, hide, retype, compose and lambda call groups</li> </ul> <h2><a class="anchor" id="basics"></a> Basic Usage</h2> <p>Include the libsigc++ header: </p> <div class="fragment"><pre class="fragment"><span class="preprocessor"> #include <sigc++/sigc++.h></span> </pre></div><p> (You may include individual headers, such as <code>sigc++/bind</code>.h instead.)</p> <p>If your source file is <code>program.cc</code>, you can compile it with: </p> <div class="fragment"><pre class="fragment"> g++ program.cc -o program `pkg-config --cflags --libs sigc++-2.0` </pre></div><p>Alternatively, if using autoconf, use the following in <code>configure.ac:</code> </p> <div class="fragment"><pre class="fragment"> PKG_CHECK_MODULES([LIBSIGC], [sigc++-2.0]) </pre></div><p> Then use the generated <code>LIBSIGC_CFLAGS</code> and <code>LIBSIGC_LIBS</code> variables in the project <code>Makefile.am</code> files. For example: </p> <div class="fragment"><pre class="fragment"> program_CPPFLAGS = $(LIBSIGC_CFLAGS) program_LDADD = $(LIBSIGC_LIBS) </pre></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Tue Mar 8 2011 11:44:39 for libsigc++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address> </body> </html>