1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
<HTML><HEAD><TITLE>Pipe Class</TITLE></HEAD>
<BODY bgcolor="#ffffff">
<H1>Pipe Class Reference</H1>
<p>
[<A HREF="index.html">APE Index</A>] [<A HREF="hier.html">APE Hierarchy</A>]
[<A HREF="header-list.html">Headers</A>]
</p>
<HR>
<P>kernel buffering between processes and/or threads. <a href="#short">More...</a></P>
<P>
<code>
#include <<a href="thread-h.html">thread.h</a>>
</code>
</P>
<H2>Public Members</H2>
<UL>
<LI> <b><a href="#ref0">Pipe</a></b> ()
</LI>
<LI> <b><a href="#ref1">~Pipe</a></b> ()
</LI>
<LI> <b><a href="#ref2">Pipe</a></b> (const Pipe &orig)
</LI>
<LI>Pipe& <b><a name="ref3">operator=</a></b> (const Pipe &orig)
</LI>
<LI>inline int <b><a href="#ref4">Read</a></b> (void *addr, size_t len)
</LI>
<LI>inline int <b><a href="#ref5">Write</a></b> (void *addr, size_t len)
</LI>
<LI>friend inline int <b><a name="ref6">read</a></b> (Pipe &p, void *addr, size_t len)
</LI>
<LI>friend inline int <b><a name="ref7">write</a></b> (Pipe &p, void *addr, size_t len)
</LI>
</UL>
<H2>Protected Members</H2>
<UL>
<LI>inline void <b><a href="#ref8">Sender</a></b> (void)
</LI>
<LI>inline void <b><a href="#ref9">Receiver</a></b> (void)
</LI>
</UL>
<HR>
<H2><a name="short">Detailed Description</a></H2>
<P>
The Pipe uses system kernel buffering to hold data being passed either
between two execution contexts within the same process, or between
different processes. Unlike Buffer, Pipe 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. Since
the pipe does not deal with fixed objects, any data can be read from or
written to the kernel pipe buffer.
</P><HR>
<H3><b> <a name="ref0"></a><a name="Pipe">Pipe</a>() </b><code>[public]</code></H3>
<p>Create a kernel pipe descriptor set using pipe().
</p>
<H3><b> <a name="ref1"></a><a name="~Pipe">~Pipe</a>() </b><code>[public]</code></H3>
<p>Destroy the pipe and kernel descriptor resources.
</p>
<H3><b> <a name="ref2"></a><a name="Pipe">Pipe</a>(const <a href="Pipe.html">Pipe</a> &orig) </b><code>[public]</code></H3>
<p>Create a pipe as a duplicate of an existing pipe.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
orig</td><td align="left" valign="top">
pipe to duplicate.</td></tr>
</table>
</dl>
<H3><b>inline int <a name="ref4"></a><a name="Read">Read</a>(void *addr, size_t len) </b><code>[public]</code></H3>
<p>Read an arbitrary number of bytes from the pipe buffer.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
addr</td><td align="left" valign="top">
pointer to store read data.</td></tr>
<tr><td align="left" valign="top">
len</td><td align="left" valign="top">
number of bytes to read.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
number of bytes actually read if successful.</dl>
<H3><b>inline int <a name="ref5"></a><a name="Write">Write</a>(void *addr, size_t len) </b><code>[public]</code></H3>
<p>Write an arbitrary number of butes to the pipe buffer.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
addr</td><td align="left" valign="top">
pointer to write data from.</td></tr>
<tr><td align="left" valign="top">
len</td><td align="left" valign="top">
number of butes to write.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
number of bytes read if successful.</dl>
<H3><b>inline void <a name="ref8"></a><a name="Sender">Sender</a>(void) </b><code>[protected]</code></H3>
<p>Sender is often used for implementing a fork()'d message port
between processes. By defining the current pipe as only used
for sending, the receiver is presumed to be in the other half
of a fork()'d process.
</p><p>
</p>
<dl><dt><b>See Also</b>:<dd><a href="Pipe.html#Receiver">Receiver</a></dl>
<H3><b>inline void <a name="ref9"></a><a name="Receiver">Receiver</a>(void) </b><code>[protected]</code></H3>
<p>Receiver is often used for implementing a fork()'d message port
between processes. By defining the current pipe as only used
for receiving, the sender is presumed to be in the other half
of a fork()'d process.
</p><p>
</p>
<dl><dt><b>See Also</b>:<dd><a href="Pipe.html#Sender">Sender</a></dl>
<HR>
<TABLE WIDTH="100%"><TR><TD ALIGN="left" VALIGN="top">
<UL><LI><I>Author</I>: David Sugar <dyfet@ostel.com>. </LI>
<LI>Documentation generated by dyfet@home.sys on Thu Dec 16 09:54:26 EST 1999
</LI>
</UL></TD><TD ALIGN="RIGHT" VALIGN="TOP">
<b>K</b><i>doc</i>
</TD>
</TR></TABLE></BODY></HTML>
|