diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a03102.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a03102.html')
-rw-r--r-- | docs/doxygen/nel/a03102.html | 334 |
1 files changed, 334 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03102.html b/docs/doxygen/nel/a03102.html new file mode 100644 index 00000000..d115524e --- /dev/null +++ b/docs/doxygen/nel/a03102.html @@ -0,0 +1,334 @@ +<!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>NeL: TemplateNLMISC::CPoolMemory< T > class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CPoolMemory< T > Class Template Reference</h1><code>#include <<a class="el" href="a06192.html">pool_memory.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +<h3>template<class T><br> + class NLMISC::CPoolMemory< T ></h3> + +Pool memory allocation<p> +This memory manager allocates bloc of elements and free all the elements at the same time. Useful for temporary allocation.<p> +<dl compact><dt><b>Author:</b></dt><dd>Cyril 'Hulud' Corvazier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00049">49</a> of file <a class="el" href="a06192.html">pool_memory.h</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>T * </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemorya0">allocate</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemorya1">CPoolMemory</a> (<a class="el" href="a04558.html#a15">uint</a> blockSize=10)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemorya2">free</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemorya3">purge</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::list< std::vector< T > > </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::list< std::vector< T <br> +> >::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr2">_BlockSize</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CPoolMemorya1" doxytag="NLMISC::CPoolMemory::CPoolMemory" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::<a class="el" href="a03102.html">CPoolMemory</a> </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>blockSize</em> = 10 </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00057">57</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. +<p> +<div class="fragment"><pre>00058 { +00059 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr2">_BlockSize</a>=blockSize; +00060 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end(); +00061 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1CPoolMemorya0" doxytag="NLMISC::CPoolMemory::allocate" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> T* <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::allocate </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00068">68</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. +<p> +<div class="fragment"><pre>00069 { +00070 <span class="comment">// End of block ?</span> +00071 <span class="keywordflow">if</span> ( (<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>!=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end()) && (<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>->size()>=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr2">_BlockSize</a>) ) +00072 { +00073 <span class="comment">// Get next block</span> +00074 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>++; +00075 } +00076 +00077 <span class="comment">// Out of memory ?</span> +00078 <span class="keywordflow">if</span> (<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>==<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end()) +00079 { +00080 <span class="comment">// Add a block</span> +00081 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.resize (<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.size()+1); +00082 +00083 <span class="comment">// Pointer on the new block</span> +00084 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end (); +00085 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>--; +00086 +00087 <span class="comment">// Reserve it</span> +00088 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>->reserve (_BlockSize); +00089 } +00090 +00091 <span class="comment">// Allocate</span> +00092 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>->resize (<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>->size()+1); +00093 +00094 <span class="comment">// Return the pointer</span> +00095 <span class="keywordflow">return</span> &*((<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>->end ()-1)); +00096 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CPoolMemorya2" doxytag="NLMISC::CPoolMemory::free" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> void <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::free </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00101">101</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. +<p> +<div class="fragment"><pre>00102 { +00103 <span class="keyword">typename</span> std::list< std::vector<T> >::iterator ite=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.begin(); +00104 <span class="keywordflow">while</span> (ite!=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end()) +00105 { +00106 <span class="comment">// Clear the block</span> +00107 ite->clear (); +00108 +00109 <span class="comment">// Check size in not zero</span> +00110 <a class="code" href="a04199.html#a6">nlassert</a> (ite->capacity ()>0); +00111 +00112 ite++; +00113 } +00114 <span class="comment">// Pointer at the begining</span> +00115 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.begin(); +00116 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CPoolMemorya3" doxytag="NLMISC::CPoolMemory::purge" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> void <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::purge </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00121">121</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. +<p> +<div class="fragment"><pre>00122 { +00123 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.clear(); +00124 <a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a>=<a class="code" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a>.end(); +00125 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CPoolMemoryr0" doxytag="NLMISC::CPoolMemory::_BlockList" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> std::list< std::vector<T> > <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::<a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr0">_BlockList</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00129">129</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CPoolMemoryr1" doxytag="NLMISC::CPoolMemory::_BlockPointer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> std::list< std::vector<T> >::iterator <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::<a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr1">_BlockPointer</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00130">130</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CPoolMemoryr2" doxytag="NLMISC::CPoolMemory::_BlockSize" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" colspan="4"> +template<class T> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a03102.html">NLMISC::CPoolMemory</a>< T >::<a class="el" href="a03102.html#NLMISC_1_1CPoolMemoryr2">_BlockSize</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06192.html#l00128">128</a> of file <a class="el" href="a06192.html">pool_memory.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="a06192.html">pool_memory.h</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:28:21 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |