<!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: queueof< T > Class Template Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">ucommon</div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.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 id="navrow2" class="tabs2"> <ul class="tablist"> <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="inherits.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('a00110.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> </div> <div class="headertitle"> <h1>queueof< T > Class Template Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="queueof" --><!-- doxytag: inherits="queue" --> <p>A templated typed class for thread-safe queue of object pointers. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="a00180_source.html">containers.h</a>></code></p> <div class="dynheader"> Inheritance diagram for queueof< T >:</div> <div class="dyncontent"> <div class="center"><img src="a00415.png" border="0" usemap="#queueof_3_01_t_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="queueof_3_01_t_01_4_inherit__map" id="queueof_3_01_t_01_4_inherit__map"> <area shape="rect" id="node2" href="a00109.html" title="Manage a thread-safe queue of objects through reference pointers." alt="" coords="120,80,192,107"/><area shape="rect" id="node4" href="a00098.html" title="An index container for maintaining an ordered list of objects." alt="" coords="5,5,147,32"/><area shape="rect" id="node6" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="171,5,301,32"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for queueof< T >:</div> <div class="dyncontent"> <div class="center"><img src="a00416.png" border="0" usemap="#queueof_3_01_t_01_4_coll__map" alt="Collaboration graph"/></div> <map name="queueof_3_01_t_01_4_coll__map" id="queueof_3_01_t_01_4_coll__map"> <area shape="rect" id="node2" href="a00109.html" title="Manage a thread-safe queue of objects through reference pointers." alt="" coords="224,371,296,397"/><area shape="rect" id="node4" href="a00098.html" title="An index container for maintaining an ordered list of objects." alt="" coords="79,280,220,307"/><area shape="rect" id="node6" href="a00099.html" title="A linked object base class for ordered objects." alt="" coords="76,176,228,203"/><area shape="rect" id="node8" href="a00065.html" title="Common base class for all objects that can be formed into a linked list." alt="" coords="5,91,147,117"/><area shape="rect" id="node10" href="a00091.html" title="A common base class for all managed objects." alt="" coords="35,5,117,32"/><area shape="rect" id="node13" href="a00034.html" title="The conditional is a common base for other thread synchronizing classes." alt="" coords="244,280,375,307"/><area shape="rect" id="node15" href="a00079.html" title="A managed private heap for small allocations." alt="" coords="399,280,500,307"/><area shape="rect" id="node17" href="a00077.html" title="A memory protocol pager for private heap manager." alt="" coords="399,176,500,203"/><area shape="rect" id="node19" href="a00071.html" title="Common locking protocol." alt="" coords="364,91,535,117"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00110.html#a1f67dec09016c15f9d18a6bf8fbe95db">fifo</a> (<a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get and remove first typed object posted to the queue. <a href="#a1f67dec09016c15f9d18a6bf8fbe95db"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00110.html#a8f6e3ce38854ccc5b7c4ed080d51455c">lifo</a> (<a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Get and remove last typed object posted to the queue. <a href="#a8f6e3ce38854ccc5b7c4ed080d51455c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00110.html#aa443dbd720c0a2417bbf4da24077102c">post</a> (T *object, <a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> timeout=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Post a typed object into the queue by it's pointer. <a href="#aa443dbd720c0a2417bbf4da24077102c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00110.html#a5f875c40e04152b075242ea31eceb69d">queueof</a> (<a class="el" href="a00079.html">mempager</a> *memory, size_t size=0)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create templated queue of typed objects. <a href="#a5f875c40e04152b075242ea31eceb69d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00110.html#a30e1bc818f34811d259b8a1cff19d90a">remove</a> (T *object)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Remove a specific typed object pointer for the queue. <a href="#a30e1bc818f34811d259b8a1cff19d90a"></a><br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><h3>template<class T><br/> class queueof< T ></h3> <p>A templated typed class for thread-safe queue of object pointers. </p> <p>This allows one to use the queue class in a typesafe manner for a specific object type derived from <a class="el" href="a00091.html" title="A common base class for all managed objects.">Object</a> rather than generically for any derived object class. </p> <dl class="author"><dt><b>Author:</b></dt><dd>David Sugar <<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>> </dd></dl> <dl><dt><b>Examples: </b></dt><dd> <p><a class="el" href="a00009.html#_a3">queue.cpp</a>.</p> </dd> </dl> <p>Definition at line <a class="el" href="a00180_source.html#l00602">602</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a5f875c40e04152b075242ea31eceb69d"></a><!-- doxytag: member="queueof::queueof" ref="a5f875c40e04152b075242ea31eceb69d" args="(mempager *memory, size_t size=0)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00110.html">queueof</a>< T >::<a class="el" href="a00110.html">queueof</a> </td> <td>(</td> <td class="paramtype"><a class="el" href="a00079.html">mempager</a> * </td> <td class="paramname"><em>memory</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create templated queue of typed objects. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">memory</td><td>pool for internal use by queue. </td></tr> <tr><td class="paramname">size</td><td>of queue to construct. Uses 0 if no size limit. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a00180_source.html#l00610">610</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a1f67dec09016c15f9d18a6bf8fbe95db"></a><!-- doxytag: member="queueof::fifo" ref="a1f67dec09016c15f9d18a6bf8fbe95db" args="(timeout_t timeout=0)" --> <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="a00110.html">queueof</a>< T >::fifo </td> <td>(</td> <td class="paramtype"><a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td> <td class="paramname"><em>timeout</em> = <code>0</code></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get and remove first typed object posted to the queue. </p> <p>This can wait for a specified timeut of the queue is empty. The object is still retained and must be released or deleted by the receiving function. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">timeout</td><td>to wait if empty in milliseconds. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>object from queue or NULL if empty and timed out. </dd></dl> <p>Reimplemented from <a class="el" href="a00109.html#afd6918e07021793e1490b65de9f77d26">queue</a>.</p> <p>Definition at line <a class="el" href="a00180_source.html#l00640">640</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div> </div> <a class="anchor" id="a8f6e3ce38854ccc5b7c4ed080d51455c"></a><!-- doxytag: member="queueof::lifo" ref="a8f6e3ce38854ccc5b7c4ed080d51455c" args="(timeout_t timeout=0)" --> <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="a00110.html">queueof</a>< T >::lifo </td> <td>(</td> <td class="paramtype"><a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td> <td class="paramname"><em>timeout</em> = <code>0</code></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Get and remove last typed object posted to the queue. </p> <p>This can wait for a specified timeout of the queue is empty. The object is still retained and must be released or deleted by the receiving function. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">timeout</td><td>to wait if empty in milliseconds. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>object from queue or NULL if empty and timed out. </dd></dl> <p>Reimplemented from <a class="el" href="a00109.html#a2f4c7f779bc8bb4dc4200018e11c7d0d">queue</a>.</p> <p>Definition at line <a class="el" href="a00180_source.html#l00650">650</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div> </div> <a class="anchor" id="aa443dbd720c0a2417bbf4da24077102c"></a><!-- doxytag: member="queueof::post" ref="aa443dbd720c0a2417bbf4da24077102c" args="(T *object, timeout_t timeout=0)" --> <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="a00110.html">queueof</a>< T >::post </td> <td>(</td> <td class="paramtype">T * </td> <td class="paramname"><em>object</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="a00193.html#af412159e5cef839836a5e7b19ee75d1c">timeout_t</a> </td> <td class="paramname"><em>timeout</em> = <code>0</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Post a typed object into the queue by it's pointer. </p> <p>This can wait for a specified timeout if the queue is full, for example, for another thread to remove an object pointer. This retains the object. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">object</td><td>to post. </td></tr> <tr><td class="paramname">timeout</td><td>to wait if queue is full in milliseconds. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>true if object posted, false if queue full and timeout expired. </dd></dl> <p>Definition at line <a class="el" href="a00180_source.html#l00630">630</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div> </div> <a class="anchor" id="a30e1bc818f34811d259b8a1cff19d90a"></a><!-- doxytag: member="queueof::remove" ref="a30e1bc818f34811d259b8a1cff19d90a" args="(T *object)" --> <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="a00110.html">queueof</a>< T >::remove </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>Remove a specific typed object pointer for the queue. </p> <p>This can remove a member from any location in the queue, whether beginning, end, or somewhere in the middle. This releases the object. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">object</td><td>to remove. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>true if object was removed, false if not found. </dd></dl> <p>Definition at line <a class="el" href="a00180_source.html#l00619">619</a> of file <a class="el" href="a00180_source.html">containers.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>ucommon/<a class="el" href="a00180_source.html">containers.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a00110.html">queueof</a> </li> <li class="footer">Generated on Wed Apr 13 2011 22:39:48 for ucommon by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>