<!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::array_reuse< T > Class Template 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 Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Data 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 Structures</span></a></li> <li><a href="classes.html"><span>Data Structure Index</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="a00208.html">ucommon</a>::<a class="el" href="a00015.html">array_reuse</a> </div> </div> <div class="contents"> <h1>ucommon::array_reuse< T > Class Template Reference</h1><!-- doxytag: class="ucommon::array_reuse" --><!-- doxytag: inherits="ucommon::ArrayReuse" --> <p>An array of reusable types. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="a00206_source.html">vector.h</a>></code></p> <div class="dynheader"> Inheritance diagram for ucommon::array_reuse< T >:</div> <div class="dynsection"> <div class="center"><img src="a00333.png" border="0" usemap="#ucommon_1_1array__reuse_3_01_t_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="ucommon_1_1array__reuse_3_01_t_01_4_inherit__map" id="ucommon_1_1array__reuse_3_01_t_01_4_inherit__map"> <area shape="rect" id="node2" href="a00016.html" title="An array of reusable objects." alt="" coords="41,155,252,181"/><area shape="rect" id="node4" href="a00115.html" title="Class for resource bound memory pools between threads." alt="" coords="5,80,288,107"/><area shape="rect" id="node6" href="a00036.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="36,5,257,32"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for ucommon::array_reuse< T >:</div> <div class="dynsection"> <div class="center"><img src="a00334.png" border="0" usemap="#ucommon_1_1array__reuse_3_01_t_01_4_coll__map" alt="Collaboration graph"/></div> <map name="ucommon_1_1array__reuse_3_01_t_01_4_coll__map" id="ucommon_1_1array__reuse_3_01_t_01_4_coll__map"> <area shape="rect" id="node2" href="a00016.html" title="An array of reusable objects." alt="" coords="87,344,297,371"/><area shape="rect" id="node4" href="a00115.html" title="Class for resource bound memory pools between threads." alt="" coords="51,267,333,293"/><area shape="rect" id="node6" 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="node8" href="a00116.html" title="Reusable objects for forming private heaps." alt="" coords="251,176,501,203"/><area shape="rect" id="node10" 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="node12" 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>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#aa5015d281211f0c1ee2337f9e8f95128">array_reuse</a> (unsigned count)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create private heap of reusable objects of specified type. <a href="#aa5015d281211f0c1ee2337f9e8f95128"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a51739c71f6d10a1b466386eb65518432">create</a> (<a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a typed object from the heap. <a href="#a51739c71f6d10a1b466386eb65518432"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a7844b7d3bc8b461ecd6ebac0c5fd2423">create</a> (void)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create a typed object from the heap. <a href="#a7844b7d3bc8b461ecd6ebac0c5fd2423"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a3c64d42cdef748e83736221c10924cfa">get</a> (<a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get a typed object from the heap. <a href="#a3c64d42cdef748e83736221c10924cfa"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a04b72f212c5941813d106cc0231e2cfb">get</a> (void)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get a typed object from the heap. <a href="#a04b72f212c5941813d106cc0231e2cfb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a4e544b834d3024acf53192d7a6fa933f">operator bool</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Test if typed objects available in heap or re-use list. <a href="#a4e544b834d3024acf53192d7a6fa933f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a297d0630b995b53ffdcaa8914eb2ca8f">operator T *</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get a typed object from the heap by type casting reference. <a href="#a297d0630b995b53ffdcaa8914eb2ca8f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a008e2fe19c499113f83a2c26e2c79114">operator!</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Test if the entire heap has been allocated. <a href="#a008e2fe19c499113f83a2c26e2c79114"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#a64d2c219e070026dfd179446986237a8">operator*</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get a typed object from the heap by pointer reference. <a href="#a64d2c219e070026dfd179446986237a8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#ab5239311adb3cb5be6d32379b9e142cb">release</a> (T *object)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Release (return) a typed object back to the heap for re-use. <a href="#ab5239311adb3cb5be6d32379b9e142cb"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00015.html#ad81ecf69319c8e15be343a03e129f306">request</a> (void)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Request immediately next available typed object from the heap. <a href="#ad81ecf69319c8e15be343a03e129f306"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <h3>template<class T><br/> class ucommon::array_reuse< T ></h3> <p>An array of reusable types. </p> <p>A pool of typed objects is created which can be allocated as needed. Deallocated typed objects are returned to the pool so they can be reallocated later. This is a private fixed size heap. </p> <dl class="author"><dt><b>Author:</b></dt><dd>David Sugar <<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>> </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00488">488</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="aa5015d281211f0c1ee2337f9e8f95128"></a><!-- doxytag: member="ucommon::array_reuse::array_reuse" ref="aa5015d281211f0c1ee2337f9e8f95128" args="(unsigned count)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::<a class="el" href="a00015.html">array_reuse</a> </td> <td>(</td> <td class="paramtype">unsigned </td> <td class="paramname"> <em>count</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create private heap of reusable objects of specified type. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>count</em> </td><td>of objects of specified type to allocate. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a00206_source.html#l00495">495</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a51739c71f6d10a1b466386eb65518432"></a><!-- doxytag: member="ucommon::array_reuse::create" ref="a51739c71f6d10a1b466386eb65518432" args="(timeout_t timeout)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::create </td> <td>(</td> <td class="paramtype"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td> <td class="paramname"> <em>timeout</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create a typed object from the heap. </p> <p>This function blocks until the the heap has an object to return or the timer has expired. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>to wait for heap in milliseconds. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap or NULL if timeout. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00550">550</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a7844b7d3bc8b461ecd6ebac0c5fd2423"></a><!-- doxytag: member="ucommon::array_reuse::create" ref="a7844b7d3bc8b461ecd6ebac0c5fd2423" args="(void)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::create </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create a typed object from the heap. </p> <p>This function blocks when the heap is empty until an object is returned to the heap. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00532">532</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a3c64d42cdef748e83736221c10924cfa"></a><!-- doxytag: member="ucommon::array_reuse::get" ref="a3c64d42cdef748e83736221c10924cfa" args="(timeout_t timeout)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::get </td> <td>(</td> <td class="paramtype"><a class="el" href="a00194.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td> <td class="paramname"> <em>timeout</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get a typed object from the heap. </p> <p>This function blocks until the the heap has an object to return or the timer has expired. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>timeout</em> </td><td>to wait for heap in milliseconds. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap or NULL if timeout. </dd></dl> <p>Reimplemented from <a class="el" href="a00016.html">ucommon::ArrayReuse</a>.</p> <p>Definition at line <a class="el" href="a00206_source.html#l00541">541</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a04b72f212c5941813d106cc0231e2cfb"></a><!-- doxytag: member="ucommon::array_reuse::get" ref="a04b72f212c5941813d106cc0231e2cfb" args="(void)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::get </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get a typed object from the heap. </p> <p>This function blocks when the heap is empty until an object is returned to the heap. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap. </dd></dl> <p>Reimplemented from <a class="el" href="a00016.html">ucommon::ArrayReuse</a>.</p> <p>Definition at line <a class="el" href="a00206_source.html#l00524">524</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a4e544b834d3024acf53192d7a6fa933f"></a><!-- doxytag: member="ucommon::array_reuse::operator bool" ref="a4e544b834d3024acf53192d7a6fa933f" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::operator bool </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Test if typed objects available in heap or re-use list. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>true if objects still are available. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00502">502</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a297d0630b995b53ffdcaa8914eb2ca8f"></a><!-- doxytag: member="ucommon::array_reuse::operator T *" ref="a297d0630b995b53ffdcaa8914eb2ca8f" args="()" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::operator T * </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get a typed object from the heap by type casting reference. </p> <p>This function blocks while the heap is empty. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00565">565</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a008e2fe19c499113f83a2c26e2c79114"></a><!-- doxytag: member="ucommon::array_reuse::operator!" ref="a008e2fe19c499113f83a2c26e2c79114" args="() const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::operator! </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Test if the entire heap has been allocated. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>true if no objects are available. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00509">509</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="a64d2c219e070026dfd179446986237a8"></a><!-- doxytag: member="ucommon::array_reuse::operator*" ref="a64d2c219e070026dfd179446986237a8" args="()" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::operator* </td> <td>(</td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get a typed object from the heap by pointer reference. </p> <p>This function blocks while the heap is empty. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer from heap. </dd></dl> <p>Definition at line <a class="el" href="a00206_source.html#l00573">573</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <a class="anchor" id="ab5239311adb3cb5be6d32379b9e142cb"></a><!-- doxytag: member="ucommon::array_reuse::release" ref="ab5239311adb3cb5be6d32379b9e142cb" args="(T *object)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">void <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::release </td> <td>(</td> <td class="paramtype">T * </td> <td class="paramname"> <em>object</em></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Release (return) a typed object back to the heap for re-use. </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> </td><td>to return. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a00206_source.html#l00557">557</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dynsection"> <div class="center"><img src="a00015_ab5239311adb3cb5be6d32379b9e142cb_cgraph.png" border="0" usemap="#a00015_ab5239311adb3cb5be6d32379b9e142cb_cgraph_map" alt=""></div> <map name="a00015_ab5239311adb3cb5be6d32379b9e142cb_cgraph_map" id="a00015_ab5239311adb3cb5be6d32379b9e142cb_cgraph"> <area shape="rect" id="node3" href="a00208.html#a8df8e4b667d68be02961ff0d4cd84224" title="Convenience function to unlock shared object through it's protocol." alt="" coords="367,5,548,32"/></map> </div> </p> </div> </div> <a class="anchor" id="ad81ecf69319c8e15be343a03e129f306"></a><!-- doxytag: member="ucommon::array_reuse::request" ref="ad81ecf69319c8e15be343a03e129f306" args="(void)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T > </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00015.html">ucommon::array_reuse</a>< T >::request </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td> <td> ) </td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Request immediately next available typed object from the heap. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object pointer or NULL if heap is empty. </dd></dl> <p>Reimplemented from <a class="el" href="a00016.html">ucommon::ArrayReuse</a>.</p> <p>Definition at line <a class="el" href="a00206_source.html#l00516">516</a> of file <a class="el" href="a00206_source.html">vector.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>ucommon/<a class="el" href="a00206_source.html">vector.h</a></li> </ul> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Jul 14 16:39:27 2011 for ucommon by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address> </body> </html>