/usr/share/doc/libjuce/apiref/classHeapBlock.html is in libjuce-doc 4.3.0~repack-1.
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 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 | <!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: HeapBlock< ElementType, throwOnFailure > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">JUCE
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Public Types</a> |
<a href="#pub-methods">Public Member Functions</a> |
<a href="classHeapBlock-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">HeapBlock< ElementType, throwOnFailure > Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Very simple container class to hold a pointer to some data on the heap.
<a href="classHeapBlock.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a5757b5bd325d4addb907186b08e6849e"><td class="memItemLeft" align="right" valign="top">typedef ElementType </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a5757b5bd325d4addb907186b08e6849e">Type</a></td></tr>
<tr class="memdesc:a5757b5bd325d4addb907186b08e6849e"><td class="mdescLeft"> </td><td class="mdescRight">This typedef can be used to get the type of the heapblock's elements. <a href="#a5757b5bd325d4addb907186b08e6849e">More...</a><br /></td></tr>
<tr class="separator:a5757b5bd325d4addb907186b08e6849e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ab7643beefa078bb4692dbfff40f6f3bb"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#ab7643beefa078bb4692dbfff40f6f3bb">HeapBlock</a> () noexcept</td></tr>
<tr class="memdesc:ab7643beefa078bb4692dbfff40f6f3bb"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> which is initially just a null pointer. <a href="#ab7643beefa078bb4692dbfff40f6f3bb">More...</a><br /></td></tr>
<tr class="separator:ab7643beefa078bb4692dbfff40f6f3bb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a31427ded49cc996e6f894f124c4aa5ba"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a31427ded49cc996e6f894f124c4aa5ba">HeapBlock</a> (const size_t numElements)</td></tr>
<tr class="memdesc:a31427ded49cc996e6f894f124c4aa5ba"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> containing a number of elements. <a href="#a31427ded49cc996e6f894f124c4aa5ba">More...</a><br /></td></tr>
<tr class="separator:a31427ded49cc996e6f894f124c4aa5ba"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adcd966a89c09b50e2fa4efc1a7b20ca6"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#adcd966a89c09b50e2fa4efc1a7b20ca6">HeapBlock</a> (const size_t numElements, const bool initialiseToZero)</td></tr>
<tr class="memdesc:adcd966a89c09b50e2fa4efc1a7b20ca6"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> containing a number of elements. <a href="#adcd966a89c09b50e2fa4efc1a7b20ca6">More...</a><br /></td></tr>
<tr class="separator:adcd966a89c09b50e2fa4efc1a7b20ca6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abf392fafab8530d45132eaeb81ff372d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#abf392fafab8530d45132eaeb81ff372d">~HeapBlock</a> ()</td></tr>
<tr class="memdesc:abf392fafab8530d45132eaeb81ff372d"><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#abf392fafab8530d45132eaeb81ff372d">More...</a><br /></td></tr>
<tr class="separator:abf392fafab8530d45132eaeb81ff372d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a43e44081c3cbef5f634dd5a2a58cd1bd"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a43e44081c3cbef5f634dd5a2a58cd1bd">HeapBlock</a> (<a class="el" href="classHeapBlock.html">HeapBlock</a> &&other) noexcept</td></tr>
<tr class="separator:a43e44081c3cbef5f634dd5a2a58cd1bd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a877202b3a190fecfc309e43cd706822a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classHeapBlock.html">HeapBlock</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a877202b3a190fecfc309e43cd706822a">operator=</a> (<a class="el" href="classHeapBlock.html">HeapBlock</a> &&other) noexcept</td></tr>
<tr class="separator:a877202b3a190fecfc309e43cd706822a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af6d00012477feaaab90bcf100d05d08a"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#af6d00012477feaaab90bcf100d05d08a">operator ElementType *</a> () const noexcept</td></tr>
<tr class="memdesc:af6d00012477feaaab90bcf100d05d08a"><td class="mdescLeft"> </td><td class="mdescRight">Returns a raw pointer to the allocated data. <a href="#af6d00012477feaaab90bcf100d05d08a">More...</a><br /></td></tr>
<tr class="separator:af6d00012477feaaab90bcf100d05d08a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a30a00ad8520b7b4b5f58c063a7247a7f"><td class="memItemLeft" align="right" valign="top">ElementType * </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a30a00ad8520b7b4b5f58c063a7247a7f">getData</a> () const noexcept</td></tr>
<tr class="memdesc:a30a00ad8520b7b4b5f58c063a7247a7f"><td class="mdescLeft"> </td><td class="mdescRight">Returns a raw pointer to the allocated data. <a href="#a30a00ad8520b7b4b5f58c063a7247a7f">More...</a><br /></td></tr>
<tr class="separator:a30a00ad8520b7b4b5f58c063a7247a7f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a912268a681322c1234753bd580bf1f89"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a912268a681322c1234753bd580bf1f89">operator void *</a> () const noexcept</td></tr>
<tr class="memdesc:a912268a681322c1234753bd580bf1f89"><td class="mdescLeft"> </td><td class="mdescRight">Returns a void pointer to the allocated data. <a href="#a912268a681322c1234753bd580bf1f89">More...</a><br /></td></tr>
<tr class="separator:a912268a681322c1234753bd580bf1f89"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af51c07aad68df37e185d1f452a5ace97"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#af51c07aad68df37e185d1f452a5ace97">operator const void *</a> () const noexcept</td></tr>
<tr class="memdesc:af51c07aad68df37e185d1f452a5ace97"><td class="mdescLeft"> </td><td class="mdescRight">Returns a void pointer to the allocated data. <a href="#af51c07aad68df37e185d1f452a5ace97">More...</a><br /></td></tr>
<tr class="separator:af51c07aad68df37e185d1f452a5ace97"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad7d495cdad2d794c5fc544e54d43caa2"><td class="memItemLeft" align="right" valign="top">ElementType * </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#ad7d495cdad2d794c5fc544e54d43caa2">operator-></a> () const noexcept</td></tr>
<tr class="memdesc:ad7d495cdad2d794c5fc544e54d43caa2"><td class="mdescLeft"> </td><td class="mdescRight">Lets you use indirect calls to the first element in the array. <a href="#ad7d495cdad2d794c5fc544e54d43caa2">More...</a><br /></td></tr>
<tr class="separator:ad7d495cdad2d794c5fc544e54d43caa2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4fde2d780504edd9e7a33efe0c24ab9c"><td class="memTemplParams" colspan="2">template<typename IndexType > </td></tr>
<tr class="memitem:a4fde2d780504edd9e7a33efe0c24ab9c"><td class="memTemplItemLeft" align="right" valign="top">ElementType & </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a4fde2d780504edd9e7a33efe0c24ab9c">operator[]</a> (IndexType index) const noexcept</td></tr>
<tr class="memdesc:a4fde2d780504edd9e7a33efe0c24ab9c"><td class="mdescLeft"> </td><td class="mdescRight">Returns a reference to one of the data elements. <a href="#a4fde2d780504edd9e7a33efe0c24ab9c">More...</a><br /></td></tr>
<tr class="separator:a4fde2d780504edd9e7a33efe0c24ab9c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae5769755baa56702235ecf2edc68f808"><td class="memTemplParams" colspan="2">template<typename IndexType > </td></tr>
<tr class="memitem:ae5769755baa56702235ecf2edc68f808"><td class="memTemplItemLeft" align="right" valign="top">ElementType * </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#ae5769755baa56702235ecf2edc68f808">operator+</a> (IndexType index) const noexcept</td></tr>
<tr class="memdesc:ae5769755baa56702235ecf2edc68f808"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to a data element at an offset from the start of the array. <a href="#ae5769755baa56702235ecf2edc68f808">More...</a><br /></td></tr>
<tr class="separator:ae5769755baa56702235ecf2edc68f808"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4e298218cf588337359db82edd07e497"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a4e298218cf588337359db82edd07e497">operator==</a> (const ElementType *const otherPointer) const noexcept</td></tr>
<tr class="memdesc:a4e298218cf588337359db82edd07e497"><td class="mdescLeft"> </td><td class="mdescRight">Compares the pointer with another pointer. <a href="#a4e298218cf588337359db82edd07e497">More...</a><br /></td></tr>
<tr class="separator:a4e298218cf588337359db82edd07e497"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a02ba60581374bc14ffc29d208937d0ae"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a02ba60581374bc14ffc29d208937d0ae">operator!=</a> (const ElementType *const otherPointer) const noexcept</td></tr>
<tr class="memdesc:a02ba60581374bc14ffc29d208937d0ae"><td class="mdescLeft"> </td><td class="mdescRight">Compares the pointer with another pointer. <a href="#a02ba60581374bc14ffc29d208937d0ae">More...</a><br /></td></tr>
<tr class="separator:a02ba60581374bc14ffc29d208937d0ae"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1a196c4ebdb6a5ff9517e262b91894cf"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf">malloc</a> (const size_t newNumElements, const size_t elementSize=sizeof(ElementType))</td></tr>
<tr class="memdesc:a1a196c4ebdb6a5ff9517e262b91894cf"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a specified amount of memory. <a href="#a1a196c4ebdb6a5ff9517e262b91894cf">More...</a><br /></td></tr>
<tr class="separator:a1a196c4ebdb6a5ff9517e262b91894cf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a59dc4dfb0d05906164f4362b2086cd50"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50">calloc</a> (const size_t newNumElements, const size_t elementSize=sizeof(ElementType))</td></tr>
<tr class="memdesc:a59dc4dfb0d05906164f4362b2086cd50"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a specified amount of memory and clears it. <a href="#a59dc4dfb0d05906164f4362b2086cd50">More...</a><br /></td></tr>
<tr class="separator:a59dc4dfb0d05906164f4362b2086cd50"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4e999ff1f7ed59dd4546596447059cc7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a4e999ff1f7ed59dd4546596447059cc7">allocate</a> (const size_t newNumElements, bool initialiseToZero)</td></tr>
<tr class="memdesc:a4e999ff1f7ed59dd4546596447059cc7"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a specified amount of memory and optionally clears it. <a href="#a4e999ff1f7ed59dd4546596447059cc7">More...</a><br /></td></tr>
<tr class="separator:a4e999ff1f7ed59dd4546596447059cc7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a75f22feaa5bb7278e6a6234ec5d19778"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a75f22feaa5bb7278e6a6234ec5d19778">realloc</a> (const size_t newNumElements, const size_t elementSize=sizeof(ElementType))</td></tr>
<tr class="memdesc:a75f22feaa5bb7278e6a6234ec5d19778"><td class="mdescLeft"> </td><td class="mdescRight">Re-allocates a specified amount of memory. <a href="#a75f22feaa5bb7278e6a6234ec5d19778">More...</a><br /></td></tr>
<tr class="separator:a75f22feaa5bb7278e6a6234ec5d19778"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8ec3fb69997d6f530d60cb5e0969f97f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f">free</a> () noexcept</td></tr>
<tr class="memdesc:a8ec3fb69997d6f530d60cb5e0969f97f"><td class="mdescLeft"> </td><td class="mdescRight">Frees any currently-allocated data. <a href="#a8ec3fb69997d6f530d60cb5e0969f97f">More...</a><br /></td></tr>
<tr class="separator:a8ec3fb69997d6f530d60cb5e0969f97f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7ebc384a5d3f8ccfb56229688a0a273c"><td class="memTemplParams" colspan="2">template<bool otherBlockThrows> </td></tr>
<tr class="memitem:a7ebc384a5d3f8ccfb56229688a0a273c"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a7ebc384a5d3f8ccfb56229688a0a273c">swapWith</a> (<a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, otherBlockThrows > &other) noexcept</td></tr>
<tr class="memdesc:a7ebc384a5d3f8ccfb56229688a0a273c"><td class="mdescLeft"> </td><td class="mdescRight">Swaps this object's data with the data of another <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a>. <a href="#a7ebc384a5d3f8ccfb56229688a0a273c">More...</a><br /></td></tr>
<tr class="separator:a7ebc384a5d3f8ccfb56229688a0a273c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a658838e2b07f498b169c87c73040b509"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classHeapBlock.html#a658838e2b07f498b169c87c73040b509">clear</a> (size_t numElements) noexcept</td></tr>
<tr class="memdesc:a658838e2b07f498b169c87c73040b509"><td class="mdescLeft"> </td><td class="mdescRight">This fills the block with zeros, up to the number of elements specified. <a href="#a658838e2b07f498b169c87c73040b509">More...</a><br /></td></tr>
<tr class="separator:a658838e2b07f498b169c87c73040b509"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class ElementType, bool throwOnFailure = false><br />
class HeapBlock< ElementType, throwOnFailure ></h3>
<p>Very simple container class to hold a pointer to some data on the heap. </p>
<p>When you need to allocate some heap storage for something, always try to use this class instead of allocating the memory directly using malloc/free.</p>
<p>A <a class="el" href="classHeapBlock.html">HeapBlock<char></a> object can be treated in pretty much exactly the same way as an char*, but as long as you allocate it on the stack or as a class member, it's almost impossible for it to leak memory.</p>
<p>It also makes your code much more concise and readable than doing the same thing using direct allocations,</p>
<p>E.g. instead of this: </p><div class="fragment"><div class="line"><span class="keywordtype">int</span>* temp = (<span class="keywordtype">int</span>*) <a class="code" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf">malloc</a> (1024 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div><div class="line">memcpy (temp, xyz, 1024 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div><div class="line"><a class="code" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f">free</a> (temp);</div><div class="line">temp = (<span class="keywordtype">int</span>*) <a class="code" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50">calloc</a> (2048 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div><div class="line">temp[0] = 1234;</div><div class="line">memcpy (foobar, temp, 2048 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div><div class="line"><a class="code" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f">free</a> (temp);</div></div><!-- fragment --><p>..you could just write this: </p><div class="fragment"><div class="line"><a class="code" href="classHeapBlock.html">HeapBlock<int></a> temp (1024);</div><div class="line">memcpy (temp, xyz, 1024 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div><div class="line">temp.calloc (2048);</div><div class="line">temp[0] = 1234;</div><div class="line">memcpy (foobar, temp, 2048 * <span class="keyword">sizeof</span> (<span class="keywordtype">int</span>));</div></div><!-- fragment --><p>The class is extremely lightweight, containing only a pointer to the data, and exposes malloc/realloc/calloc/free methods that do the same jobs as their less object-oriented counterparts. Despite adding safety, you probably won't sacrifice any performance by using this in place of normal pointers.</p>
<p>The throwOnFailure template parameter can be set to true if you'd like the class to throw a std::bad_alloc exception when an allocation fails. If this is false, then a failed allocation will just leave the heapblock with a null pointer (assuming that the system's <a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf" title="Allocates a specified amount of memory. ">malloc()</a> function doesn't throw).</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects. ">Array</a>, <a class="el" href="classOwnedArray.html" title="An array designed for holding objects. ">OwnedArray</a>, <a class="el" href="classMemoryBlock.html" title="A class to hold a resizable block of raw data. ">MemoryBlock</a> </dd></dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a5757b5bd325d4addb907186b08e6849e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5757b5bd325d4addb907186b08e6849e">§ </a></span>Type</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname">typedef ElementType <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::<a class="el" href="classHeapBlock.html#a5757b5bd325d4addb907186b08e6849e">Type</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>This typedef can be used to get the type of the heapblock's elements. </p>
</div>
</div>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a id="ab7643beefa078bb4692dbfff40f6f3bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7643beefa078bb4692dbfff40f6f3bb">§ </a></span>HeapBlock() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::<a class="el" href="classHeapBlock.html">HeapBlock</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> which is initially just a null pointer. </p>
<p>After creation, you can resize the array using the <a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf" title="Allocates a specified amount of memory. ">malloc()</a>, <a class="el" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50" title="Allocates a specified amount of memory and clears it. ">calloc()</a>, or <a class="el" href="classHeapBlock.html#a75f22feaa5bb7278e6a6234ec5d19778" title="Re-allocates a specified amount of memory. ">realloc()</a> methods. </p>
</div>
</div>
<a id="a31427ded49cc996e6f894f124c4aa5ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31427ded49cc996e6f894f124c4aa5ba">§ </a></span>HeapBlock() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::<a class="el" href="classHeapBlock.html">HeapBlock</a> </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>numElements</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> containing a number of elements. </p>
<p>The contents of the block are undefined, as it will have been created by a malloc call.</p>
<p>If you want an array of zero values, you can use the <a class="el" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50" title="Allocates a specified amount of memory and clears it. ">calloc()</a> method or the other constructor that takes an InitialisationState parameter. </p>
</div>
</div>
<a id="adcd966a89c09b50e2fa4efc1a7b20ca6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcd966a89c09b50e2fa4efc1a7b20ca6">§ </a></span>HeapBlock() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::<a class="el" href="classHeapBlock.html">HeapBlock</a> </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>numElements</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const bool </td>
<td class="paramname"><em>initialiseToZero</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a> containing a number of elements. </p>
<p>The initialiseToZero parameter determines whether the new memory should be cleared, or left uninitialised. </p>
</div>
</div>
<a id="abf392fafab8530d45132eaeb81ff372d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf392fafab8530d45132eaeb81ff372d">§ </a></span>~HeapBlock()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::~<a class="el" href="classHeapBlock.html">HeapBlock</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor. </p>
<p>This will free the data, if any has been allocated. </p>
</div>
</div>
<a id="a43e44081c3cbef5f634dd5a2a58cd1bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43e44081c3cbef5f634dd5a2a58cd1bd">§ </a></span>HeapBlock() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::<a class="el" href="classHeapBlock.html">HeapBlock</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure > && </td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a877202b3a190fecfc309e43cd706822a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a877202b3a190fecfc309e43cd706822a">§ </a></span>operator=()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>& <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure > && </td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="af6d00012477feaaab90bcf100d05d08a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af6d00012477feaaab90bcf100d05d08a">§ </a></span>operator ElementType *()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator ElementType * </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a raw pointer to the allocated data. </p>
<p>This may be a null pointer if the data hasn't yet been allocated, or if it has been freed by calling the <a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f" title="Frees any currently-allocated data. ">free()</a> method. </p>
</div>
</div>
<a id="a30a00ad8520b7b4b5f58c063a7247a7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a30a00ad8520b7b4b5f58c063a7247a7f">§ </a></span>getData()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ElementType* <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::getData </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a raw pointer to the allocated data. </p>
<p>This may be a null pointer if the data hasn't yet been allocated, or if it has been freed by calling the <a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f" title="Frees any currently-allocated data. ">free()</a> method. </p>
<p>Referenced by <a class="el" href="classOwnedArray.html#a4ae4a483c09550d8432b98db14f2d132">OwnedArray< MidiBuffer >::contains()</a>, <a class="el" href="classReferenceCountedArray.html#a5660a4dab2e9765784f1c5af73d7c303">ReferenceCountedArray< AudioProcessorGraph::Node >::contains()</a>, <a class="el" href="classAudioUnitHelpers_1_1ChannelRemapper.html#a4cce2263d3c691c3560e866a6d4446d0">AudioUnitHelpers::ChannelRemapper::get()</a>, <a class="el" href="classOwnedArray.html#a6660424693e4edbc687fc8352a71ca92">OwnedArray< MidiBuffer >::indexOf()</a>, <a class="el" href="classReferenceCountedArray.html#a034cad62a8ebb5854db4db2ff4afbf71">ReferenceCountedArray< AudioProcessorGraph::Node >::indexOf()</a>, <a class="el" href="classOwnedArray.html#a2b783fa66f082b890fc20d8d9c948494">OwnedArray< MidiBuffer >::removeObject()</a>, <a class="el" href="classAudioBuffer.html#a842674c6e6bd70f27fcbdef7cc76e283">AudioBuffer< float >::reverse()</a>, and <a class="el" href="classAudioBuffer.html#a05e3b4cec4a2c446df87de34c2788f7b">AudioBuffer< float >::setSize()</a>.</p>
</div>
</div>
<a id="a912268a681322c1234753bd580bf1f89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a912268a681322c1234753bd580bf1f89">§ </a></span>operator void *()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator void * </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a void pointer to the allocated data. </p>
<p>This may be a null pointer if the data hasn't yet been allocated, or if it has been freed by calling the <a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f" title="Frees any currently-allocated data. ">free()</a> method. </p>
</div>
</div>
<a id="af51c07aad68df37e185d1f452a5ace97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af51c07aad68df37e185d1f452a5ace97">§ </a></span>operator const void *()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator const void * </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a void pointer to the allocated data. </p>
<p>This may be a null pointer if the data hasn't yet been allocated, or if it has been freed by calling the <a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f" title="Frees any currently-allocated data. ">free()</a> method. </p>
</div>
</div>
<a id="ad7d495cdad2d794c5fc544e54d43caa2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad7d495cdad2d794c5fc544e54d43caa2">§ </a></span>operator->()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ElementType* <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator-> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Lets you use indirect calls to the first element in the array. </p>
<p>Obviously this will cause problems if the array hasn't been initialised, because it'll be referencing a null pointer. </p>
</div>
</div>
<a id="a4fde2d780504edd9e7a33efe0c24ab9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fde2d780504edd9e7a33efe0c24ab9c">§ </a></span>operator[]()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<div class="memtemplate">
template<typename IndexType > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ElementType& <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator[] </td>
<td>(</td>
<td class="paramtype">IndexType </td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a reference to one of the data elements. </p>
<p>Obviously there's no bounds-checking here, as this object is just a dumb pointer and has no idea of the size it currently has allocated. </p>
</div>
</div>
<a id="ae5769755baa56702235ecf2edc68f808"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae5769755baa56702235ecf2edc68f808">§ </a></span>operator+()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<div class="memtemplate">
template<typename IndexType > </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ElementType* <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator+ </td>
<td>(</td>
<td class="paramtype">IndexType </td>
<td class="paramname"><em>index</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a pointer to a data element at an offset from the start of the array. </p>
<p>This is the same as doing pointer arithmetic on the raw pointer itself. </p>
</div>
</div>
<a id="a4e298218cf588337359db82edd07e497"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e298218cf588337359db82edd07e497">§ </a></span>operator==()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator== </td>
<td>(</td>
<td class="paramtype">const ElementType *const </td>
<td class="paramname"><em>otherPointer</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Compares the pointer with another pointer. </p>
<p>This can be handy for checking whether this is a null pointer. </p>
</div>
</div>
<a id="a02ba60581374bc14ffc29d208937d0ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02ba60581374bc14ffc29d208937d0ae">§ </a></span>operator!=()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::operator!= </td>
<td>(</td>
<td class="paramtype">const ElementType *const </td>
<td class="paramname"><em>otherPointer</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Compares the pointer with another pointer. </p>
<p>This can be handy for checking whether this is a null pointer. </p>
</div>
</div>
<a id="a1a196c4ebdb6a5ff9517e262b91894cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a196c4ebdb6a5ff9517e262b91894cf">§ </a></span>malloc()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::malloc </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>newNumElements</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>elementSize</em> = <code>sizeof (ElementType)</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a specified amount of memory. </p>
<p>This uses the normal malloc to allocate an amount of memory for this object. Any previously allocated memory will be freed by this method.</p>
<p>The number of bytes allocated will be (newNumElements * elementSize). Normally you wouldn't need to specify the second parameter, but it can be handy if you need to allocate a size in bytes rather than in terms of the number of elements.</p>
<p>The data that is allocated will be freed when this object is deleted, or when you call <a class="el" href="classHeapBlock.html#a8ec3fb69997d6f530d60cb5e0969f97f" title="Frees any currently-allocated data. ">free()</a> or any of the allocation methods. </p>
<p>Referenced by <a class="el" href="classAudioBuffer.html#a842674c6e6bd70f27fcbdef7cc76e283">AudioBuffer< float >::reverse()</a>.</p>
</div>
</div>
<a id="a59dc4dfb0d05906164f4362b2086cd50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59dc4dfb0d05906164f4362b2086cd50">§ </a></span>calloc()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::calloc </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>newNumElements</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>elementSize</em> = <code>sizeof (ElementType)</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a specified amount of memory and clears it. </p>
<p>This does the same job as the <a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf" title="Allocates a specified amount of memory. ">malloc()</a> method, but clears the memory that it allocates. </p>
<p>Referenced by <a class="el" href="classAudioUnitHelpers_1_1ChannelRemapper.html#a4cce2263d3c691c3560e866a6d4446d0">AudioUnitHelpers::ChannelRemapper::get()</a>.</p>
</div>
</div>
<a id="a4e999ff1f7ed59dd4546596447059cc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e999ff1f7ed59dd4546596447059cc7">§ </a></span>allocate()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::allocate </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>newNumElements</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"><em>initialiseToZero</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocates a specified amount of memory and optionally clears it. </p>
<p>This does the same job as either <a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf" title="Allocates a specified amount of memory. ">malloc()</a> or <a class="el" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50" title="Allocates a specified amount of memory and clears it. ">calloc()</a>, depending on the initialiseToZero parameter. </p>
<p>Referenced by <a class="el" href="classAudioBuffer.html#a05e3b4cec4a2c446df87de34c2788f7b">AudioBuffer< float >::setSize()</a>.</p>
</div>
</div>
<a id="a75f22feaa5bb7278e6a6234ec5d19778"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75f22feaa5bb7278e6a6234ec5d19778">§ </a></span>realloc()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::realloc </td>
<td>(</td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>newNumElements</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const size_t </td>
<td class="paramname"><em>elementSize</em> = <code>sizeof (ElementType)</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Re-allocates a specified amount of memory. </p>
<p>The semantics of this method are the same as <a class="el" href="classHeapBlock.html#a1a196c4ebdb6a5ff9517e262b91894cf" title="Allocates a specified amount of memory. ">malloc()</a> and <a class="el" href="classHeapBlock.html#a59dc4dfb0d05906164f4362b2086cd50" title="Allocates a specified amount of memory and clears it. ">calloc()</a>, but it uses <a class="el" href="classHeapBlock.html#a75f22feaa5bb7278e6a6234ec5d19778" title="Re-allocates a specified amount of memory. ">realloc()</a> to keep as much of the existing data as possible. </p>
<p>Referenced by <a class="el" href="classArrayAllocationBase.html#a56354968cbfcf19977aae75b00768df6">ArrayAllocationBase< ProgressBar *, DummyCriticalSection >::setAllocatedSize()</a>.</p>
</div>
</div>
<a id="a8ec3fb69997d6f530d60cb5e0969f97f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ec3fb69997d6f530d60cb5e0969f97f">§ </a></span>free()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::free </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Frees any currently-allocated data. </p>
<p>This will free the data and reset this object to be a null pointer. </p>
<p>Referenced by <a class="el" href="classArrayAllocationBase.html#a56354968cbfcf19977aae75b00768df6">ArrayAllocationBase< ProgressBar *, DummyCriticalSection >::setAllocatedSize()</a>, and <a class="el" href="classAudioBuffer.html#ab2daca36339708bc76e01fea7b7b3059">AudioBuffer< float >::setDataToReferTo()</a>.</p>
</div>
</div>
<a id="a7ebc384a5d3f8ccfb56229688a0a273c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ebc384a5d3f8ccfb56229688a0a273c">§ </a></span>swapWith()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<div class="memtemplate">
template<bool otherBlockThrows> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::swapWith </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, otherBlockThrows > & </td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Swaps this object's data with the data of another <a class="el" href="classHeapBlock.html" title="Very simple container class to hold a pointer to some data on the heap. ">HeapBlock</a>. </p>
<p>The two objects simply exchange their data pointers. </p>
<p>Referenced by <a class="el" href="classAudioBuffer.html#a05e3b4cec4a2c446df87de34c2788f7b">AudioBuffer< float >::setSize()</a>, and <a class="el" href="classArrayAllocationBase.html#a48910e0a2c0c3243c8fee9226d2d158a">ArrayAllocationBase< ProgressBar *, DummyCriticalSection >::swapWith()</a>.</p>
</div>
</div>
<a id="a658838e2b07f498b169c87c73040b509"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a658838e2b07f498b169c87c73040b509">§ </a></span>clear()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<class ElementType, bool throwOnFailure = false> </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classHeapBlock.html">HeapBlock</a>< ElementType, throwOnFailure >::clear </td>
<td>(</td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>numElements</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This fills the block with zeros, up to the number of elements specified. </p>
<p>Since the block has no way of knowing its own size, you must make sure that the number of elements you specify doesn't exceed the allocated size. </p>
<p>Referenced by <a class="el" href="classAudioBuffer.html#a05e3b4cec4a2c446df87de34c2788f7b">AudioBuffer< float >::setSize()</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__HeapBlock_8h.html">juce_HeapBlock.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content © ROLI Ltd.</small></address><br/>
</body>
</html>
|