Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 68d373e54fb21da3730c08bede406633 > files > 404

libCommonC++1.9_3-devel-1.9.4-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>TimerPort class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.5 on Thu Oct 4 15:33:02 2001 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center>
<hr><h1>TimerPort  Class Reference</h1>Timer ports are used to provide synchronized timing events when managed under a "service thread" such as <a class="el" href="class_socketservice.html">SocketService</a>. synchronized millisecond timing for service threads. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="thread_h-source.html">thread.h</a>&gt;</code>
<p>
<p>Inheritance diagram for TimerPort:
<p><center><img src="class_timerport.gif" usemap="#TimerPort_map" border="0"></center>
<map name="TimerPort_map">
<area href="class_serialport.html" alt="SerialPort" shape="rect" coords="0,56,73,80">
<area href="class_socketport.html" alt="SocketPort" shape="rect" coords="83,56,156,80">
</map>
<a href="class_timerport-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a0">TimerPort</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create a timer, mark it as inactive, and set the initial "start" time to the creation time of the timer object.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a1">setTimer</a> (<a class="el" href="thread_h.html#a1">timeout_t</a> timeout=0)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set a new start time for the object based on when this call is made and optionally activate the timer for a specified number of milliseconds.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a2">incTimer</a> (<a class="el" href="thread_h.html#a1">timeout_t</a> timeout)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set a timeout based on the current time reference value either from object creation or the last <a class="el" href="class_timerport.html#a1">setTimer</a>().</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a3">endTimer</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This is used to "disable" the service thread from expiring the timer object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="thread_h.html#a1">timeout_t</a>&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a4">getTimer</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This is used by service threads to determine how much time remains before the timer expires based on a timeout specified in <a class="el" href="class_timerport.html#a1">setTimer</a>() or <a class="el" href="class_timerport.html#a2">incTimer</a>().</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="thread_h.html#a1">timeout_t</a>&nbsp;</td><td valign=bottom><a class="el" href="class_timerport.html#a5">getElapsed</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This is used to determine how much time has elapsed since a timer port setTimer benchmark time was initially set.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Timer ports are used to provide synchronized timing events when managed under a "service thread" such as <a class="el" href="class_socketservice.html">SocketService</a>. synchronized millisecond timing for service threads.
<p>
This is made into a stand-alone base class since other derived libraries (such as the serial handlers) may also use the pooled "service thread" model and hence also require this code for managing timing.
<p>
<dl compact><dt>
<b>Author(s): </b><dd>
 David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dl>
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a0" doxytag="TimerPort::TimerPort"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
TimerPort::TimerPort (
          </b></td>
          <td valign="bottom"><b>
)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a timer, mark it as inactive, and set the initial "start" time to the creation time of the timer object.
<p>
This allows "incTimer" to initially refer to time delays relative to the original start time of the object.     </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a3" doxytag="TimerPort::endTimer"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void TimerPort::endTimer (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is used to "disable" the service thread from expiring the timer object.
<p>
It does not effect the reference time from either creation or a <a class="el" href="class_timerport.html#a1">setTimer</a>().     </td>
  </tr>
</table>
<a name="a5" doxytag="TimerPort::getElapsed"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
<a class="el" href="thread_h.html#a1">timeout_t</a> TimerPort::getElapsed (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is used to determine how much time has elapsed since a timer port setTimer benchmark time was initially set.
<p>
This allows one to use <a class="el" href="class_timerport.html#a1">setTimer</a>() to set the timer to the current time and then measure elapsed time from that point forward.
<p>
return time elapsed in milliseconds, or -1 if inactive.     </td>
  </tr>
</table>
<a name="a4" doxytag="TimerPort::getTimer"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
<a class="el" href="thread_h.html#a1">timeout_t</a> TimerPort::getTimer (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
This is used by service threads to determine how much time remains before the timer expires based on a timeout specified in <a class="el" href="class_timerport.html#a1">setTimer</a>() or <a class="el" href="class_timerport.html#a2">incTimer</a>().
<p>
It can also be called after setting a timeout with <a class="el" href="class_timerport.html#a2">incTimer</a>() to see if the current timeout has already expired and hence that the application is already delayed and should skip frame(s).
<p>
return time remaining in milliseconds, or -1 if inactive.     </td>
  </tr>
</table>
<a name="a2" doxytag="TimerPort::incTimer"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void TimerPort::incTimer (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="thread_h.html#a1">timeout_t</a> <em>timeout</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set a timeout based on the current time reference value either from object creation or the last <a class="el" href="class_timerport.html#a1">setTimer</a>().
<p>
This reference can be used to time synchronize realtime data over specified intervals and force expiration when a new frame should be released in a synchronized manner.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>timeout</em>
&nbsp;</td><td>
 delay in milliseconds from reference. </td></tr>
</table>
</dl>
<p>
Reimplemented in <a class="el" href="class_serialport.html#a1">SerialPort</a>, and <a class="el" href="class_socketport.html#a1">SocketPort</a>.    </td>
  </tr>
</table>
<a name="a1" doxytag="TimerPort::setTimer"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void TimerPort::setTimer (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="thread_h.html#a1">timeout_t</a> <em>timeout</em> = 0&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set a new start time for the object based on when this call is made and optionally activate the timer for a specified number of milliseconds.
<p>
This can be used to set the starting time of a realtime session.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>timeout</em>
&nbsp;</td><td>
 delay in milliseconds from "now" </td></tr>
</table>
</dl>
<p>
Reimplemented in <a class="el" href="class_serialport.html#a0">SerialPort</a>, and <a class="el" href="class_socketport.html#a0">SocketPort</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="thread_h-source.html">thread.h</a></ul>
<hr><address><small>Generated at Thu Oct 4 15:33:02 2001 for CommonC++ by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.5 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>