<!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: keypager< T, M > 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('a00059.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>keypager< T, M > Class Template Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="keypager" --><!-- doxytag: inherits="mempager" --> <p>A template class for a hash pager. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="a00189_source.html">memory.h</a>></code></p> <div class="dynheader"> Inheritance diagram for keypager< T, M >:</div> <div class="dyncontent"> <div class="center"><img src="a00333.png" border="0" usemap="#keypager_3_01_t_00_01_m_01_4_inherit__map" alt="Inheritance graph"/></div> <map name="keypager_3_01_t_00_01_m_01_4_inherit__map" id="keypager_3_01_t_00_01_m_01_4_inherit__map"> <area shape="rect" id="node2" href="a00079.html" title="A managed private heap for small allocations." alt="" coords="45,155,147,181"/><area shape="rect" id="node4" href="a00077.html" title="A memory protocol pager for private heap manager." alt="" coords="45,80,147,107"/><area shape="rect" id="node6" href="a00071.html" title="Common locking protocol." alt="" coords="11,5,181,32"/></map> <center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div> <div class="dynheader"> Collaboration diagram for keypager< T, M >:</div> <div class="dyncontent"> <div class="center"><img src="a00334.png" border="0" usemap="#keypager_3_01_t_00_01_m_01_4_coll__map" alt="Collaboration graph"/></div> <map name="keypager_3_01_t_00_01_m_01_4_coll__map" id="keypager_3_01_t_00_01_m_01_4_coll__map"> <area shape="rect" id="node2" href="a00079.html" title="A managed private heap for small allocations." alt="" coords="55,253,156,280"/><area shape="rect" id="node4" href="a00077.html" title="A memory protocol pager for private heap manager." alt="" coords="47,176,148,203"/><area shape="rect" id="node6" href="a00071.html" title="Common locking protocol." alt="" coords="5,91,176,117"/><area shape="rect" id="node8" href="a00088.html" title="A linked object base class with members found by name." alt="" coords="181,253,312,280"/><area shape="rect" id="node10" href="a00099.html" title="A linked object base class for ordered objects." alt="" coords="176,176,328,203"/><area shape="rect" id="node12" href="a00065.html" title="Common base class for all objects that can be formed into a linked list." alt="" coords="200,91,341,117"/><area shape="rect" id="node14" href="a00091.html" title="A common base class for all managed objects." alt="" coords="229,5,312,32"/></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="a00059.html#ae879356791b5f2ab90ac34abc03942ec">begin</a> (void) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Find first typed object in hash map to iterate. <a href="#ae879356791b5f2ab90ac34abc03942ec"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#aa67912cf7c56f04e08bc6553d7798172">count</a> (void) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Count the number of typed objects in our hash map. <a href="#aa67912cf7c56f04e08bc6553d7798172"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#a1fd6d5d94d38af7666c05191ddeb1c32">get</a> (const char *name) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Find a typed object derived from <a class="el" href="a00088.html" title="A linked object base class with members found by name.">NamedObject</a> in the hash map by name. <a href="#a1fd6d5d94d38af7666c05191ddeb1c32"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T ** </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#a2ad04feb35171c5349cc23ae1364ff6d">index</a> (void) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Convert our hash map into a linear object pointer array. <a href="#a2ad04feb35171c5349cc23ae1364ff6d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#ad14484e86b7207f59ffe312015e35ecd">keypager</a> (size_t size)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Create the object cache. <a href="#ad14484e86b7207f59ffe312015e35ecd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#a433da4455748c74827309e00dcd53b42">next</a> (T *current) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Find next typed object in hash map for iteration. <a href="#a433da4455748c74827309e00dcd53b42"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#afd031cb007e5838f7255753d8eedace7">operator[]</a> (const char *name) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Find a typed object derived from <a class="el" href="a00088.html" title="A linked object base class with members found by name.">NamedObject</a> in the hash map by name. <a href="#afd031cb007e5838f7255753d8eedace7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">T ** </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#ab04abc50df94392022a9bc77d352c418">sort</a> (void) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Convert our hash map into an alphabetically sorted linear object pointer array. <a href="#ab04abc50df94392022a9bc77d352c418"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#a25605e198a0131ae2190b0f39c48defd">test</a> (const char *name) const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Test if a name exists in the pool. <a href="#a25605e198a0131ae2190b0f39c48defd"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a132aab77e57568041adc9bacefc152d2"></a><!-- doxytag: member="keypager::~keypager" ref="a132aab77e57568041adc9bacefc152d2" args="()" -->  </td><td class="memItemRight" valign="bottom"><a class="el" href="a00059.html#a132aab77e57568041adc9bacefc152d2">~keypager</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy the hash pager by purging the index chains and memory pools. <br/></td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <div class="textblock"><h3>template<class T, unsigned M = 177><br/> class keypager< T, M ></h3> <p>A template class for a hash pager. </p> <p>This creates objects from a pager pool when they do not already exist in the hash map. </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="a00189_source.html#l00654">654</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="ad14484e86b7207f59ffe312015e35ecd"></a><!-- doxytag: member="keypager::keypager" ref="ad14484e86b7207f59ffe312015e35ecd" args="(size_t size)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname"><a class="el" href="a00059.html">keypager</a>< T, M >::<a class="el" href="a00059.html">keypager</a> </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Create the object cache. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">size</td><td>of allocation units. </td></tr> </table> </dd> </dl> <p>Definition at line <a class="el" href="a00189_source.html#l00664">664</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="ae879356791b5f2ab90ac34abc03942ec"></a><!-- doxytag: member="keypager::begin" ref="ae879356791b5f2ab90ac34abc03942ec" args="(void) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00059.html">keypager</a>< T, M >::begin </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Find first typed object in hash map to iterate. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>first typed object or NULL if nothing in list. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00708">708</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="a00059_ae879356791b5f2ab90ac34abc03942ec_cgraph.png" border="0" usemap="#a00059_ae879356791b5f2ab90ac34abc03942ec_cgraph" alt=""/></div> <map name="a00059_ae879356791b5f2ab90ac34abc03942ec_cgraph" id="a00059_ae879356791b5f2ab90ac34abc03942ec_cgraph"> <area shape="rect" id="node3" href="a00088.html#a89089e45e4a010050238d330f46d8ab2" title="Iterate through a hash map table." alt="" coords="227,5,419,32"/></map> </div> </p> </div> </div> <a class="anchor" id="aa67912cf7c56f04e08bc6553d7798172"></a><!-- doxytag: member="keypager::count" ref="aa67912cf7c56f04e08bc6553d7798172" args="(void) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">unsigned <a class="el" href="a00059.html">keypager</a>< T, M >::count </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Count the number of typed objects in our hash map. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>count of typed objects. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00723">723</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> </div> </div> <a class="anchor" id="a1fd6d5d94d38af7666c05191ddeb1c32"></a><!-- doxytag: member="keypager::get" ref="a1fd6d5d94d38af7666c05191ddeb1c32" args="(const char *name) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00059.html">keypager</a>< T, M >::get </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>name</em></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Find a typed object derived from <a class="el" href="a00088.html" title="A linked object base class with members found by name.">NamedObject</a> in the hash map by name. </p> <p>If the object is not found, it is created from the memory pool. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>to search for. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object if found through map or NULL. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00678">678</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="a00059_a1fd6d5d94d38af7666c05191ddeb1c32_cgraph.png" border="0" usemap="#a00059_a1fd6d5d94d38af7666c05191ddeb1c32_cgraph" alt=""/></div> <map name="a00059_a1fd6d5d94d38af7666c05191ddeb1c32_cgraph" id="a00059_a1fd6d5d94d38af7666c05191ddeb1c32_cgraph"> <area shape="rect" id="node3" href="a00079.html#aa89e00c3e418957c0efd85022ac5e318" title="Allocate memory from the pager heap." alt="" coords="207,5,388,32"/><area shape="rect" id="node5" href="a00088.html#a43a968cead56c2d456bf61caef8b9294" title="Find a named object through a hash map table." alt="" coords="207,56,388,83"/></map> </div> </p> </div> </div> <a class="anchor" id="a2ad04feb35171c5349cc23ae1364ff6d"></a><!-- doxytag: member="keypager::index" ref="a2ad04feb35171c5349cc23ae1364ff6d" args="(void) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T** <a class="el" href="a00059.html">keypager</a>< T, M >::index </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Convert our hash map into a linear object pointer array. </p> <p>The object pointer array is created from the heap and must be deleted when no longer used. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>array of typed named object pointers. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00732">732</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> </div> </div> <a class="anchor" id="a433da4455748c74827309e00dcd53b42"></a><!-- doxytag: member="keypager::next" ref="a433da4455748c74827309e00dcd53b42" args="(T *current) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00059.html">keypager</a>< T, M >::next </td> <td>(</td> <td class="paramtype">T * </td> <td class="paramname"><em>current</em></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Find next typed object in hash map for iteration. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">current</td><td>typed object we are referencing. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>next iterative object or NULL if past end of map. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00716">716</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="a00059_a433da4455748c74827309e00dcd53b42_cgraph.png" border="0" usemap="#a00059_a433da4455748c74827309e00dcd53b42_cgraph" alt=""/></div> <map name="a00059_a433da4455748c74827309e00dcd53b42_cgraph" id="a00059_a433da4455748c74827309e00dcd53b42_cgraph"> <area shape="rect" id="node3" href="a00088.html#a89089e45e4a010050238d330f46d8ab2" title="Iterate through a hash map table." alt="" coords="216,5,408,32"/></map> </div> </p> </div> </div> <a class="anchor" id="afd031cb007e5838f7255753d8eedace7"></a><!-- doxytag: member="keypager::operator[]" ref="afd031cb007e5838f7255753d8eedace7" args="(const char *name) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T* <a class="el" href="a00059.html">keypager</a>< T, M >::operator[] </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>name</em></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Find a typed object derived from <a class="el" href="a00088.html" title="A linked object base class with members found by name.">NamedObject</a> in the hash map by name. </p> <p>If the object is not found, it is created from the pager pool. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>to search for. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>typed object if found through map or NULL. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00701">701</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> </div> </div> <a class="anchor" id="ab04abc50df94392022a9bc77d352c418"></a><!-- doxytag: member="keypager::sort" ref="ab04abc50df94392022a9bc77d352c418" args="(void) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">T** <a class="el" href="a00059.html">keypager</a>< T, M >::sort </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Convert our hash map into an alphabetically sorted linear object pointer array. </p> <p>The object pointer array is created from the heap and must be deleted when no longer used. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>sorted array of typed named object pointers. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00741">741</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="a00059_ab04abc50df94392022a9bc77d352c418_cgraph.png" border="0" usemap="#a00059_ab04abc50df94392022a9bc77d352c418_cgraph" alt=""/></div> <map name="a00059_ab04abc50df94392022a9bc77d352c418_cgraph" id="a00059_ab04abc50df94392022a9bc77d352c418_cgraph"> <area shape="rect" id="node3" href="a00088.html#ac4813f0fef5c120b9cfcae00bbe00e43" title="Convert a hash index into a linear object pointer array." alt="" coords="216,5,419,32"/></map> </div> </p> </div> </div> <a class="anchor" id="a25605e198a0131ae2190b0f39c48defd"></a><!-- doxytag: member="keypager::test" ref="a25605e198a0131ae2190b0f39c48defd" args="(const char *name) const " --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class T , unsigned M = 177> </div> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="a00059.html">keypager</a>< T, M >::test </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>name</em></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Test if a name exists in the pool. </p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>to test. </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>true if found. </dd></dl> <p>Definition at line <a class="el" href="a00189_source.html#l00692">692</a> of file <a class="el" href="a00189_source.html">memory.h</a>.</p> <p><div class="dynheader"> Here is the call graph for this function:</div> <div class="dyncontent"> <div class="center"><img src="a00059_a25605e198a0131ae2190b0f39c48defd_cgraph.png" border="0" usemap="#a00059_a25605e198a0131ae2190b0f39c48defd_cgraph" alt=""/></div> <map name="a00059_a25605e198a0131ae2190b0f39c48defd_cgraph" id="a00059_a25605e198a0131ae2190b0f39c48defd_cgraph"> <area shape="rect" id="node3" href="a00088.html#a43a968cead56c2d456bf61caef8b9294" title="Find a named object through a hash map table." alt="" coords="217,5,399,32"/></map> </div> </p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li>ucommon/<a class="el" href="a00189_source.html">memory.h</a></li> </ul> </div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="a00059.html">keypager</a> </li> <li class="footer">Generated on Wed Apr 13 2011 22:39:47 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>