Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > bd29e346140bd3fbcbf1674e576e565a > files > 425

libsigc++2.0-doc-2.2.7-1mdv2010.1.x86_64.rpm

<!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.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li class="current"><a href="index.html"><span>Main&#160;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="contents">
<h1>libsigc++ Reference Manual</h1><h3>2.2.7 </h3><h2><a class="anchor" id="description">
Description</a></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">
Features</a></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">
Basic Usage</a></h2>
<p>Include the libsigc++ header: </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;sigc++/sigc++.h&gt;</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 size="1"/><address style="text-align: right;"><small>Generated on Tue May 4 21:44:38 2010 for libsigc++ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>