Sophie

Sophie

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

libCommonC++1.9_3-devel-1.9.4-2mdk.i586.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>ost::Pipe class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.10 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</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="namespacemembers.html">Namespace Members</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>ost::Pipe  Class Reference</h1>The <a class="el" href="classost_1_1_pipe.html">Pipe</a> uses system kernel buffering to hold data being passed either between two execution contexts within the same process, or between different processes. kernel buffering between processes and/or threads. 
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="file_8h-source.html">file.h</a>&gt;</code>
<p>
<a href="classost_1_1_pipe-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>bool&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#a0">operator!</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Used to see if the pipe has any open entities.</em> <a href="#a0">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="classost_1_1_pipe.html#a1">Recv</a> (void *addr)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Perform an object atomic transfer of data from a pipe.</em> <a href="#a1">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="classost_1_1_pipe.html#a2">Send</a> (void *addr)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Perform an object atomic transfer of data to a pipe.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>bool&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#a3">isValid</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Verify this object is "valid".</em> <a href="#a3">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>int&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b0">getSize</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Get the object size for atomic operations.</em> <a href="#b0">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="classost_1_1_pipe.html#b1">endSender</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Sender is often used for implementing a fork()'d message port between processes.</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="classost_1_1_pipe.html#b2">endReceiver</a> (void)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Receiver is often used for implementing a fork()'d message port between processes.</em> <a href="#b2">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="classost_1_1_pipe.html#b3">Pipe</a> (int size=512, int count=1)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create a kernel pipe descriptor set using pipe().</em> <a href="#b3">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b4">~Pipe</a> ()</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Destroy the pipe and kernel descriptor resources.</em> <a href="#b4">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="classost_1_1_pipe.html#b5">Pipe</a> (const Pipe &amp;orig)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Create a pipe as a duplicate of an existing pipe.</em> <a href="#b5">More...</a><em></em></font><br><br></td></tr>
<tr><td nowrap align=right valign=top>Pipe &amp;&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b6">operator=</a> (const Pipe &amp;orig)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b7">Sender</a> (void)</td></tr>
<tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b8">Receiver</a> (void)</td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b9">Read</a> (void *buf, int len)</td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classost_1_1_pipe.html#b10">Write</a> (void *buf, int len)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The <a class="el" href="classost_1_1_pipe.html">Pipe</a> uses system kernel buffering to hold data being passed either between two execution contexts within the same process, or between different processes. kernel buffering between processes and/or threads.
<p>
Unlike thread's "<a class="el" href="classost_1_1_buffer.html">Buffer</a>", <a class="el" href="classost_1_1_pipe.html">Pipe</a> uses system descriptors and kernel memory. Under Posix, the size of the pipe and associated kernel memory is always a fixed constant as defined by _PC_PIPE_BUF. The Common C++ "pipe" class primarily deals with "atomic" transfers of fixed sized objects through pipes. Pipes may pass data arbitrarily and can also be used through the "pipestream" class.
<p>
The "<a class="el" href="classost_1_1_pipe.html">Pipe</a>" class is not meant to be a true "public" class, but as a builder class for deriving other classes.
<p>
<dl compact><dt><b>
Author: </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="b3" doxytag="ost::Pipe::Pipe"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> ost::Pipe::Pipe </td>
          <td class="md">(&nbsp;</td>
          <td class="md">int</td>
          <td class="mdname">&nbsp; <em>size</em> = 512, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md">int</td>
          <td class="mdname">&nbsp; <em>count</em> = 1</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [protected]</code></td>
        </tr>

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

<p>
Create a kernel pipe descriptor set using pipe().
<p>
On systems which allow the pipe kernel buffer to be defined, a size for aligned atomic transfers can be set, as well as the number of atomic objects the kernel will buffer. On Posix systems, these options are ignored.<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>objsize
</em>&nbsp;</td><td>
of atomic objects to send. </td></tr>
<tr><td valign=top><em>count
</em>&nbsp;</td><td>
of atomic objects to kernel buffer. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b4" doxytag="ost::Pipe::~Pipe"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual ost::Pipe::~Pipe </td>
          <td class="md">(&nbsp;</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected, virtual]</code></td>
        </tr>

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

<p>
Destroy the pipe and kernel descriptor resources.
<p>
    </td>
  </tr>
</table>
<a name="b5" doxytag="ost::Pipe::Pipe"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> ost::Pipe::Pipe </td>
          <td class="md">(&nbsp;</td>
          <td class="md">const Pipe &amp;</td>
          <td class="mdname1">&nbsp; <em>orig</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></td>
        </tr>

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

<p>
Create a pipe as a duplicate of an existing pipe.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>orig
</em>&nbsp;</td><td>
pipe to duplicate. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="b9" doxytag="ost::Pipe::Read"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int ost::Pipe::Read </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void *</td>
          <td class="mdname">&nbsp; <em>buf</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md">int</td>
          <td class="mdname">&nbsp; <em>len</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="b8" doxytag="ost::Pipe::Receiver"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void ost::Pipe::Receiver </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="a1" doxytag="ost::Pipe::Recv"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int ost::Pipe::Recv </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void *</td>
          <td class="mdname1">&nbsp; <em>addr</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline]</code></td>
        </tr>

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

<p>
Perform an object atomic transfer of data from a pipe.
<p>
<dl compact><dt><b>
Returns: </b><dd>
number of bytes actually read if successful. </dl><dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>addr
</em>&nbsp;</td><td>
pointer to store read data. </td></tr>
<tr><td valign=top><em>len
</em>&nbsp;</td><td>
number of bytes to read. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="a2" doxytag="ost::Pipe::Send"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int ost::Pipe::Send </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void *</td>
          <td class="mdname1">&nbsp; <em>addr</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline]</code></td>
        </tr>

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

<p>
Perform an object atomic transfer of data to a pipe.
<p>
<dl compact><dt><b>
Returns: </b><dd>
number of bytes written if successful. </dl><dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>addr
</em>&nbsp;</td><td>
pointer to write data from. </td></tr>
<tr><td valign=top><em>len
</em>&nbsp;</td><td>
number of butes to write. </td></tr>
</table>
</dl>    </td>
  </tr>
</table>
<a name="b7" doxytag="ost::Pipe::Sender"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void ost::Pipe::Sender </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="b10" doxytag="ost::Pipe::Write"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int ost::Pipe::Write </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void *</td>
          <td class="mdname">&nbsp; <em>buf</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md">int</td>
          <td class="mdname">&nbsp; <em>len</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected]</code></td>
        </tr>

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

<p>
    </td>
  </tr>
</table>
<a name="b2" doxytag="ost::Pipe::endReceiver"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void ost::Pipe::endReceiver </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

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

<p>
Receiver is often used for implementing a fork()'d message port between processes.
<p>
By stopping the receiver, the current pipe can then only be used for sending, and the receiver is presumed to be in the other half of a fork()'d process.
<p>
<dl compact><dt><b>
See also: </b><dd>
<a class="el" href="classost_1_1_pipe.html#b1">endSender</a> </dl>    </td>
  </tr>
</table>
<a name="b1" doxytag="ost::Pipe::endSender"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> void ost::Pipe::endSender </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

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

<p>
Sender is often used for implementing a fork()'d message port between processes.
<p>
By stopping the sender, the current pipe can then only be used for receiving, and the sender is presumed to be in the other half of a fork()'d process.
<p>
<dl compact><dt><b>
See also: </b><dd>
<a class="el" href="classost_1_1_pipe.html#b2">endReceiver</a> </dl>    </td>
  </tr>
</table>
<a name="b0" doxytag="ost::Pipe::getSize"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int ost::Pipe::getSize </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [inline, protected]</code></td>
        </tr>

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

<p>
Get the object size for atomic operations.
<p>
<dl compact><dt><b>
Returns: </b><dd>
size of atomic operations. </dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="ost::Pipe::isValid"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool ost::Pipe::isValid </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

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

<p>
Verify this object is "valid".
<p>
<dl compact><dt><b>
Returns: </b><dd>
true if valid. </dl>    </td>
  </tr>
</table>
<a name="a0" doxytag="ost::Pipe::operator!"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> bool ost::Pipe::operator! </td>
          <td class="md">(&nbsp;</td>
          <td class="md">void</td>
          <td class="mdname1">&nbsp;          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"></td>
        </tr>

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

<p>
Used to see if the pipe has any open entities.
<p>
    </td>
  </tr>
</table>
<a name="b6" doxytag="ost::Pipe::operator="></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> Pipe&amp; ost::Pipe::operator= </td>
          <td class="md">(&nbsp;</td>
          <td class="md">const Pipe &amp;</td>
          <td class="mdname1">&nbsp; <em>orig</em>          </td>
          <td class="md">)&nbsp;</td>
          <td class="md"><code> [protected]</code></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="file_8h-source.html">file.h</a></ul>
<hr><address><small>Generated at Fri Jan 4 18:51:50 2002 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.10 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>