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
|
<HTML><HEAD><TITLE>FixedBuffer Class</TITLE></HEAD>
<BODY bgcolor="#ffffff">
<H1>FixedBuffer 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>producer/consumer buffer for fixed size objects. <a href="#short">More...</a></P>
<P>
<code>
#include <<a href="thread-h.html">thread.h</a>>
</code>
</P>
<P>
Inherits: <a href="Buffer.html">Buffer</a>
<P>
<H2>Public Members</H2>
<UL>
<LI> <b><a href="#ref0">FixedBuffer</a></b> (size_t capacity, size_t objsize)
</LI>
<LI> <b><a href="#ref1">FixedBuffer</a></b> (const FixedBuffer &fb)
</LI>
<LI> <b><a href="#ref2">~FixedBuffer</a></b> ()
</LI>
<LI>FixedBuffer& <b><a name="ref3">operator=</a></b> (const FixedBuffer &fb)
</LI>
</UL>
<H2>Protected Members</H2>
<UL>
<LI>int <b><a href="#ref4">OnPeek</a></b> (void *buf)
</LI>
<LI>int <b><a href="#ref5">OnWait</a></b> (void *buf)
</LI>
<LI>int <b><a href="#ref6">OnPost</a></b> (void *buf)
</LI>
</UL>
<HR>
<H2><a name="short">Detailed Description</a></H2>
<P>
A buffer class that holds a known capacity of fixed sized objects defined
during creation.
</P><HR>
<H3><b> <a name="ref0"></a><a name="FixedBuffer">FixedBuffer</a>(size_t capacity, size_t objsize) </b><code>[public]</code></H3>
<p>Create a buffer of known capacity for objects of a specified
size.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
objsize</td><td align="left" valign="top">
for each object held in the buffer.</td></tr>
<tr><td align="left" valign="top">
capacity</td><td align="left" valign="top">
of the buffer.</td></tr>
</table>
</dl>
<H3><b> <a name="ref1"></a><a name="FixedBuffer">FixedBuffer</a>(const <a href="FixedBuffer.html">FixedBuffer</a> &fb) </b><code>[public]</code></H3>
<p>Create a copy of an existing fixed size buffer and duplicate
it's contents.
</p><p>
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
fb</td><td align="left" valign="top">
existing FixedBuffer object.</td></tr>
</table>
</dl>
<H3><b> <a name="ref2"></a><a name="~FixedBuffer">~FixedBuffer</a>() </b><code>[public]</code></H3>
<p>Destroy the fixed buffer and free the memory used to store objects.
</p>
<H3><b>int <a name="ref4"></a><a name="OnPeek">OnPeek</a>(void *buf) </b><code>[protected]</code></H3>
<p>Return the first object in the buffer.
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
buf</td><td align="left" valign="top">
pointer to copy contents of head of buffer to.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
predefined size of this buffers objects.</dl>
<H3><b>int <a name="ref5"></a><a name="OnWait">OnWait</a>(void *buf) </b><code>[protected]</code></H3>
<p>Wait for and return a fixed object in the buffer.
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
buf</td><td align="left" valign="top">
pointer to hold object returned from the buffer.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
predefined size of this buffers objects.</dl>
<H3><b>int <a name="ref6"></a><a name="OnPost">OnPost</a>(void *buf) </b><code>[protected]</code></H3>
<p>Post an object of the appropriate size into the buffer.
</p>
<dl><dt><b>Parameters</b>:<dd>
<table width="100%" border="0">
<tr><td align="left" valign="top">
buf</td><td align="left" valign="top">
pointer to data to copy into the buffer.</td></tr>
</table>
</dl>
<dl><dt><b>Returns</b>:<dd>
predefined size of this buffers objects.</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>
|