Wraps a HeapBlock, but additionally provides a copy constructor and remembers its size. More...
#include <juce_CopyableHeapBlock.h>


Public Member Functions | |
| CopyableHeapBlock ()=default | |
| Creates an empty block. | |
| CopyableHeapBlock (const CopyableHeapBlock &other) | |
| Copies the contents of another block into this one. | |
| CopyableHeapBlock (CopyableHeapBlock &&other) noexcept | |
| Moves the contents of another block into this one. | |
| CopyableHeapBlock (size_t numElementsIn) | |
| Creates a block large enough to hold the specified number of elements. | |
| ElementType * | begin () |
| Returns a pointer to the first element in the block. | |
| const ElementType * | begin () const |
| Returns a pointer to the first element in the block. | |
| const ElementType * | cbegin () const |
| Returns a pointer to the first element in the block. | |
| const ElementType * | cend () const |
| Returns a pointer immediately after the last element in the block. | |
| ElementType * | data () |
| Returns a pointer to the first element in the block. | |
| const ElementType * | data () const |
| Returns a pointer to the first element in the block. | |
| ElementType * | end () |
| Returns a pointer immediately after the last element in the block. | |
| const ElementType * | end () const |
| Returns a pointer immediately after the last element in the block. | |
| bool | isEmpty () const |
| Returns true if the size of the block is zero. | |
| CopyableHeapBlock & | operator= (const CopyableHeapBlock &other) noexcept |
| Copies the contents of another block into this one. | |
| CopyableHeapBlock & | operator= (CopyableHeapBlock &&other) noexcept |
| Moves the contents of another block into this one. | |
| ElementType & | operator[] (size_t index) |
| Returns a reference to the element at the provided index. | |
| const ElementType & | operator[] (size_t index) const |
| Returns a reference to the element at the provided index. | |
| size_t | size () const |
| Returns the number of elements in the block. | |
Private Member Functions | |
| void | swap (CopyableHeapBlock &other) noexcept |
Private Attributes | |
| HeapBlock< ElementType, throwOnFailure > | block |
| size_t | numElements {} |
Wraps a HeapBlock, but additionally provides a copy constructor and remembers its size.
This class is not intended for use as a general-purpose container - in most cases, a std::vector or juce::Array is a better choice. However, CopyableHeapBlock may be handy for optimisation in situations where the container elements don't need to be value-initialised and the container doesn't need to be resized.
@tags{Core}
|
default |
Creates an empty block.
|
inlineexplicit |
Creates a block large enough to hold the specified number of elements.
The contents of the block are unspecified, and must be written before they are first read.
|
inlinenoexcept |
Moves the contents of another block into this one.
|
inline |
Copies the contents of another block into this one.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::block, and juce::CopyableHeapBlock< ElementType, throwOnFailure >::numElements.
|
inline |
Returns a pointer to the first element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data().
|
inline |
Returns a pointer to the first element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data().
|
inline |
Returns a pointer to the first element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data().
|
inline |
Returns a pointer immediately after the last element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data(), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::size().
|
inline |
Returns a pointer to the first element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::block.
Referenced by juce::CopyableHeapBlock< ElementType, throwOnFailure >::begin(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::begin(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::cbegin(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::cend(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::end(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::end(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::operator[](), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::operator[]().
|
inline |
Returns a pointer to the first element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::block.
|
inline |
Returns a pointer immediately after the last element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data(), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::size().
|
inline |
Returns a pointer immediately after the last element in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data(), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::size().
|
inline |
Returns true if the size of the block is zero.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::size().
|
inlinenoexcept |
Copies the contents of another block into this one.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::swap().
|
inlinenoexcept |
Moves the contents of another block into this one.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::swap().
|
inline |
Returns a reference to the element at the provided index.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data().
|
inline |
Returns a reference to the element at the provided index.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::data().
|
inline |
Returns the number of elements in the block.
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::numElements.
Referenced by juce::CopyableHeapBlock< ElementType, throwOnFailure >::cend(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::end(), juce::CopyableHeapBlock< ElementType, throwOnFailure >::end(), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::isEmpty().
|
inlineprivatenoexcept |
References juce::CopyableHeapBlock< ElementType, throwOnFailure >::block, and juce::CopyableHeapBlock< ElementType, throwOnFailure >::numElements.
Referenced by juce::CopyableHeapBlock< ElementType, throwOnFailure >::operator=(), and juce::CopyableHeapBlock< ElementType, throwOnFailure >::operator=().
|
private |
|
private |