Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > e8cbfa9673da18966abee0a6d7051b87 > files > 319

glibmm2.4-doc-2.16.1-1mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>glibmm 2.4: Glib::SignalTimeout Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<table border="0" width="100%">
<tr>
    <td width="10%" height="40"><img src="../../images/gtkmm_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td>
    <td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td>
</tr>
</table>
<center>
  <a class="qindex" href="../../../../gtkmm-2.4/docs/index.html">Main Page</a> &nbsp;
  <a href="../../../../gtkmm-2.4/docs/reference/html/group__Widgets.html">Widgets</a> &nbsp;
  <a class="qindex" href="namespaces.html">glibmm Namespaces</a> &nbsp;
  <a href="../../../../gtkmm-2.4/docs/tutorial/html/index.html"> Book</a> &nbsp;
</center>
<hr width="100%"/>

<!-- begin main content -->
<div id="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="nav">
<a class="el" href="namespaceGlib.html">Glib</a>::<a class="el" href="classGlib_1_1SignalTimeout.html">SignalTimeout</a></div>
<h1>Glib::SignalTimeout Class Reference<br>
<small>
[<a class="el" href="group__MainLoop.html">The Main Event Loop</a>]</small>
</h1><!-- doxytag: class="Glib::SignalTimeout" -->
<p>
<a href="classGlib_1_1SignalTimeout-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">sigc::connection&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1SignalTimeout.html#75b555ed13d91e6903e927f9e0d7afd2">connect</a> (const sigc::slot&lt;bool&gt;&amp; slot, unsigned int interval, int priority=PRIORITY_DEFAULT)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connects a timeout handler.  <a href="#75b555ed13d91e6903e927f9e0d7afd2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">sigc::connection&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1SignalTimeout.html#02ad93aa55aa48d48263df628b69fa95">connect_seconds</a> (const sigc::slot&lt;bool&gt;&amp; slot, unsigned int interval, int priority=PRIORITY_DEFAULT)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Connects a timeout handler with whole second granularity.  <a href="#02ad93aa55aa48d48263df628b69fa95"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="75b555ed13d91e6903e927f9e0d7afd2"></a><!-- doxytag: member="Glib::SignalTimeout::connect" ref="75b555ed13d91e6903e927f9e0d7afd2" args="(const sigc::slot&lt; bool &gt; &amp;slot, unsigned int interval, int priority=PRIORITY_DEFAULT)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sigc::connection Glib::SignalTimeout::connect           </td>
          <td>(</td>
          <td class="paramtype">const sigc::slot&lt; bool &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>slot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>interval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>priority</em> = <code>PRIORITY_DEFAULT</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Connects a timeout handler. 
<p>
Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays).<p>
If you want to have a timer in the "seconds" range and do not care about the exact time of the first call of the timer, use the <a class="el" href="classGlib_1_1SignalTimeout.html#02ad93aa55aa48d48263df628b69fa95" title="Connects a timeout handler with whole second granularity.">connect_seconds()</a> function; this function allows for more optimizations and more efficient system power usage.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="group__MainLoop.html#gadb206fcc112f086f9d47c016b1f2175" title="Convenience timeout signal.">Glib::signal_timeout</a>().connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#gga1">sigc::ptr_fun</a>(&amp;timeout_handler), 1000);
</pre></div> is equivalent to: <div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <a class="code" href="classGlib_1_1RefPtr.html" title="RefPtr&amp;lt;&amp;gt; is a reference-counting shared smartpointer.">Glib::RefPtr&lt;Glib::TimeoutSource&gt;</a> timeout_source = <a class="code" href="classGlib_1_1Source.html#eaffb039abf99982d7a89403bca71569">Glib::TimeoutSource::create</a>(1000);
 timeout_source-&gt;connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#gga1">sigc::ptr_fun</a>(&amp;timeout_handler));
 timeout_source-&gt;attach(<a class="code" href="classGlib_1_1MainContext.html#1502cbed045a9fb27d18c6975e1d255d" title="Returns the default main context.">Glib::MainContext::get_default</a>());
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>slot</em>&nbsp;</td><td>A slot to call when <em>interval</em> has elapsed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>interval</em>&nbsp;</td><td>The timeout in milliseconds. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>priority</em>&nbsp;</td><td>The priority of the new event source. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A connection handle, which can be used to disconnect the handler. </dd></dl>

</div>
</div><p>
<a class="anchor" name="02ad93aa55aa48d48263df628b69fa95"></a><!-- doxytag: member="Glib::SignalTimeout::connect_seconds" ref="02ad93aa55aa48d48263df628b69fa95" args="(const sigc::slot&lt; bool &gt; &amp;slot, unsigned int interval, int priority=PRIORITY_DEFAULT)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sigc::connection Glib::SignalTimeout::connect_seconds           </td>
          <td>(</td>
          <td class="paramtype">const sigc::slot&lt; bool &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>slot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&nbsp;</td>
          <td class="paramname"> <em>interval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>priority</em> = <code>PRIORITY_DEFAULT</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Connects a timeout handler with whole second granularity. 
<p>
Unlike <a class="el" href="classGlib_1_1SignalTimeout.html#75b555ed13d91e6903e927f9e0d7afd2" title="Connects a timeout handler.">connect()</a>, this operates at whole second granularity. The initial starting point of the timer is determined by the implementation and the implementation is expected to group multiple timers together so that they fire all at the same time.<p>
To allow this grouping, the <em>interval</em> to the first timer is rounded and can deviate up to one second from the specified interval. Subsequent timer iterations will generally run at the specified interval.<p>
<div class="fragment"><pre class="fragment"> <a class="code" href="group__MainLoop.html#gadb206fcc112f086f9d47c016b1f2175" title="Convenience timeout signal.">Glib::signal_timeout</a>().connect(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#gga1">sigc::ptr_fun</a>(&amp;timeout_handler), 1000);
</pre></div> is equivalent to: <div class="fragment"><pre class="fragment"> <span class="keyword">const</span> <a class="code" href="classGlib_1_1RefPtr.html" title="RefPtr&amp;lt;&amp;gt; is a reference-counting shared smartpointer.">Glib::RefPtr&lt;Glib::TimeoutSource&gt;</a> timeout_source = <a class="code" href="classGlib_1_1Source.html#eaffb039abf99982d7a89403bca71569">Glib::TimeoutSource::create</a>(1000);
 timeout_source-&gt;connectseconds(<a class="codeRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__s20__3__7__adaptors.html#gga1">sigc::ptr_fun</a>(&amp;timeout_handler));
 timeout_source-&gt;attach(<a class="code" href="classGlib_1_1MainContext.html#1502cbed045a9fb27d18c6975e1d255d" title="Returns the default main context.">Glib::MainContext::get_default</a>());
</pre></div> <dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>slot</em>&nbsp;</td><td>A slot to call when <em>interval</em> has elapsed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>interval</em>&nbsp;</td><td>The timeout in seconds. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>priority</em>&nbsp;</td><td>The priority of the new event source. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A connection handle, which can be used to disconnect the handler.</dd></dl>
<dl compact><dt><b><a class="el" href="newin2p14s.html#_newin2p14s000006">Since glibmm 2.14:</a></b></dt><dd></dd></dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="main_8h.html">main.h</a></ul>
</div> <!-- end main content -->

<hr><address><small>
Generated for glibmm 2.4 by <a href="http://www.doxygen.org/index.html">
Doxygen</a> 1.5.3 &copy;&nbsp;1997-2001</small></address>
</body>
</html>