Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 4f5f2dc0f55b453456458df885792b0b > files > 267

ucommon-doc-5.0.4-1mdv2010.2.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>ucommon: ucommon::ReusableAllocator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&nbsp;Structure&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&nbsp;Fields</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="a00208.html">ucommon</a>::<a class="el" href="a00115.html">ReusableAllocator</a>
  </div>
</div>
<div class="contents">
<h1>ucommon::ReusableAllocator Class Reference</h1><!-- doxytag: class="ucommon::ReusableAllocator" --><!-- doxytag: inherits="ucommon::Conditional" -->
<p>Class for resource bound memory pools between threads.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00202_source.html">thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ucommon::ReusableAllocator:</div>
<div class="dynsection">
<div class="center"><img src="a00485.png" border="0" usemap="#ucommon_1_1_reusable_allocator_inherit__map" alt="Inheritance graph"/></div>
<map name="ucommon_1_1_reusable_allocator_inherit__map" id="ucommon_1_1_reusable_allocator_inherit__map">
<area shape="rect" id="node5" href="a00016.html" title="An array of reusable objects." alt="" coords="67,155,277,181"/><area shape="rect" id="node9" href="a00078.html" title="Map a reusable allocator over a named shared memory segment." alt="" coords="332,155,553,181"/><area shape="rect" id="node13" href="a00106.html" title="A mempager source of reusable objects." alt="" coords="608,155,819,181"/><area shape="rect" id="node2" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="332,5,553,32"/><area shape="rect" id="node7" href="a00015.html" title="An array of reusable types." alt="" coords="5,229,277,256"/><area shape="rect" id="node11" href="a00075.html" title="Template class to map typed reusable objects into shared memory heap." alt="" coords="301,229,584,256"/><area shape="rect" id="node15" href="a00102.html" title="A reusable private pool of reusable types." alt="" coords="608,229,880,256"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ucommon::ReusableAllocator:</div>
<div class="dynsection">
<div class="center"><img src="a00486.png" border="0" usemap="#ucommon_1_1_reusable_allocator_coll__map" alt="Collaboration graph"/></div>
<map name="ucommon_1_1_reusable_allocator_coll__map" id="ucommon_1_1_reusable_allocator_coll__map">
<area shape="rect" id="node2" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="5,176,227,203"/><area shape="rect" id="node4" href="a00116.html" title="Reusable objects for forming private heaps." alt="" coords="251,176,501,203"/><area shape="rect" id="node6" href="a00067.html" title="Common base class for all objects that can be formed into a linked list." alt="" coords="260,91,492,117"/><area shape="rect" id="node8" href="a00095.html" title="A common base class for all managed objects." alt="" coords="251,5,501,32"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00116.html">ReusableObject</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00115.html#acc1aad83051d6ecc3c1a0d36b312491d">next</a> (<a class="el" href="a00116.html">ReusableObject</a> *object)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get next reusable object in the pool.  <a href="#acc1aad83051d6ecc3c1a0d36b312491d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00115.html#ad03bdabf4ebb451ab2bd3a93c7c23959">release</a> (<a class="el" href="a00116.html">ReusableObject</a> *object)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release resuable object.  <a href="#ad03bdabf4ebb451ab2bd3a93c7c23959"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00115.html#a445660ee7948db155f9d71dab314ff6c">ReusableAllocator</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize reusable allocator through a conditional.  <a href="#a445660ee7948db155f9d71dab314ff6c"></a><br/></td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd114dff6d7adef3c1d54dbf39c0d0cc"></a><!-- doxytag: member="ucommon::ReusableAllocator::freelist" ref="afd114dff6d7adef3c1d54dbf39c0d0cc" args="" -->
<a class="el" href="a00116.html">ReusableObject</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>freelist</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5430a4fbb9d218b71c01f2f65f10d69c"></a><!-- doxytag: member="ucommon::ReusableAllocator::waiting" ref="a5430a4fbb9d218b71c01f2f65f10d69c" args="" -->
unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><b>waiting</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Class for resource bound memory pools between threads. </p>
<p>This is used to support a memory pool allocation scheme where a pool of reusable objects may be allocated, and the pool renewed by releasing objects or back. When the pool is used up, a pool consuming thread then must wait for a resource to be freed by another consumer (or timeout). This class is not meant to be used directly, but rather to build the synchronizing control between consumers which might be forced to wait for a resource. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="a00202_source.html#l00770">770</a> of file <a class="el" href="a00202_source.html">thread.h</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a445660ee7948db155f9d71dab314ff6c"></a><!-- doxytag: member="ucommon::ReusableAllocator::ReusableAllocator" ref="a445660ee7948db155f9d71dab314ff6c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ucommon::ReusableAllocator::ReusableAllocator </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initialize reusable allocator through a conditional. </p>
<p>Zero free list. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="acc1aad83051d6ecc3c1a0d36b312491d"></a><!-- doxytag: member="ucommon::ReusableAllocator::next" ref="acc1aad83051d6ecc3c1a0d36b312491d" args="(ReusableObject *object)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00116.html">ReusableObject</a>* ucommon::ReusableAllocator::next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00116.html">ReusableObject</a> *&nbsp;</td>
          <td class="paramname"> <em>object</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get next reusable object in the pool. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>object</em>&nbsp;</td><td>from list. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>next object. </dd></dl>

<p>Definition at line <a class="el" href="a00202_source.html#l00786">786</a> of file <a class="el" href="a00202_source.html">thread.h</a>.</p>

</div>
</div>
<a class="anchor" id="ad03bdabf4ebb451ab2bd3a93c7c23959"></a><!-- doxytag: member="ucommon::ReusableAllocator::release" ref="ad03bdabf4ebb451ab2bd3a93c7c23959" args="(ReusableObject *object)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ucommon::ReusableAllocator::release </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00116.html">ReusableObject</a> *&nbsp;</td>
          <td class="paramname"> <em>object</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Release resuable object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>object</em>&nbsp;</td><td>being released. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00202_source.html">thread.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:39:54 2011 for ucommon by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>