/usr/share/doc/libucommon-dev/a00212_source.html is in libucommon-doc 3.2.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | <!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/vector.h Source File</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><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><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="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<h1>ucommon/vector.h</h1><a href="a00212.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2006-2010 David Sugar, Tycho Softworks.</span>
<a name="l00002"></a>00002 <span class="comment">//</span>
<a name="l00003"></a>00003 <span class="comment">// This file is part of GNU uCommon C++.</span>
<a name="l00004"></a>00004 <span class="comment">//</span>
<a name="l00005"></a>00005 <span class="comment">// GNU uCommon C++ is free software: you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment">// it under the terms of the GNU Lesser General Public License as published </span>
<a name="l00007"></a>00007 <span class="comment">// by the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment">//</span>
<a name="l00010"></a>00010 <span class="comment">// GNU uCommon C++ is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00013"></a>00013 <span class="comment">// GNU Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// You should have received a copy of the GNU Lesser General Public License</span>
<a name="l00016"></a>00016 <span class="comment">// along with GNU uCommon C++. If not, see <http://www.gnu.org/licenses/>.</span>
<a name="l00017"></a>00017
<a name="l00027"></a>00027 <span class="preprocessor">#ifndef _UCOMMON_VECTOR_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#define _UCOMMON_VECTOR_H_</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef _UCOMMON_THREAD_H_</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#include <<a class="code" href="a00208.html" title="Thread classes and sychronization objects.">ucommon/thread.h</a>></span>
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> vectorsize_t;
<a name="l00035"></a>00035
<a name="l00036"></a>00036 NAMESPACE_UCOMMON
<a name="l00037"></a>00037
<a name="l00045"></a><a class="code" href="a00018.html">00045</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00018.html" title="An array of reusable objects.">ArrayReuse</a> : <span class="keyword">public</span> <a class="code" href="a00112.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a>
<a name="l00046"></a>00046 {
<a name="l00047"></a>00047 <span class="keyword">private</span>:
<a name="l00048"></a>00048 <span class="keywordtype">size_t</span> objsize;
<a name="l00049"></a>00049 <span class="keywordtype">unsigned</span> count, limit, used;
<a name="l00050"></a>00050 caddr_t mem;
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keyword">protected</span>:
<a name="l00053"></a>00053 <a class="code" href="a00018.html" title="An array of reusable objects.">ArrayReuse</a>(<span class="keywordtype">size_t</span> objsize, <span class="keywordtype">unsigned</span> c);
<a name="l00054"></a>00054
<a name="l00055"></a>00055 <span class="keyword">public</span>:
<a name="l00059"></a>00059 ~<a class="code" href="a00018.html" title="An array of reusable objects.">ArrayReuse</a>();
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="keyword">protected</span>:
<a name="l00062"></a>00062 <span class="keywordtype">bool</span> avail(<span class="keywordtype">void</span>);
<a name="l00063"></a>00063
<a name="l00064"></a>00064 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keyword">get</span>(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00065"></a>00065 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keyword">get</span>(void);
<a name="l00066"></a>00066 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *request(<span class="keywordtype">void</span>);
<a name="l00067"></a>00067 };
<a name="l00068"></a>00068
<a name="l00076"></a><a class="code" href="a00105.html">00076</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00105.html" title="A mempager source of reusable objects.">PagerReuse</a> : <span class="keyword">protected</span> <a class="code" href="a00112.html" title="Class for resource bound memory pools between threads.">ReusableAllocator</a>
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078 <span class="keyword">private</span>:
<a name="l00079"></a>00079 <a class="code" href="a00081.html" title="A managed private heap for small allocations.">mempager</a> *<a class="code" href="a00102.html" title="Mempager managed type factory for pager pool objects.">pager</a>;
<a name="l00080"></a>00080 <span class="keywordtype">unsigned</span> limit, count;
<a name="l00081"></a>00081 <span class="keywordtype">size_t</span> osize;
<a name="l00082"></a>00082
<a name="l00083"></a>00083 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *alloc(<span class="keywordtype">void</span>);
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="keyword">protected</span>:
<a name="l00086"></a>00086 <a class="code" href="a00105.html" title="A mempager source of reusable objects.">PagerReuse</a>(<a class="code" href="a00081.html" title="A managed private heap for small allocations.">mempager</a> *<a class="code" href="a00102.html" title="Mempager managed type factory for pager pool objects.">pager</a>, <span class="keywordtype">size_t</span> objsize, <span class="keywordtype">unsigned</span> count);
<a name="l00087"></a>00087 ~<a class="code" href="a00105.html" title="A mempager source of reusable objects.">PagerReuse</a>();
<a name="l00088"></a>00088
<a name="l00089"></a>00089 <span class="keywordtype">bool</span> avail(<span class="keywordtype">void</span>);
<a name="l00090"></a>00090 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keyword">get</span>(void);
<a name="l00091"></a>00091 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *<span class="keyword">get</span>(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout);
<a name="l00092"></a>00092 <a class="code" href="a00113.html" title="Reusable objects for forming private heaps.">ReusableObject</a> *request(<span class="keywordtype">void</span>);
<a name="l00093"></a>00093 };
<a name="l00094"></a>00094
<a name="l00110"></a><a class="code" href="a00180.html">00110</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>
<a name="l00111"></a>00111 {
<a name="l00112"></a>00112 <span class="keyword">public</span>:
<a name="l00113"></a>00113 <span class="keyword">class </span>__EXPORT array : <span class="keyword">public</span> <a class="code" href="a00043.html" title="A base class for reference counted objects.">CountedObject</a>
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115 <span class="keyword">public</span>:
<a name="l00116"></a>00116 <span class="preprocessor">#pragma pack(1)</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span> vectorsize_t <a class="code" href="a00214.html#a8049d3aa4d2ad2df40e33d0104fe0c05" title="Template for max value of a type.">max</a>, len;
<a name="l00118"></a>00118 <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *list[1];
<a name="l00119"></a>00119 <span class="preprocessor">#pragma pack()</span>
<a name="l00120"></a>00120 <span class="preprocessor"></span>
<a name="l00121"></a>00121 array(vectorsize_t size);
<a name="l00122"></a>00122 <span class="keywordtype">void</span> dealloc(<span class="keywordtype">void</span>);
<a name="l00123"></a>00123 <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **items);
<a name="l00124"></a>00124 <span class="keywordtype">void</span> <a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **list);
<a name="l00125"></a>00125 <span class="keywordtype">void</span> <a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *obj);
<a name="l00126"></a>00126 <span class="keywordtype">void</span> purge(<span class="keywordtype">void</span>);
<a name="l00127"></a>00127 <span class="keywordtype">void</span> inc(vectorsize_t adj);
<a name="l00128"></a>00128 <span class="keywordtype">void</span> dec(vectorsize_t adj);
<a name="l00129"></a>00129 };
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="keyword">protected</span>:
<a name="l00132"></a>00132 array *data;
<a name="l00133"></a>00133
<a name="l00134"></a>00134 array *create(vectorsize_t size) <span class="keyword">const</span>;
<a name="l00135"></a>00135
<a name="l00136"></a>00136 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="a00043.html#a682422b0a164087fb29452d1e5011438" title="Decrease reference count when released.">release</a>(<span class="keywordtype">void</span>);
<a name="l00137"></a>00137 <span class="keyword">virtual</span> <span class="keywordtype">void</span> cow(vectorsize_t adj = 0);
<a name="l00138"></a>00138 <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **list(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00139"></a>00139
<a name="l00140"></a>00140 <span class="keyword">friend</span> <span class="keyword">class </span>Vector::array;
<a name="l00141"></a>00141
<a name="l00142"></a>00142 <span class="keyword">public</span>:
<a name="l00146"></a><a class="code" href="a00180.html#a2c1a222b29257d1ac35d0c9af4ac56d2">00146</a> <span class="keyword">static</span> <span class="keyword">const</span> vectorsize_t npos;
<a name="l00147"></a>00147
<a name="l00151"></a>00151 <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>();
<a name="l00152"></a>00152
<a name="l00157"></a>00157 <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>(vectorsize_t size);
<a name="l00158"></a>00158
<a name="l00168"></a>00168 <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **items, vectorsize_t size = 0);
<a name="l00169"></a>00169
<a name="l00173"></a>00173 <span class="keyword">virtual</span> ~<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>();
<a name="l00174"></a>00174
<a name="l00179"></a>00179 vectorsize_t len(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00180"></a>00180
<a name="l00186"></a>00186 vectorsize_t size(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00187"></a>00187
<a name="l00193"></a>00193 <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<span class="keyword">get</span>(<span class="keywordtype">int</span> index) <span class="keyword">const</span>;
<a name="l00194"></a>00194
<a name="l00201"></a>00201 vectorsize_t <span class="keyword">get</span>(<span class="keywordtype">void</span> **mem, vectorsize_t <a class="code" href="a00214.html#a8049d3aa4d2ad2df40e33d0104fe0c05" title="Template for max value of a type.">max</a>) <span class="keyword">const</span>;
<a name="l00202"></a>00202
<a name="l00208"></a>00208 <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *begin(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00209"></a>00209
<a name="l00215"></a>00215 <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *end(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00216"></a>00216
<a name="l00223"></a>00223 vectorsize_t find(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>, vectorsize_t offset = 0) <span class="keyword">const</span>;
<a name="l00224"></a>00224
<a name="l00230"></a>00230 <span class="keywordtype">void</span> split(vectorsize_t position);
<a name="l00231"></a>00231
<a name="l00238"></a>00238 <span class="keywordtype">void</span> rsplit(vectorsize_t position);
<a name="l00239"></a>00239
<a name="l00246"></a>00246 <span class="keywordtype">void</span> <span class="keyword">set</span>(vectorsize_t position, <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>);
<a name="l00247"></a>00247
<a name="l00252"></a>00252 <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **list);
<a name="l00253"></a>00253
<a name="l00258"></a>00258 <span class="keywordtype">void</span> <a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> **list);
<a name="l00259"></a>00259
<a name="l00264"></a>00264 <span class="keywordtype">void</span> <a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>);
<a name="l00265"></a>00265
<a name="l00269"></a>00269 <span class="keywordtype">void</span> clear(<span class="keywordtype">void</span>);
<a name="l00270"></a>00270
<a name="l00275"></a>00275 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> resize(vectorsize_t size);
<a name="l00276"></a>00276
<a name="l00281"></a><a class="code" href="a00180.html#aa69a732eb7d6216bf3c96d6988011c4e">00281</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00282"></a>00282 {<span class="keyword">set</span>(vector.list());};
<a name="l00283"></a>00283
<a name="l00288"></a><a class="code" href="a00180.html#a3b8476cea9e2072faecaef0750146115">00288</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00289"></a>00289 {<a class="code" href="a00180.html#a3b8476cea9e2072faecaef0750146115" title="Add (append) an existing vector to our vector.">add</a>(vector.list());};
<a name="l00290"></a>00290
<a name="l00295"></a><a class="code" href="a00180.html#ac839eee9b8dedabe55e9e8859a00a4b8">00295</a> <span class="keyword">inline</span> <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *operator[](<span class="keywordtype">int</span> index)
<a name="l00296"></a>00296 {<span class="keywordflow">return</span> <span class="keyword">get</span>(index);};
<a name="l00297"></a>00297
<a name="l00303"></a><a class="code" href="a00180.html#a5756bd761d82afaeda992c24979d7e2f">00303</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> operator()(vectorsize_t position, <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>)
<a name="l00304"></a>00304 {<span class="keyword">set</span>(position, pointer);};
<a name="l00305"></a>00305
<a name="l00311"></a><a class="code" href="a00180.html#a95a71eb568ab5beb8902474256fea6b7">00311</a> <span class="keyword">inline</span> <a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *operator()(vectorsize_t position)
<a name="l00312"></a>00312 {<span class="keywordflow">return</span> <span class="keyword">get</span>(position);};
<a name="l00313"></a>00313
<a name="l00318"></a><a class="code" href="a00180.html#af95e47bb3d000b6f9dff4c5ecf725b4b">00318</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> operator()(<a class="code" href="a00093.html" title="A common base class for all managed objects.">Object</a> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>)
<a name="l00319"></a>00319 {<a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(pointer);};
<a name="l00320"></a>00320
<a name="l00325"></a><a class="code" href="a00180.html#ab7f3327441266a5b9e555ffa40909520">00325</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> operator=(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00326"></a>00326 {<span class="keyword">set</span>(vector.list());};
<a name="l00327"></a>00327
<a name="l00332"></a><a class="code" href="a00180.html#a4849f74444aec47e73204b8f5d4419ae">00332</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> operator+=(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00333"></a>00333 {<a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(vector.list());};
<a name="l00334"></a>00334
<a name="l00339"></a><a class="code" href="a00180.html#a7a28890aafa2c87e353711b5c18a04d6">00339</a> <span class="keyword">inline</span> <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>& operator+(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00340"></a>00340 {<a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">add</a>(vector.list()); <span class="keywordflow">return</span> *<span class="keyword">this</span>;};
<a name="l00341"></a>00341
<a name="l00346"></a>00346 <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &operator^(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector);
<a name="l00347"></a>00347
<a name="l00354"></a>00354 <span class="keywordtype">void</span> operator^=(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector);
<a name="l00355"></a>00355
<a name="l00359"></a>00359 <span class="keywordtype">void</span> <a class="code" href="a00093.html#a68315d647b20f213075fe85566664d60" title="Increase retention operator.">operator++</a>();
<a name="l00360"></a>00360
<a name="l00364"></a>00364 <span class="keywordtype">void</span> <a class="code" href="a00093.html#a1aee78510382e5609068a083f6c00fa0" title="Decrease retention operator.">operator--</a>();
<a name="l00365"></a>00365
<a name="l00370"></a>00370 <span class="keywordtype">void</span> operator+=(vectorsize_t count);
<a name="l00371"></a>00371
<a name="l00376"></a>00376 <span class="keywordtype">void</span> operator-=(vectorsize_t count);
<a name="l00377"></a>00377
<a name="l00383"></a>00383 <span class="keyword">static</span> vectorsize_t size(<span class="keywordtype">void</span> **list);
<a name="l00384"></a>00384 };
<a name="l00385"></a>00385
<a name="l00391"></a><a class="code" href="a00083.html">00391</a> <span class="keyword">class </span>__EXPORT <a class="code" href="a00083.html" title="Vector with fixed size member list.">MemVector</a> : <span class="keyword">public</span> <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>
<a name="l00392"></a>00392 {
<a name="l00393"></a>00393 <span class="keyword">private</span>:
<a name="l00394"></a>00394 <span class="keywordtype">bool</span> <a class="code" href="a00180.html#ae096ef0de9663992bf6ba839a734c8e1" title="Re-size &amp; re-allocate the total (allocated) size of the vector.">resize</a>(vectorsize_t size);
<a name="l00395"></a>00395 <span class="keywordtype">void</span> cow(vectorsize_t adj = 0);
<a name="l00396"></a>00396 <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(<span class="keywordtype">void</span>);
<a name="l00397"></a>00397
<a name="l00398"></a>00398 <span class="keyword">friend</span> <span class="keyword">class </span>Vector::array;
<a name="l00399"></a>00399
<a name="l00400"></a>00400 <span class="keyword">public</span>:
<a name="l00406"></a>00406 <a class="code" href="a00083.html" title="Vector with fixed size member list.">MemVector</a>(<span class="keywordtype">void</span> *<a class="code" href="a00015.html" title="Typed smart pointer class.">pointer</a>, vectorsize_t size);
<a name="l00407"></a>00407
<a name="l00411"></a>00411 ~<a class="code" href="a00083.html" title="Vector with fixed size member list.">MemVector</a>();
<a name="l00412"></a>00412
<a name="l00417"></a><a class="code" href="a00083.html#a8a568f9fc88cc9ca8f7550f918fe693a">00417</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00180.html#ab7f3327441266a5b9e555ffa40909520" title="Assign (copy) into our existing vector from another vector.">operator=</a>(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00418"></a>00418 {<span class="keyword">set</span>(vector);};
<a name="l00419"></a>00419
<a name="l00420"></a>00420 };
<a name="l00421"></a>00421
<a name="l00427"></a>00427 <span class="keyword">template</span><<span class="keyword">class</span> T>
<a name="l00428"></a><a class="code" href="a00182.html">00428</a> <span class="keyword">class </span><a class="code" href="a00182.html" title="A templated vector for a list of a specific Object subtype.">vectorof</a> : <span class="keyword">public</span> <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>
<a name="l00429"></a>00429 {
<a name="l00430"></a>00430 <span class="keyword">public</span>:
<a name="l00434"></a><a class="code" href="a00182.html#ad9cefec93780eb1ada58d158878d4501">00434</a> <span class="keyword">inline</span> <a class="code" href="a00182.html#ad9cefec93780eb1ada58d158878d4501" title="Create an empty vector for specified type.">vectorof</a>() : <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>() {};
<a name="l00435"></a>00435
<a name="l00440"></a><a class="code" href="a00182.html#abad5abcd1e1f600bef1dce68a18bafae">00440</a> <span class="keyword">inline</span> <a class="code" href="a00182.html#abad5abcd1e1f600bef1dce68a18bafae" title="Create an empty vector of allocated size for specified type.">vectorof</a>(vectorsize_t size) : <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a>(size) {};
<a name="l00441"></a>00441
<a name="l00447"></a><a class="code" href="a00182.html#a225b67522dc3f0913b631621bb446be1">00447</a> <span class="keyword">inline</span> T *<span class="keyword">get</span>(<span class="keywordtype">int</span> index)
<a name="l00448"></a>00448 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::get(index));};
<a name="l00449"></a>00449
<a name="l00455"></a><a class="code" href="a00182.html#a21e4c6e4be51e7c38e2c2128137afd3d">00455</a> <span class="keyword">inline</span> T *operator()(vectorsize_t position)
<a name="l00456"></a>00456 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::get(position));};
<a name="l00457"></a>00457
<a name="l00462"></a><a class="code" href="a00182.html#ac3e88b83634ea3f66b7993dbfed53a25">00462</a> <span class="keyword">inline</span> T *begin(<span class="keywordtype">void</span>)
<a name="l00463"></a>00463 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::begin());};
<a name="l00464"></a>00464
<a name="l00469"></a><a class="code" href="a00182.html#a573a5c5a18aa04b90100d5444e7c91cf">00469</a> <span class="keyword">inline</span> T *end(<span class="keywordtype">void</span>)
<a name="l00470"></a>00470 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::end());};
<a name="l00471"></a>00471
<a name="l00477"></a><a class="code" href="a00182.html#aceed9ef7dc83e1654b2bd068e9059f36">00477</a> <span class="keyword">inline</span> <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &operator+(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00478"></a>00478 {<a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">Vector::add</a>(vector); <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &<span class="keyword">></span>(*this);};
<a name="l00479"></a>00479 };
<a name="l00480"></a>00480
<a name="l00487"></a>00487 <span class="keyword">template</span><<span class="keyword">class</span> T>
<a name="l00488"></a><a class="code" href="a00017.html">00488</a> <span class="keyword">class </span><a class="code" href="a00017.html" title="An array of reusable types.">array_reuse</a> : <span class="keyword">protected</span> <a class="code" href="a00018.html" title="An array of reusable objects.">ArrayReuse</a>
<a name="l00489"></a>00489 {
<a name="l00490"></a>00490 <span class="keyword">public</span>:
<a name="l00495"></a><a class="code" href="a00017.html#ac22721ea55ee4d897e7a630e6f769645">00495</a> <span class="keyword">inline</span> <a class="code" href="a00017.html" title="An array of reusable types.">array_reuse</a>(<span class="keywordtype">unsigned</span> count) :
<a name="l00496"></a>00496 <a class="code" href="a00018.html" title="An array of reusable objects.">ArrayReuse</a>(sizeof(T), count) {};
<a name="l00497"></a>00497
<a name="l00502"></a><a class="code" href="a00017.html#a9f792af2324cea4268bfb0f6ac370355">00502</a> <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l00503"></a>00503 <span class="keyword"> </span>{<span class="keywordflow">return</span> avail();};
<a name="l00504"></a>00504
<a name="l00509"></a><a class="code" href="a00017.html#a13b36984d0fda71a1f7e069eb97858c9">00509</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l00510"></a>00510 <span class="keyword"> </span>{<span class="keywordflow">return</span> !avail();};
<a name="l00511"></a>00511
<a name="l00516"></a><a class="code" href="a00017.html#a5eb7ae11759b680f97761f76d9b22ecc">00516</a> <span class="keyword">inline</span> T* request(<span class="keywordtype">void</span>)
<a name="l00517"></a>00517 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(ArrayReuse::request());};
<a name="l00518"></a>00518
<a name="l00524"></a><a class="code" href="a00017.html#a980637ca60253c4feb89462a1341aa5f">00524</a> <span class="keyword">inline</span> T* <span class="keyword">get</span>(void)
<a name="l00525"></a>00525 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(ArrayReuse::get());};
<a name="l00526"></a>00526
<a name="l00532"></a><a class="code" href="a00017.html#a9e1b5e709e14b7c74fc499f5bfcd7519">00532</a> <span class="keyword">inline</span> T* create(<span class="keywordtype">void</span>)
<a name="l00533"></a>00533 {<span class="keywordflow">return</span> init<T>(<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(ArrayReuse::get()));};
<a name="l00534"></a>00534
<a name="l00541"></a><a class="code" href="a00017.html#a721d8671cc107f360b9b7c01d1f2b591">00541</a> <span class="keyword">inline</span> T* <span class="keyword">get</span>(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00542"></a>00542 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(ArrayReuse::get(timeout));};
<a name="l00543"></a>00543
<a name="l00550"></a><a class="code" href="a00017.html#ae7cb219e8433f945c4f5d82af0223368">00550</a> <span class="keyword">inline</span> T* create(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00551"></a>00551 {<span class="keywordflow">return</span> init<T>(<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(ArrayReuse::get(timeout)));};
<a name="l00552"></a>00552
<a name="l00557"></a><a class="code" href="a00017.html#aa8e0155040d8e2c7ef7bc656a44e251b">00557</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(T *<span class="keywordtype">object</span>)
<a name="l00558"></a>00558 {<a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">ArrayReuse::release</a>(<span class="keywordtype">object</span>);};
<a name="l00559"></a>00559
<a name="l00565"></a><a class="code" href="a00017.html#a95ffb23915b0e51340041d4a0ad0927e">00565</a> <span class="keyword">inline</span> operator T*()
<a name="l00566"></a>00566 {<span class="keywordflow">return</span> array_reuse::get();};
<a name="l00567"></a>00567
<a name="l00573"></a><a class="code" href="a00017.html#a3b3273c985c6f32b6cf79c867a4b8baf">00573</a> <span class="keyword">inline</span> T *operator*()
<a name="l00574"></a>00574 {<span class="keywordflow">return</span> array_reuse::get();};
<a name="l00575"></a>00575 };
<a name="l00576"></a>00576
<a name="l00583"></a>00583 <span class="keyword">template</span> <<span class="keyword">class</span> T>
<a name="l00584"></a><a class="code" href="a00101.html">00584</a> <span class="keyword">class </span><a class="code" href="a00101.html" title="A reusable private pool of reusable types.">paged_reuse</a> : <span class="keyword">protected</span> <a class="code" href="a00105.html" title="A mempager source of reusable objects.">PagerReuse</a>
<a name="l00585"></a>00585 {
<a name="l00586"></a>00586 <span class="keyword">public</span>:
<a name="l00594"></a><a class="code" href="a00101.html#aef18e61da0380e4a54a8e12ffbc3af34">00594</a> <span class="keyword">inline</span> <a class="code" href="a00101.html" title="A reusable private pool of reusable types.">paged_reuse</a>(<a class="code" href="a00081.html" title="A managed private heap for small allocations.">mempager</a> *<a class="code" href="a00102.html" title="Mempager managed type factory for pager pool objects.">pager</a>, <span class="keywordtype">unsigned</span> count) :
<a name="l00595"></a>00595 <a class="code" href="a00105.html" title="A mempager source of reusable objects.">PagerReuse</a>(pager, sizeof(T), count) {};
<a name="l00596"></a>00596
<a name="l00601"></a><a class="code" href="a00101.html#afb22df53c7a001e2899c7584b0e00688">00601</a> <span class="keyword">inline</span> operator bool()<span class="keyword"> const</span>
<a name="l00602"></a>00602 <span class="keyword"> </span>{<span class="keywordflow">return</span> PagerReuse::avail();};
<a name="l00603"></a>00603
<a name="l00608"></a><a class="code" href="a00101.html#a039d062570c785151aafe3da2fdd8038">00608</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> operator!()<span class="keyword"> const</span>
<a name="l00609"></a>00609 <span class="keyword"> </span>{<span class="keywordflow">return</span> !PagerReuse::avail();};
<a name="l00610"></a>00610
<a name="l00616"></a><a class="code" href="a00101.html#a47c4490204438c70cd3241bc09d696f5">00616</a> <span class="keyword">inline</span> T *<span class="keyword">get</span>(void)
<a name="l00617"></a>00617 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(PagerReuse::get());};
<a name="l00618"></a>00618
<a name="l00625"></a><a class="code" href="a00101.html#ab64f325200c12612a6196b813ffd29bc">00625</a> <span class="keyword">inline</span> T *create(<span class="keywordtype">void</span>)
<a name="l00626"></a>00626 {<span class="keywordflow">return</span> init<T>(<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(PagerReuse::get()));};
<a name="l00627"></a>00627
<a name="l00634"></a><a class="code" href="a00101.html#a4cb4e4556e03ddd02a966edfe4dd2cbb">00634</a> <span class="keyword">inline</span> T *<span class="keyword">get</span>(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00635"></a>00635 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(PagerReuse::get(timeout));};
<a name="l00636"></a>00636
<a name="l00644"></a><a class="code" href="a00101.html#ad2d826cbfa6934ebddca1d4d45cf7f9a">00644</a> <span class="keyword">inline</span> T *create(<a class="code" href="a00201.html#af412159e5cef839836a5e7b19ee75d1c" title="Typedef for millisecond timer values.">timeout_t</a> timeout)
<a name="l00645"></a>00645 {<span class="keywordflow">return</span> init<T>(<span class="keyword">static_cast<</span>T*<span class="keyword">></span>(PagerReuse::get(timeout)));};
<a name="l00646"></a>00646
<a name="l00651"></a><a class="code" href="a00101.html#a440c28fa2b67850b6812affa8a10a3e2">00651</a> <span class="keyword">inline</span> T *request(<span class="keywordtype">void</span>)
<a name="l00652"></a>00652 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T*<span class="keyword">></span>(PagerReuse::request());};
<a name="l00653"></a>00653
<a name="l00658"></a><a class="code" href="a00101.html#a01788ff6230ac7e1fae016db0bb5edf5">00658</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">release</a>(T *<span class="keywordtype">object</span>)
<a name="l00659"></a>00659 {<a class="code" href="a00214.html#ab7bef2898e731474a9c3dfa805a6f56d" title="Convenience function to unlock shared object through it&#39;s protocol.">PagerReuse::release</a>(<span class="keywordtype">object</span>);};
<a name="l00660"></a>00660
<a name="l00666"></a><a class="code" href="a00101.html#a8f8a7456d526503f129c221eb84ba9e1">00666</a> <span class="keyword">inline</span> T *operator*()
<a name="l00667"></a>00667 {<span class="keywordflow">return</span> paged_reuse::get();};
<a name="l00668"></a>00668
<a name="l00674"></a><a class="code" href="a00101.html#a3342299f05a6790fc3fe01f0358e57ab">00674</a> <span class="keyword">inline</span> operator T*()
<a name="l00675"></a>00675 {<span class="keywordflow">return</span> paged_reuse::get();};
<a name="l00676"></a>00676 };
<a name="l00677"></a>00677
<a name="l00685"></a>00685 <span class="keyword">template</span><<span class="keyword">class</span> T, vector<span class="keywordtype">size_t</span> S>
<a name="l00686"></a><a class="code" href="a00181.html">00686</a> <span class="keyword">class </span><a class="code" href="a00181.html" title="Allocated vector list of a specified type.">vectorbuf</a> : <span class="keyword">public</span> <a class="code" href="a00083.html" title="Vector with fixed size member list.">MemVector</a>
<a name="l00687"></a>00687 {
<a name="l00688"></a>00688 <span class="keyword">private</span>:
<a name="l00689"></a>00689 <span class="keywordtype">char</span> buffer[<span class="keyword">sizeof</span>(array) + (S * <span class="keyword">sizeof</span>(<span class="keywordtype">void</span> *))];
<a name="l00690"></a>00690
<a name="l00691"></a>00691 <span class="keyword">public</span>:
<a name="l00695"></a><a class="code" href="a00181.html#a28bff8616b18c133dcf526736d11a07c">00695</a> <span class="keyword">inline</span> <a class="code" href="a00181.html#a28bff8616b18c133dcf526736d11a07c" title="Construct fixed sized vector object in heap or stack.">vectorbuf</a>() : <a class="code" href="a00083.html" title="Vector with fixed size member list.">MemVector</a>(buffer, S) {};
<a name="l00696"></a>00696
<a name="l00702"></a><a class="code" href="a00181.html#a216f3dc816a0c54e404de57332e49c12">00702</a> <span class="keyword">inline</span> T *<span class="keyword">get</span>(<span class="keywordtype">int</span> index)
<a name="l00703"></a>00703 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::get(index));};
<a name="l00704"></a>00704
<a name="l00710"></a><a class="code" href="a00181.html#acab2952068aa07dfd3dd264749925bf4">00710</a> <span class="keyword">inline</span> T *operator()(vectorsize_t position)
<a name="l00711"></a>00711 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::get(position));};
<a name="l00712"></a>00712
<a name="l00717"></a><a class="code" href="a00181.html#aa7ae18511f329cf71432854f9ed5c232">00717</a> <span class="keyword">inline</span> T *begin(<span class="keywordtype">void</span>)
<a name="l00718"></a>00718 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::begin());};
<a name="l00719"></a>00719
<a name="l00724"></a><a class="code" href="a00181.html#a08756b593e557df5d58cb21d973ec6eb">00724</a> <span class="keyword">inline</span> T *end(<span class="keywordtype">void</span>)
<a name="l00725"></a>00725 {<span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T *<span class="keyword">></span>(Vector::end());};
<a name="l00726"></a>00726
<a name="l00732"></a><a class="code" href="a00181.html#ac54c345cb840066c4aa801a2fec4c8f6">00732</a> <span class="keyword">inline</span> <a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &operator+(<a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &vector)
<a name="l00733"></a>00733 {<a class="code" href="a00214.html#aad0ef1f27ebf9203be99b1824400e269" title="Add a linked object onto a stack of linked objects.">Vector::add</a>(vector); <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><a class="code" href="a00180.html" title="A managed vector for generic object pointers.">Vector</a> &<span class="keyword">></span>(*this);};
<a name="l00734"></a>00734 };
<a name="l00735"></a>00735
<a name="l00736"></a>00736 END_NAMESPACE
<a name="l00737"></a>00737
<a name="l00738"></a>00738 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Jul 6 08:22:01 2010 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>
|