84 lines
5.8 KiB
HTML
84 lines
5.8 KiB
HTML
<!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"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.11"/>
|
|
<title>libsigc++: libsigc++ Reference Manual</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">libsigc++
|
|
 <span id="projectnumber">2.10.3</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.11 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li class="current"><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="pages.html"><span>Related Pages</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><!-- top -->
|
|
<div class="header">
|
|
<div class="headertitle">
|
|
<div class="title">libsigc++ Reference Manual </div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="textblock"><h1><a class="anchor" id="description"></a>
|
|
Description</h1>
|
|
<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> and <a class="el" href="group__adaptors.html">Adaptors</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/">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>
|
|
<h1><a class="anchor" id="features"></a>
|
|
Features</h1>
|
|
<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, and compose</li>
|
|
</ul>
|
|
<h1><a class="anchor" id="basics"></a>
|
|
Basic Usage</h1>
|
|
<p>Include the libsigc++ header: </p><div class="fragment"><div class="line"><span class="preprocessor">#include <sigc++/sigc++.h></span></div></div><!-- fragment --><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"><div class="line">g++ program.cc -o program `pkg-config --cflags --libs <a class="code" href="namespacesigc.html">sigc</a>++-2.0`</div></div><!-- fragment --><h2><a class="anchor" id="autotools"></a>
|
|
Using Autotools</h2>
|
|
<p>Alternatively, if using autoconf, use the following in <code>configure.ac:</code> </p><div class="fragment"><div class="line">PKG_CHECK_MODULES([DEPS], [<a class="code" href="namespacesigc.html">sigc</a>++-2.0])</div></div><!-- fragment --><p> Then use the generated <code>DEPS_CFLAGS</code> and <code>DEPS_LIBS</code> variables in the project <code>Makefile.am</code> files. For example: </p><div class="fragment"><div class="line">yourprogram_CPPFLAGS = $(DEPS_CFLAGS)</div><div class="line">yourprogram_LDADD = $(DEPS_LIBS)</div></div><!-- fragment --><p>Your <code>PKG_CHECK_MODULES()</code> call should also mention any other libraries that you need to use via pkg-config.</p>
|
|
<h2><a class="anchor" id="cmake"></a>
|
|
Using CMake</h2>
|
|
<p>If using CMake, use the following in <code>CMakeList.txt:</code> </p><div class="fragment"><div class="line">include(FindPkgConfig)</div><div class="line">pkg_check_modules(DEPS REQUIRED <a class="code" href="namespacesigc.html">sigc</a>++-2.0)</div><div class="line">include_directories(${DEPS_INCLUDE_DIRS})</div><div class="line">target_link_libraries(yourprogram ${DEPS_LIBRARIES})</div></div><!-- fragment --><p>Your <code>pkg_check_modules()</code> call should also mention any other libraries that you need to use via pkg-config.</p>
|
|
<h1><a class="anchor" id="scope"></a>
|
|
Scope of Documentation</h1>
|
|
<p>libsigc++ contains many template functions and template classes/structs, some with many specializations. This reference manual does not show all specializations of those templates that hardly any user will use directly. </p>
|
|
</div></div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated on Wed Mar 25 2020 10:13:31 for libsigc++ by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.11
|
|
</small></address>
|
|
</body>
|
|
</html>
|