1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <style type="text/css"><!-- 8 span.static_style 9 { 10 font-size : 8pt; 11 color : white; 12 font-weight : bold; 13 background : #44f; 14 border-left : solid 1px #aaf; 15 border-top : solid 1px #aaf; 16 border-right : solid 1px #00c; 17 border-bottom : solid 1px #00c; 18 padding-left : 2px; 19 padding-right : 2px; 20 } 21 span.virtual_style 22 { 23 font-size : 8pt; 24 color : white; 25 font-weight : bold; 26 background : #0a0; 27 border-left : solid 1px #0f0; 28 border-top : solid 1px #0f0; 29 border-right : solid 1px #060; 30 border-bottom : solid 1px #060; 31 padding-left : 2px; 32 padding-right : 2px; 33 } 34 span.protected_style 35 { 36 font-size : 8pt; 37 color : white; 38 font-weight : bold; 39 background : #444; 40 border-left : solid 1px #ccc; 41 border-top : solid 1px #ccc; 42 border-right : solid 1px #222; 43 border-bottom : solid 1px #222; 44 padding-left : 2px; 45 padding-right : 2px; 46 } 47 --></style> 48 <title>nw::ut::MoveArray</title> 49 </head> 50 <body> 51 <h1><CODE><a href="../../../nw/Overview.html">nw</a>::<a href="../../../nw/ut/Overview.html">ut</a>::MoveArray</CODE> Class</h1> 52 <h2>Syntax</h2> 53 <div class="section"> 54 <pre class="definition">template <typename TElement> 55class MoveArray</pre> 56 </div> 57 <h2>Template Arguments</h2> 58 <div class="section"> 59 <table class="arguments"> 60 <thead> 61 <tr> 62 <th>Name</th> 63 <td>Description</td> 64 </tr> 65 </thead> 66 <tr> 67 <th><CODE>TElement</CODE></th> 68 <td>The array element type.</td> 69 </tr> </table> 70 </div> 71 <h2>Description</h2> 72 <div class="section"> 73 <p>Class for wrapping an array so it can be used like an STL vector.</p><p>The purpose is to safely use the array. This class is implemented to realize move semantics. Special implementations are used for copying and assigning. Ownership is moved rather than copying resources being managed.</p><p>One of the following three operational states will result at time of creation.</p><p>1. A fixed-length array whose size cannot be changed<BR>2. A variable length array whose size is automatically extended by push_back and other such operations<BR>3. An invalid state without an array<BR></p><p>The instance of the ownership source is put into one of the state 3 above after ownership is moved. Instances created using the default constructor also result in state 3. If an instance in this state is coded in an if statement, false is returned. If instances in state 1 or 2 are coded in a conditional statement, true is returned.</p><p>State 2 above can be disabled by disabling the definition of "NW_MOVE_ARRAY_VARIABILITY_ENABLED" in the header "nw/ut/ut_Config.h".</p></div> 74 <a name="typedef" id="typedef"> 75 <h2><CODE>typedef</CODE> Definitions</h2> 76 <div class="section"> 77 <table class="members"> 78 <tr> 79 <td width="100" /> 80 <th> 81 <a href="../../../nw/ut/MoveArray/reference.html"><CODE>reference</CODE></a> 82 </th> 83 <td>Element reference.</td> 84 </tr> 85 <tr> 86 <td width="100" /> 87 <th> 88 <a href="../../../nw/ut/MoveArray/difference_type.html"><CODE>difference_type</CODE></a> 89 </th> 90 <td>Element difference.</td> 91 </tr> 92 <tr> 93 <td width="100" /> 94 <th> 95 <a href="../../../nw/ut/MoveArray/value_type.html"><CODE>value_type</CODE></a> 96 </th> 97 <td>The type of this class's elements.</td> 98 </tr> 99 <tr> 100 <td width="100" /> 101 <th> 102 <a href="../../../nw/ut/MoveArray/iterator.html"><CODE>iterator</CODE></a> 103 </th> 104 <td>Element iterator type.</td> 105 </tr> 106 <tr> 107 <td width="100" /> 108 <th> 109 <a href="../../../nw/ut/MoveArray/const_iterator.html"><CODE>const_iterator</CODE></a> 110 </th> 111 <td>Element const iterator type.</td> 112 </tr> 113 <tr> 114 <td width="100" /> 115 <th> 116 <a href="../../../nw/ut/MoveArray/reverse_iterator.html"><CODE>reverse_iterator</CODE></a> 117 </th> 118 <td>Element reverse iterator type.</td> 119 </tr> 120 <tr> 121 <td width="100" /> 122 <th> 123 <a href="../../../nw/ut/MoveArray/const_reverse_iterator.html"><CODE>const_reverse_iterator</CODE></a> 124 </th> 125 <td>Element const reverse iterator type.</td> 126 </tr> </table> 127 </div> 128 </a> <a name="constant" id="constant"> 129 <h2>Member Constants</h2> 130 <div class="section"> 131 <table class="members"> 132 <tr> 133 <td width="100"> 134 <span class="static_style" title="static">S</span> 135 </td> 136 <th> 137 <span class="argument"><a href="../../../nw/ut/MoveArray/MEMORY_ALIGNMENT.html">MEMORY_ALIGNMENT</a></span> 138 </th> 139 <td width="100"><CODE>const size_t</CODE></td> 140 <td> 141 </td> 142 </tr> </table> 143 </div> 144 </a> <a name="variable" id="variable"> 145 <h2>Member Variables</h2> 146 <div class="section"> 147 <table class="members"> 148 <tr> 149 <td width="100"> 150 <span class="protected_style" title="protected">protected</span> </td> 151 <th> 152 <span class="argument">m_Allocator</span> 153 </th> 154 <td width="100"><a href="../../../nw/os/IAllocator/Overview.html">os::IAllocator</a> *</td> 155 <td> 156 </td> 157 </tr> 158 <tr> 159 <td width="100"> 160 <span class="protected_style" title="protected">protected</span> </td> 161 <th> 162 <span class="argument">m_Elements</span> 163 </th> 164 <td width="100">TElement *</td> 165 <td> 166 </td> 167 </tr> 168 <tr> 169 <td width="100"> 170 <span class="protected_style" title="protected">protected</span> </td> 171 <th> 172 <span class="argument">m_End</span> 173 </th> 174 <td width="100">TElement *</td> 175 <td> 176 </td> 177 </tr> </table> 178 </div> 179 </a> <a name="function" id="function"> 180 <h2>Member Functions</h2> 181 <div class="section"> 182 <table class="members"> 183 <tr> 184 <th class="category" colspan="3">Arrays and Memory Operations</th> 185 </tr> 186 <tr> 187 <td width="100"> </td> 188 <th> 189 <a href="../../../nw/ut/MoveArray/reserve.html">reserve</a> 190 </th> 191 <td>Reserves memory for the specified number of elements. <a href="../../../nw/ut/MoveArray/GetArrayKind.html">GetArrayKind()</a> only works when ARRAY_VARIABILITY is defined. Returns false if the requested size cannot be reserved. Memory reserved using reserve cannot be trimmed. Use shrink_to_fit in such cases.</td> 192 </tr> 193 <tr> 194 <td width="100"> </td> 195 <th> 196 <a href="../../../nw/ut/MoveArray/push_back.html">push_back</a> 197 </th> 198 <td>Adds an element to the end. Returns false in the return value if the element could not be added.</td> 199 </tr> 200 <tr> 201 <td width="100"> </td> 202 <th> 203 <a href="../../../nw/ut/MoveArray/pop_back.html">pop_back</a> 204 </th> 205 <td>Destroys the last element.</td> 206 </tr> 207 <tr> 208 <td width="100"> </td> 209 <th> 210 <a href="../../../nw/ut/MoveArray/assign.html">assign</a> 211 </th> 212 <td>Pads the specified number of elements with the argument <CODE>element</CODE>. Returns false in the return value if all elements could not be added.</td> 213 </tr> 214 <tr> 215 <td width="100"> </td> 216 <th> 217 <a href="../../../nw/ut/MoveArray/swap.html">swap</a> 218 </th> 219 <td>Swaps array contents.</td> 220 </tr> 221 <tr> 222 <td width="100"> </td> 223 <th> 224 <a href="../../../nw/ut/MoveArray/resize.html">resize</a> 225 </th> 226 <td>Changes the size. Returns false in the return value if the specified size could not be made.</td> 227 </tr> 228 <tr> 229 <td width="100"> </td> 230 <th> 231 <a href="../../../nw/ut/MoveArray/erase.html">erase</a> 232 </th> 233 <td>Erases elements after the specified iterator.</td> 234 </tr> 235 <tr> 236 <td width="100"> </td> 237 <th> 238 <a href="../../../nw/ut/MoveArray/clear.html">clear</a> 239 </th> 240 <td>Calls a destructor for all elements and sets the number of elements to 0. Allocated memory is not freed.</td> 241 </tr> 242 <tr> 243 <td width="100"> </td> 244 <th> 245 <a href="../../../nw/ut/MoveArray/erase_find.html">erase_find</a> 246 </th> 247 <td>Searches for elements having the same value as the argument and deletes them.</td> 248 </tr> 249 <tr> 250 <td width="100"> </td> 251 <th> 252 <a href="../../../nw/ut/MoveArray/erase_if.html">erase_if</a> 253 </th> 254 <td>Searches for elements meeting specified conditions and deletes them.</td> 255 </tr> 256 <tr> 257 <td width="100"> </td> 258 <th> 259 <a href="../../../nw/ut/MoveArray/ShrinkToFit.html">ShrinkToFit</a> 260 </th> 261 <td>Trims reserved memory to match the current number of elements.</td> 262 </tr> 263 <tr> 264 <td width="100"> </td> 265 <th> 266 <a href="../../../nw/ut/MoveArray/GetArrayKind.html">GetArrayKind</a> 267 </th> 268 <td>Gets the type of array for which memory was allocated.</td> 269 </tr> 270 <tr> 271 <td width="100"> </td> 272 <th> 273 <a href="../../../nw/ut/MoveArray/GetAllocator.html"><CODE>GetAllocator</CODE></a> 274 </th> 275 <td>Gets an allocator.</td> 276 </tr> 277 <tr> 278 <th class="category" colspan="3">Aliasing conforms to NintendoWare coding rules.</th> 279 </tr> 280 <tr> 281 <td width="100"> </td> 282 <th> 283 <a href="../../../nw/ut/MoveArray/Size.html">Size</a> 284 </th> 285 <td>Gets the array size.</td> 286 </tr> 287 <tr> 288 <td width="100"> </td> 289 <th> 290 <a href="../../../nw/ut/MoveArray/Begin.html"><CODE>Begin</CODE></a> 291 </th> 292 <td>Gets an iterator to the start element.</td> 293 </tr> 294 <tr> 295 <td width="100"> </td> 296 <th> 297 <a href="../../../nw/ut/MoveArray/End.html">END</a> 298 </th> 299 <td>Gets an iterator to the last element.</td> 300 </tr> 301 <tr> 302 <td width="100"> </td> 303 <th> 304 <a href="../../../nw/ut/MoveArray/RBegin.html">RBegin</a> 305 </th> 306 <td>Gets a reverse iterator to the start element.</td> 307 </tr> 308 <tr> 309 <td width="100"> </td> 310 <th> 311 <a href="../../../nw/ut/MoveArray/REnd.html">REnd</a> 312 </th> 313 <td>Gets a reverse iterator to the last element.</td> 314 </tr> 315 <tr> 316 <td width="100"> </td> 317 <th> 318 <a href="../../../nw/ut/MoveArray/Front.html">Front</a> 319 </th> 320 <td>Gets the array size.</td> 321 </tr> 322 <tr> 323 <td width="100"> </td> 324 <th> 325 <a href="../../../nw/ut/MoveArray/Back.html">Back</a> 326 </th> 327 <td>Gets a reference to the last element.</td> 328 </tr> 329 <tr> 330 <td width="100"> </td> 331 <th> 332 <a href="../../../nw/ut/MoveArray/Empty.html"><CODE>Empty</CODE></a> 333 </th> 334 <td>Gets a flag indicating if there are any elements. Note this does not mean whether or not there is allocated memory.</td> 335 </tr> 336 <tr> 337 <td width="100"> </td> 338 <th> 339 <a href="../../../nw/ut/MoveArray/Capacity.html">Capacity</a> 340 </th> 341 <td>Gets the number of elements of memory that have been allocated.</td> 342 </tr> 343 <tr> 344 <td width="100"> </td> 345 <th> 346 <a href="../../../nw/ut/MoveArray/Reserve.html">Reserve</a> 347 </th> 348 <td>Reserves memory for the specified number of elements.</td> 349 </tr> 350 <tr> 351 <td width="100"> </td> 352 <th> 353 <a href="../../../nw/ut/MoveArray/PushBack.html">PushBack</a> 354 </th> 355 <td>Adds an element to the end.</td> 356 </tr> 357 <tr> 358 <td width="100"> </td> 359 <th> 360 <a href="../../../nw/ut/MoveArray/PopBack.html">PopBack</a> 361 </th> 362 <td>Destroys the last element.</td> 363 </tr> 364 <tr> 365 <td width="100"> </td> 366 <th> 367 <a href="../../../nw/ut/MoveArray/Assign.html">Assign</a> 368 </th> 369 <td>Pads the specified number of elements with the argument <CODE>element</CODE>.</td> 370 </tr> 371 <tr> 372 <td width="100"> </td> 373 <th> 374 <a href="../../../nw/ut/MoveArray/Swap.html"><CODE>Swap</CODE></a> 375 </th> 376 <td>Swaps array contents.</td> 377 </tr> 378 <tr> 379 <td width="100"> </td> 380 <th> 381 <a href="../../../nw/ut/MoveArray/Resize.html">Resize</a> 382 </th> 383 <td>Changes the size.</td> 384 </tr> 385 <tr> 386 <td width="100"> </td> 387 <th> 388 <a href="../../../nw/ut/MoveArray/Erase.html">Erase</a> 389 </th> 390 <td>Erases elements after the specified iterator.</td> 391 </tr> 392 <tr> 393 <td width="100"> </td> 394 <th> 395 <a href="../../../nw/ut/MoveArray/Clear.html"><CODE>Clear</CODE></a> 396 </th> 397 <td>Calls a destructor for all elements and sets the number of elements to 0. Allocated memory is not freed.</td> 398 </tr> 399 <tr> 400 <td width="100"> </td> 401 <th> 402 <a href="../../../nw/ut/MoveArray/EraseFind.html">EraseFind</a> 403 </th> 404 <td>Searches for elements having the same value as the argument and deletes them.</td> 405 </tr> 406 <tr> 407 <td width="100"> </td> 408 <th> 409 <a href="../../../nw/ut/MoveArray/EraseIf.html">EraseIf</a> 410 </th> 411 <td>Searches for elements meeting specified conditions and deletes them.</td> 412 </tr> 413 <tr> 414 <th class="category" colspan="3">For optimization</th> 415 </tr> 416 <tr> 417 <td width="100"> </td> 418 <th> 419 <a href="../../../nw/ut/MoveArray/PushBackFast.html">PushBackFast</a> 420 </th> 421 <td>A fast version of push_back.</td> 422 </tr> 423 <tr> 424 <th class="category" colspan="3">Other</th> 425 </tr> 426 <tr> 427 <td width="100"> </td> 428 <th> 429 <a href="../../../nw/ut/MoveArray/MoveArray.html">MoveArray</a> 430 </th> 431 <td>Constructor.</td> 432 </tr> 433 <tr> 434 <td width="100"> </td> 435 <th> 436 <a href="../../../nw/ut/MoveArray/~MoveArray.html">~MoveArray</a> 437 </th> 438 <td>Destructor.</td> 439 </tr> 440 <tr> 441 <td width="100"> </td> 442 <th> 443 <a href="../../../nw/ut/MoveArray/operator SafeBool.html"><CODE>operator SafeBool</CODE></a> 444 </th> 445 <td>Returns true if a valid array is owned.</td> 446 </tr> 447 <tr> 448 <td width="100"> </td> 449 <th> 450 <a href="../../../nw/ut/MoveArray/operator=.html"><CODE>operator=</CODE></a> 451 </th> 452 <td>Assignment operator definition.</td> 453 </tr> 454 <tr> 455 <td width="100"> </td> 456 <th> 457 <a href="../../../nw/ut/MoveArray/Elements.html">Elements</a> 458 </th> 459 <td>Externally public accessor just for reading arrays.</td> 460 </tr> 461 <tr> 462 <td width="100"> </td> 463 <th> 464 <a href="../../../nw/ut/MoveArray/operator[].html"><CODE>operator[]</CODE></a> 465 </th> 466 <td>Post-fix operator definition.</td> 467 </tr> 468 <tr> 469 <td width="100"> </td> 470 <th> 471 <a href="../../../nw/ut/MoveArray/release.html">release</a> 472 </th> 473 <td>Releases ownership of internal array memory.</td> 474 </tr> 475 <tr> 476 <td width="100"> </td> 477 <th> 478 <a href="../../../nw/ut/MoveArray/Reset.html"><CODE>Reset</CODE></a> 479 </th> 480 <td>Resets the array to manage <a href="../../../nw/ut/MoveArray/Overview.html">MoveArray</a>.</td> 481 </tr> 482 <tr> 483 <td width="100"> </td> 484 <th> 485 <a href="../../../nw/ut/MoveArray/size.html"><CODE>size</CODE></a> 486 </th> 487 <td>Gets the array size.</td> 488 </tr> 489 <tr> 490 <td width="100"> </td> 491 <th> 492 <a href="../../../nw/ut/MoveArray/begin.html">begin</a> 493 </th> 494 <td>Gets an iterator to the start element.</td> 495 </tr> 496 <tr> 497 <td width="100"> </td> 498 <th> 499 <a href="../../../nw/ut/MoveArray/end.html">end</a> 500 </th> 501 <td>Gets an iterator to the last element.</td> 502 </tr> 503 <tr> 504 <td width="100"> </td> 505 <th> 506 <a href="../../../nw/ut/MoveArray/rbegin.html">rbegin</a> 507 </th> 508 <td>Gets a reverse iterator to the start element.</td> 509 </tr> 510 <tr> 511 <td width="100"> </td> 512 <th> 513 <a href="../../../nw/ut/MoveArray/rend.html">rend</a> 514 </th> 515 <td>Gets a reverse iterator to the last element.</td> 516 </tr> 517 <tr> 518 <td width="100"> </td> 519 <th> 520 <a href="../../../nw/ut/MoveArray/front.html">front</a> 521 </th> 522 <td>Gets a reference to the first element.</td> 523 </tr> 524 <tr> 525 <td width="100"> </td> 526 <th> 527 <a href="../../../nw/ut/MoveArray/back.html">back</a> 528 </th> 529 <td>Gets a reference to the last element.</td> 530 </tr> 531 <tr> 532 <td width="100"> </td> 533 <th> 534 <a href="../../../nw/ut/MoveArray/empty.html">empty</a> 535 </th> 536 <td>Gets a flag indicating if there are any elements. Note this does not mean whether or not there is allocated memory.</td> 537 </tr> 538 <tr> 539 <td width="100"> </td> 540 <th> 541 <a href="../../../nw/ut/MoveArray/capacity.html">capacity</a> 542 </th> 543 <td>Gets the number of elements of memory that have been allocated.</td> 544 </tr> 545 <tr> 546 <td width="100"> </td> 547 <th> 548 <a href="../../../nw/ut/MoveArray/CopyFrom.html">CopyFrom</a> 549 </th> 550 <td>Copies an array.</td> 551 </tr> 552 <tr> 553 <td width="100"> 554 <span class="protected_style" title="protected">protected</span> </td> 555 <th> 556 <a href="../../../nw/ut/MoveArray/SetArrayKind.html">SetArrayKind</a> 557 </th> 558 <td>Sets the array type.</td> 559 </tr> 560 <tr> 561 <td width="100"> 562 <span class="protected_style" title="protected">protected</span> </td> 563 <th> 564 <a href="../../../nw/ut/MoveArray/SetCapacity.html">SetCapacity</a> 565 </th> 566 <td>Sets the number of allocations.</td> 567 </tr> 568 <tr> 569 <td width="100"> 570 <span class="protected_style" title="protected">protected</span> </td> 571 <th> 572 <a href="../../../nw/ut/MoveArray/GetCapacity.html"><CODE>GetCapacity</CODE></a> 573 </th> 574 <td>Gets the number of allocations.</td> 575 </tr> </table> 576 </div> 577 </a> 578 <h2>See Also</h2> 579 <div class="section"> 580 <p class="reference"><a href="../../../nw/ut/ArrayKind.html">nw::ut::ArrayKind</a><br /> </p> 581 </div> 582 <hr><p>CONFIDENTIAL</p></body> 583</html> 584