Sophie

Sophie

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

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>TTYStream 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>TTYStream  Class Reference</h1><code>#include &lt;<a class="el" href="serial_h-source.html">serial.h</a>&gt;</code>
<p>
<p>Inheritance diagram for TTYStream:
<p><center><img src="class_ttystream.gif" usemap="#TTYStream_map" border="0"></center>
<map name="TTYStream_map">
<area href="class_std__streambuf.html" alt="std::streambuf" shape="rect" coords="0,0,89,24">
<area href="class_std__iostream.html" alt="std::iostream" shape="rect" coords="99,0,188,24">
<area href="class_serial.html" alt="Serial" shape="rect" coords="198,0,287,24">
<area href="class_ttysession.html" alt="TTYSession" shape="rect" coords="49,112,138,136">
<area href="class_ttystream.html" alt="ttystream" shape="rect" coords="148,112,237,136">
</map>
<a href="class_ttystream-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_ttystream.html#a0">TTYStream</a> (const char *filename)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create and ipen a tty serial port.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#a1">~TTYStream</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>End the tty stream and cleanup.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#a2">setTimeout</a> (<a class="el" href="thread_h.html#a1">timeout_t</a> to)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set the timeout control.</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_ttystream.html#a3">Interactive</a> (<a class="el" href="config_h.html#a17">bool</a> flag)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Set tty mode to buffered or "interactive".</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#a4">sync</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Flushes the stream input and out buffers, writes pending output.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top><a class="el" href="config_h.html#a17">bool</a>&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#a5">isPending</a> (<a class="el" href="serial_h.html#a27">siopend_t</a> pend, <a class="el" href="thread_h.html#a1">timeout_t</a> <a class="el" href="class_ttystream.html#n2">timeout</a>=TIMEOUT_INF)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get the status of pending operations.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#b0">TTYStream</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This constructor is used to derive "<a class="el" href="class_ttystream.html">ttystream</a>", a more C++ style version of the TTYStream class.</em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#b1">Allocate</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used to allocate the buffer space needed for iostream operations.</em> <a href="#b1">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_ttystream.html#b2">endStream</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used to terminate the buffer space and clean up the tty connection.</em> <a href="#b2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#b3">underflow</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This streambuf method is used to load the input buffer through the established tty serial port.</em> <a href="#b3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#b4">uflow</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This streambuf method is used for doing unbuffered reads through the establish tty serial port when in interactive mode.</em> <a href="#b4">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#b5">overflow</a> (int ch)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>This streambuf method is used to write the output buffer through the established tty port.</em> <a href="#b5">More...</a><em></em></font><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr>
<tr><td nowrap align=right valign=top>char*&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#n0">gbuf</a></td></tr>
<tr><td nowrap align=right valign=top>char *&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#n1">pbuf</a></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_ttystream.html#n2">timeout</a></td></tr>
<tr><td colspan=2><br><h2>Friends</h2></td></tr>
<tr><td nowrap align=right valign=top>TTYStream&amp;&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#l0">crlf</a> (TTYStream &amp;)</td></tr>
<tr><td nowrap align=right valign=top>TTYStream&amp;&nbsp;</td><td valign=bottom><a class="el" href="class_ttystream.html#l1">lfcr</a> (TTYStream &amp;)</td></tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="b0" doxytag="TTYStream::TTYStream"></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> 
TTYStream::TTYStream (
          </b></td>
          <td valign="bottom"><b>
)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
This constructor is used to derive "<a class="el" href="class_ttystream.html">ttystream</a>", a more C++ style version of the TTYStream class.
<p>
    </td>
  </tr>
</table>
<a name="a0" doxytag="TTYStream::TTYStream"></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> 
TTYStream::TTYStream (
          </b></td>
          <td valign="bottom"><b>
const char * <em>filename</em>&nbsp;)
          </b></td>
        </tr>

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

<p>
Create and ipen a tty serial port.
<p>
<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>char</em>
&nbsp;</td><td>
 name of device to open. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a1" doxytag="TTYStream::~TTYStream"></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> 
TTYStream::~TTYStream (
          </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>
End the tty stream and cleanup.
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="b1" doxytag="TTYStream::Allocate"></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 TTYStream::Allocate (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
Used to allocate the buffer space needed for iostream operations.
<p>
This is based on MAX_INPUT.     </td>
  </tr>
</table>
<a name="a3" doxytag="TTYStream::Interactive"></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 TTYStream::Interactive (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="config_h.html#a17">bool</a> <em>flag</em>&nbsp;)
          </b></td>
        </tr>

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

<p>
Set tty mode to buffered or "interactive".
<p>
When interactive, all streamed I/O is directly sent to the serial port immediately.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>bool</em>
&nbsp;</td><td>
 set to true to make interactive. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b2" doxytag="TTYStream::endStream"></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 TTYStream::endStream (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
Used to terminate the buffer space and clean up the tty connection.
<p>
This function is called by the destructor.     </td>
  </tr>
</table>
<a name="a5" doxytag="TTYStream::isPending"></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="config_h.html#a17">bool</a> TTYStream::isPending (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="serial_h.html#a27">siopend_t</a> <em>pend</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
<a class="el" href="thread_h.html#a1">timeout_t</a> <em>timeout</em> = TIMEOUT_INF&nbsp;)<code> [virtual]</code>
          </b></td>
        </tr>

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

<p>
Get the status of pending operations.
<p>
This can be used to examine if input or output is waiting, or if an error has occured on the serial device. If read buffer contains data then input is ready and if write buffer contains data it is first flushed then checked.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 true if ready, false if timeout. </dl><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>ready</em>
&nbsp;</td><td>
 check to perform. </td></tr>
<tr><td valign=top><em>timeout</em>
&nbsp;</td><td>
 in milliseconds. </td></tr>
</table>
</dl>
<p>
Reimplemented from <a class="el" href="class_serial.html#a12">Serial</a>.    </td>
  </tr>
</table>
<a name="b5" doxytag="TTYStream::overflow"></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> 
int TTYStream::overflow (
          </b></td>
          <td valign="bottom"><b>
int <em>ch</em>&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
This streambuf method is used to write the output buffer through the established tty port.
<p>
<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>char</em>
&nbsp;</td><td>
 to push through. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 char pushed through. </dl>    </td>
  </tr>
</table>
<a name="a2" doxytag="TTYStream::setTimeout"></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 TTYStream::setTimeout (
          </b></td>
          <td valign="bottom"><b>
<a class="el" href="thread_h.html#a1">timeout_t</a> <em>to</em>&nbsp;)<code> [inline]</code>
          </b></td>
        </tr>

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

<p>
Set the timeout control.
<p>
<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>timeout</em>
&nbsp;</td><td>
 to use. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a4" doxytag="TTYStream::sync"></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> 
int TTYStream::sync (
          </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>
Flushes the stream input and out buffers, writes pending output.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 0 on success. </dl>    </td>
  </tr>
</table>
<a name="b4" doxytag="TTYStream::uflow"></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> 
int TTYStream::uflow (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
This streambuf method is used for doing unbuffered reads through the establish tty serial port when in interactive mode.
<p>
Also this method will handle proper use of buffers if not in interative mode.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 char from tty serial port, EOF also possible. </dl>    </td>
  </tr>
</table>
<a name="b3" doxytag="TTYStream::underflow"></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> 
int TTYStream::underflow (
          </b></td>
          <td valign="bottom"><b>
void&nbsp;)<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
This streambuf method is used to load the input buffer through the established tty serial port.
<p>
<dl compact><dt>
<b>Returns: </b><dd>
 char from get buffer, EOF also possible. </dl>    </td>
  </tr>
</table>
<hr><h2>Friends And Related Function Documentation</h2>
<a name="l0" doxytag="TTYStream::crlf"></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> 
TTYStream&amp; crlf (
          </b></td>
          <td valign="bottom"><b>
TTYStream &amp;&nbsp;)<code> [friend]</code>
          </b></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="l1" doxytag="TTYStream::lfcr"></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> 
TTYStream&amp; lfcr (
          </b></td>
          <td valign="bottom"><b>
TTYStream &amp;&nbsp;)<code> [friend]</code>
          </b></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a name="n0" doxytag="TTYStream::gbuf"></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> 
char * TTYStream::gbuf<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="n1" doxytag="TTYStream::pbuf"></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> 
char * TTYStream::pbuf<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="n2" doxytag="TTYStream::timeout"></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> TTYStream::timeout<code> [protected]</code>
          </b></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="serial_h-source.html">serial.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>