Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-backports > by-pkgid > 4f5f2dc0f55b453456458df885792b0b > files > 438

ucommon-doc-5.0.4-1mdv2010.2.i586.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>ucommon: ucommon::TimerQueue Class Reference</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.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="a00208.html">ucommon</a>::<a class="el" href="a00163.html">TimerQueue</a>
  </div>
</div>
<div class="contents">
<h1>ucommon::TimerQueue Class Reference</h1><!-- doxytag: class="ucommon::TimerQueue" --><!-- doxytag: inherits="ucommon::OrderedIndex" -->
<p>A timer queue for timer events.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00203_source.html">timers.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ucommon::TimerQueue:</div>
<div class="dynsection">
<div class="center"><img src="a00558.png" border="0" usemap="#ucommon_1_1_timer_queue_inherit__map" alt="Inheritance graph"/></div>
<map name="ucommon_1_1_timer_queue_inherit__map" id="ucommon_1_1_timer_queue_inherit__map">
<area shape="rect" id="node2" href="a00100.html" title="An index container for maintaining an ordered list of objects." alt="" coords="5,5,237,32"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ucommon::TimerQueue:</div>
<div class="dynsection">
<div class="center"><img src="a00559.png" border="0" usemap="#ucommon_1_1_timer_queue_coll__map" alt="Collaboration graph"/></div>
<map name="ucommon_1_1_timer_queue_coll__map" id="ucommon_1_1_timer_queue_coll__map">
<area shape="rect" id="node2" href="a00100.html" title="An index container for maintaining an ordered list of objects." alt="" coords="15,280,247,307"/><area shape="rect" id="node4" href="a00101.html" title="A linked object base class for ordered objects." alt="" coords="9,176,252,203"/><area shape="rect" id="node6" href="a00067.html" title="Common base class for all objects that can be formed into a linked list." alt="" coords="15,91,247,117"/><area shape="rect" id="node8" href="a00095.html" title="A common base class for all managed objects." alt="" coords="5,5,256,32"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00164.html">event</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A timer event object that lives on a timer queue.  <a href="a00164.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#a29247e08e7371982e649fad9efbde1ca">expire</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process timer queue and find when next event triggers.  <a href="#a29247e08e7371982e649fad9efbde1ca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#a597c0a408246cce7b1e925ece87c555c">operator+=</a> (<a class="el" href="a00164.html">event</a> &amp;timer)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a timer event to the timer queue.  <a href="#a597c0a408246cce7b1e925ece87c555c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#abe2d808b562586eaa77270b50050fbd6">operator-=</a> (<a class="el" href="a00164.html">event</a> &amp;timer)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Remove a timer event from the timer queue.  <a href="#abe2d808b562586eaa77270b50050fbd6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e63c7d82ef32a01d959417569dd74e8"></a><!-- doxytag: member="ucommon::TimerQueue::TimerQueue" ref="a1e63c7d82ef32a01d959417569dd74e8" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#a1e63c7d82ef32a01d959417569dd74e8">TimerQueue</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create an empty timer queue. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af1bde593a2bff4d2c18ed3a5ca6770c6"></a><!-- doxytag: member="ucommon::TimerQueue::~TimerQueue" ref="af1bde593a2bff4d2c18ed3a5ca6770c6" args="()" -->
virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#af1bde593a2bff4d2c18ed3a5ca6770c6">~TimerQueue</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroy queue, does not remove event objects. <br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#a1ad7084f991b017f97e4973b13e6ad24">modify</a> (void)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called in derived class when the queue is being modified.  <a href="#a1ad7084f991b017f97e4973b13e6ad24"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00163.html#a8adfeca9aa187707d2e2e5057ded404b">update</a> (void)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Called in derived class after the queue has been modified.  <a href="#a8adfeca9aa187707d2e2e5057ded404b"></a><br/></td></tr>
<tr><td colspan="2"><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4d89b86d8d3ce5a695bf16fd20830463"></a><!-- doxytag: member="ucommon::TimerQueue::event" ref="a4d89b86d8d3ce5a695bf16fd20830463" args="" -->
class&nbsp;</td><td class="memItemRight" valign="bottom"><b>event</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>A timer queue for timer events. </p>
<p>The timer queue is used to hold a linked list of timers that must be processed together. The timer queue processes the timer event list and calls an expired function on events that have expired. The timer queue also determines the wait time until the next timer will expire. When timer events are modified, they can retrigger the queue to re-examine the list to find when the next timer will now expire. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="a00203_source.html#l00265">265</a> of file <a class="el" href="a00203_source.html">timers.h</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a29247e08e7371982e649fad9efbde1ca"></a><!-- doxytag: member="ucommon::TimerQueue::expire" ref="a29247e08e7371982e649fad9efbde1ca" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> ucommon::TimerQueue::expire </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process timer queue and find when next event triggers. </p>
<p>This function will call the expired methods on expired timers. Normally this function will be called in the context of a timer thread which sleeps for the timeout returned unless it is awoken on an update event. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>timeout until next timer expires in milliseconds. </dd></dl>

</div>
</div>
<a class="anchor" id="a1ad7084f991b017f97e4973b13e6ad24"></a><!-- doxytag: member="ucommon::TimerQueue::modify" ref="a1ad7084f991b017f97e4973b13e6ad24" args="(void)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ucommon::TimerQueue::modify </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called in derived class when the queue is being modified. </p>
<p>This is often used to lock the list. </p>

</div>
</div>
<a class="anchor" id="a597c0a408246cce7b1e925ece87c555c"></a><!-- doxytag: member="ucommon::TimerQueue::operator+=" ref="a597c0a408246cce7b1e925ece87c555c" args="(event &amp;timer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ucommon::TimerQueue::operator+= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00164.html">event</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>timer</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Add a timer event to the timer queue. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timer</em>&nbsp;</td><td>event to add. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="abe2d808b562586eaa77270b50050fbd6"></a><!-- doxytag: member="ucommon::TimerQueue::operator&#45;=" ref="abe2d808b562586eaa77270b50050fbd6" args="(event &amp;timer)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ucommon::TimerQueue::operator-= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00164.html">event</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>timer</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Remove a timer event from the timer queue. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>timer</em>&nbsp;</td><td>event to remove. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8adfeca9aa187707d2e2e5057ded404b"></a><!-- doxytag: member="ucommon::TimerQueue::update" ref="a8adfeca9aa187707d2e2e5057ded404b" args="(void)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void ucommon::TimerQueue::update </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Called in derived class after the queue has been modified. </p>
<p>This often releases a lock that modify set and to wakeup a timer thread to evaluate when the next timer will now expire. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00203_source.html">timers.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:40:10 2011 for ucommon by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>