Sophie

Sophie

distrib > Mandriva > 2007.0 > i586 > by-pkgid > ad1ba1135a9c9eeffc2e538163e00373 > files > 77

libCommonC++2_1.4-devel-1.4.1-1mdv2007.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>GNU CommonC++: ost::Buffer Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.6 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li id="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
    <li><a href="examples.html"><span>Examples</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<div class="nav">
<a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_buffer.html">Buffer</a></div>
<h1>ost::Buffer Class Reference</h1><!-- doxytag: class="ost::Buffer" --><!-- doxytag: inherits="ost::Conditional" -->The buffer class represents an IPC service that is built upon a buffer of fixed capacity that can be used to transfer objects between one or more producer and consumer threads.Producer/Consumer buffer for use between threads.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="buffer_8h-source.html">buffer.h</a>&gt;</code>
<p>
<p>Inheritance diagram for ost::Buffer:
<p><center><img src="classost_1_1_buffer.png" usemap="#ost::Buffer_map" border="0" alt=""></center>
<map name="ost::Buffer_map">
<area href="classost_1_1_conditional.html" alt="ost::Conditional" shape="rect" coords="0,0,100,24">
<area href="classost_1_1_fixed_buffer.html" alt="ost::FixedBuffer" shape="rect" coords="0,112,100,136">
</map>
<a href="classost_1_1_buffer-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#facde25a803bcf18ed0fc2791fca525d">Buffer</a> (size_t capacity)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a buffer object of known capacity.  <a href="#facde25a803bcf18ed0fc2791fca525d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#ef3a7f472cebcdeca059e2618bf1879c">~Buffer</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">In derived functions, may be used to free the actual memory used to hold buffered data.  <a href="#ef3a7f472cebcdeca059e2618bf1879c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#edd8b294e02c08a60bde023bd2c1ff47">getSize</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the capacity of the buffer as specified at creation.  <a href="#edd8b294e02c08a60bde023bd2c1ff47"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#462525b42df6660894ccf8141d73071e">getUsed</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the current capacity in use for the buffer.  <a href="#462525b42df6660894ccf8141d73071e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#5f67183f492fe6600456d919ed811fac">wait</a> (void *buf, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> <a class="el" href="classost_1_1_buffer.html#e416c78e4d5dc50bfa3c4e0b98fd7a98">timeout</a>=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Let one or more threads wait for an object to become available in the buffer.  <a href="#5f67183f492fe6600456d919ed811fac"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#9d106bd44d9bee8d9ef049cfa264e5b7">post</a> (void *buf, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> <a class="el" href="classost_1_1_buffer.html#e416c78e4d5dc50bfa3c4e0b98fd7a98">timeout</a>=0)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Post an object into the buffer and enable a waiting thread to receive it.  <a href="#9d106bd44d9bee8d9ef049cfa264e5b7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#e613b6a13146b782ce5749b810cceba8">peek</a> (void *buf)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Peek at the current content (first object) in the buffer.  <a href="#e613b6a13146b782ce5749b810cceba8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#255237cf9eebf6010546e884933ff8ba">isValid</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">New virtual to test if buffer is a valid object.  <a href="#255237cf9eebf6010546e884933ff8ba"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#e416c78e4d5dc50bfa3c4e0b98fd7a98">timeout</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">value to return when a timed operation returned with a timeout.  <a href="#e416c78e4d5dc50bfa3c4e0b98fd7a98"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#5879caf00bd75cd972d84b822cb77ef0">onPeek</a> (void *buf)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invoke derived class buffer peeking method.  <a href="#5879caf00bd75cd972d84b822cb77ef0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#9662e8def92667057121de0847dcabf0">onWait</a> (void *buf)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invoke derived class object request from buffer.  <a href="#9662e8def92667057121de0847dcabf0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#7ee3158e74f0e50e91f14bf370feb1fa">onPost</a> (void *buf)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Invoke derived class posting of object to buffer.  <a href="#7ee3158e74f0e50e91f14bf370feb1fa"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Related Functions</h2></td></tr>
<tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#be2397b9087bd1651ee67ed5702c01dd">get</a> (<a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;b, void *o, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> t=0)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#1dc4ad52b6f17817e4afa981d1db6fae">put</a> (<a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;b, void *o, <a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a> t=0)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">size_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_buffer.html#2066fdf67ab3b6727be90a51fc5c4d64">peek</a> (<a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;b, void *o)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The buffer class represents an IPC service that is built upon a buffer of fixed capacity that can be used to transfer objects between one or more producer and consumer threads.Producer/Consumer buffer for use between threads. 
<p>
Producer threads post objects into the buffer, and consumer threads wait for and receive objects from the buffer. Semaphores are used to to block the buffer from overflowing and indicate when there is data available, and mutexes are used to protect multiple consumers and producer threads from stepping over each other.<p>
The buffer class is an abstract class in that the actual data being buffered is not directly specified within the buffer class itself. The buffer class should be used as a base class for a class that actually impliments buffering and which may be aware of the data types actually are being buffered. A template class could be created based on buffer for this purpose. Another possibility is to create a class derived from both <a class="el" href="classost_1_1_thread.html">Thread</a> and <a class="el" href="classost_1_1_buffer.html">Buffer</a> which can be used to implement message passing threads.<p>
<dl compact><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; </dd></dl>

<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="facde25a803bcf18ed0fc2791fca525d"></a><!-- doxytag: member="ost::Buffer::Buffer" ref="facde25a803bcf18ed0fc2791fca525d" args="(size_t capacity)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">ost::Buffer::Buffer           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">size_t&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>capacity</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Create a buffer object of known capacity. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>capacity</em>&nbsp;</td><td>is the integer capacity of the buffer. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="ef3a7f472cebcdeca059e2618bf1879c"></a><!-- doxytag: member="ost::Buffer::~Buffer" ref="ef3a7f472cebcdeca059e2618bf1879c" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual ost::Buffer::~Buffer           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
In derived functions, may be used to free the actual memory used to hold buffered data. 
<p>
    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="edd8b294e02c08a60bde023bd2c1ff47"></a><!-- doxytag: member="ost::Buffer::getSize" ref="edd8b294e02c08a60bde023bd2c1ff47" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t ost::Buffer::getSize           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Return the capacity of the buffer as specified at creation. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of buffer. </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="462525b42df6660894ccf8141d73071e"></a><!-- doxytag: member="ost::Buffer::getUsed" ref="462525b42df6660894ccf8141d73071e" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t ost::Buffer::getUsed           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Return the current capacity in use for the buffer. 
<p>
Free space is technically <a class="el" href="classost_1_1_buffer.html#edd8b294e02c08a60bde023bd2c1ff47">getSize()</a> - <a class="el" href="classost_1_1_buffer.html#462525b42df6660894ccf8141d73071e">getUsed()</a>. <dl compact><dt><b>Returns:</b></dt><dd>integer used capacity of the buffer. </dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classost_1_1_buffer.html#edd8b294e02c08a60bde023bd2c1ff47">getSize</a> </dd></dl>
    </td>
  </tr>
</table>
<a class="anchor" name="255237cf9eebf6010546e884933ff8ba"></a><!-- doxytag: member="ost::Buffer::isValid" ref="255237cf9eebf6010546e884933ff8ba" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual bool ost::Buffer::isValid           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
New virtual to test if buffer is a valid object. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>true if object is valid. </dd></dl>

<p>
Reimplemented in <a class="el" href="classost_1_1_fixed_buffer.html#0a374a1a50ae78ce64db9e4ab25991d2">ost::FixedBuffer</a>.    </td>
  </tr>
</table>
<a class="anchor" name="5879caf00bd75cd972d84b822cb77ef0"></a><!-- doxytag: member="ost::Buffer::onPeek" ref="5879caf00bd75cd972d84b822cb77ef0" args="(void *buf)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual size_t ost::Buffer::onPeek           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>buf</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Invoke derived class buffer peeking method. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object found. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to copy contents of head of buffer to. </td></tr>
  </table>
</dl>

<p>
Implemented in <a class="el" href="classost_1_1_fixed_buffer.html#e0a0b8dcb25e97313de5b998e1f22bfd">ost::FixedBuffer</a>.    </td>
  </tr>
</table>
<a class="anchor" name="7ee3158e74f0e50e91f14bf370feb1fa"></a><!-- doxytag: member="ost::Buffer::onPost" ref="7ee3158e74f0e50e91f14bf370feb1fa" args="(void *buf)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual size_t ost::Buffer::onPost           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>buf</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Invoke derived class posting of object to buffer. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object posted. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to object being posted to the buffer. </td></tr>
  </table>
</dl>

<p>
Implemented in <a class="el" href="classost_1_1_fixed_buffer.html#5d39b3282dd4a18d79456f7f16962b35">ost::FixedBuffer</a>.    </td>
  </tr>
</table>
<a class="anchor" name="9662e8def92667057121de0847dcabf0"></a><!-- doxytag: member="ost::Buffer::onWait" ref="9662e8def92667057121de0847dcabf0" args="(void *buf)=0" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">virtual size_t ost::Buffer::onWait           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>buf</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [protected, pure virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Invoke derived class object request from buffer. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object returned. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to hold object returned from the buffer. </td></tr>
  </table>
</dl>

<p>
Implemented in <a class="el" href="classost_1_1_fixed_buffer.html#8364661c1b2d2114d87be12479b04a47">ost::FixedBuffer</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e613b6a13146b782ce5749b810cceba8"></a><!-- doxytag: member="ost::Buffer::peek" ref="e613b6a13146b782ce5749b810cceba8" args="(void *buf)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t ost::Buffer::peek           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>buf</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Peek at the current content (first object) in the buffer. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object in the buffer. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to store object found in the buffer. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="9d106bd44d9bee8d9ef049cfa264e5b7"></a><!-- doxytag: member="ost::Buffer::post" ref="9d106bd44d9bee8d9ef049cfa264e5b7" args="(void *buf, timeout_t timeout=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t ost::Buffer::post           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname" nowrap> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Post an object into the buffer and enable a waiting thread to receive it. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object posted in bytes. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to object to store in the buffer. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>time to wait. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="5f67183f492fe6600456d919ed811fac"></a><!-- doxytag: member="ost::Buffer::wait" ref="5f67183f492fe6600456d919ed811fac" args="(void *buf, timeout_t timeout=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t ost::Buffer::wait           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void *&nbsp;</td>
          <td class="mdname" nowrap> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>timeout</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Let one or more threads wait for an object to become available in the buffer. 
<p>
The waiting thread(s) will wait forever if no object is ever placed into the buffer.<p>
<dl compact><dt><b>Returns:</b></dt><dd>size of object passed by buffer in bytes. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>buf</em>&nbsp;</td><td>pointer to store object retrieved from the buffer. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>timeout</em>&nbsp;</td><td>time to wait. </td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<hr><h2>Friends And Related Function Documentation</h2>
<a class="anchor" name="be2397b9087bd1651ee67ed5702c01dd"></a><!-- doxytag: member="ost::Buffer::get" ref="be2397b9087bd1651ee67ed5702c01dd" args="(Buffer &amp;b, void *o, timeout_t t=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t get           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>b</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap> <em>o</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [related]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a class="anchor" name="2066fdf67ab3b6727be90a51fc5c4d64"></a><!-- doxytag: member="ost::Buffer::peek" ref="2066fdf67ab3b6727be90a51fc5c4d64" args="(Buffer &amp;b, void *o)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t peek           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>b</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap> <em>o</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [related]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
    </td>
  </tr>
</table>
<a class="anchor" name="1dc4ad52b6f17817e4afa981d1db6fae"></a><!-- doxytag: member="ost::Buffer::put" ref="1dc4ad52b6f17817e4afa981d1db6fae" args="(Buffer &amp;b, void *o, timeout_t t=0)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">size_t put           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classost_1_1_buffer.html">Buffer</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>b</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap> <em>o</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="thread_8h.html#f412159e5cef839836a5e7b19ee75d1c">timeout_t</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>t</em> = <code>0</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [related]</code></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 class="anchor" name="e416c78e4d5dc50bfa3c4e0b98fd7a98"></a><!-- doxytag: member="ost::Buffer::timeout" ref="e416c78e4d5dc50bfa3c4e0b98fd7a98" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">const size_t <a class="el" href="classost_1_1_buffer.html#e416c78e4d5dc50bfa3c4e0b98fd7a98">ost::Buffer::timeout</a><code> [static]</code>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
value to return when a timed operation returned with a timeout. 
<p>
    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="buffer_8h-source.html">buffer.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Mon Jun 19 10:50:56 2006 for GNU CommonC++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
</body>
</html>