A basic object container. More...
#include <juce_ArrayBase.h>
Inherits TypeOfCriticalSectionToUse.
Public Member Functions | |
ArrayBase ()=default | |
ArrayBase (ArrayBase &&other) noexcept | |
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>> | |
ArrayBase (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept | |
Converting move constructor. More... | |
~ArrayBase () | |
void | add (const ElementType &newElement) |
void | add (ElementType &&newElement) |
template<typename... OtherElements> | |
void | add (const ElementType &firstNewElement, OtherElements... otherElements) |
template<typename... OtherElements> | |
void | add (ElementType &&firstNewElement, OtherElements... otherElements) |
template<typename Type > | |
void | addArray (const Type *elementsToAdd, int numElementsToAdd) |
template<typename TypeToCreateFrom > | |
void | addArray (const std::initializer_list< TypeToCreateFrom > &items) |
template<class OtherArrayType > | |
void | addArray (const OtherArrayType &arrayToAddFrom) |
template<class OtherArrayType > | |
std::enable_if<! std::is_pointer< OtherArrayType >::value, int >::type | addArray (const OtherArrayType &arrayToAddFrom, int startIndex, int numElementsToAdd=-1) |
ElementType * | begin () const noexcept |
int | capacity () const noexcept |
void | clear () |
ElementType * | data () const noexcept |
ElementType * | end () const noexcept |
void | ensureAllocatedSize (int minNumElements) |
ElementType | getFirst () const noexcept |
ElementType | getLast () const noexcept |
ElementType | getValueWithDefault (const int index) const noexcept |
void | insert (int indexToInsertAt, ParameterType newElement, int numberOfTimesToInsertIt) |
void | insertArray (int indexToInsertAt, const ElementType *newElements, int numberOfElements) |
void | move (int currentIndex, int newIndex) noexcept |
template<class OtherArrayType > | |
bool | operator!= (const OtherArrayType &other) const noexcept |
ArrayBase & | operator= (ArrayBase &&other) noexcept |
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>> | |
ArrayBase & | operator= (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept |
Converting move assignment operator. More... | |
template<class OtherArrayType > | |
bool | operator== (const OtherArrayType &other) const noexcept |
ElementType & | operator[] (const int index) const noexcept |
void | removeElements (int indexToRemoveAt, int numElementsToRemove) |
void | setAllocatedSize (int numElements) |
void | shrinkToNoMoreThan (int maxNumElements) |
int | size () const noexcept |
void | swap (int index1, int index2) |
void | swapWith (ArrayBase &other) noexcept |
Private Types | |
template<class OtherElementType , class OtherCriticalSection > | |
using | AllowConversion = typename std::enable_if<! std::is_same< std::tuple< ElementType, TypeOfCriticalSectionToUse >, std::tuple< OtherElementType, OtherCriticalSection > >::value >::type |
template<typename T > | |
using | IsTriviallyCopyable = std::is_trivially_copyable< T > |
template<typename T > | |
using | NonTriviallyCopyableVoid = typename std::enable_if<! IsTriviallyCopyable< T >::value, void >::type |
using | ParameterType = typename TypeHelpers::ParameterType< ElementType >::type |
template<typename T > | |
using | TriviallyCopyableVoid = typename std::enable_if< IsTriviallyCopyable< T >::value, void >::type |
Private Member Functions | |
template<typename T = ElementType> | |
TriviallyCopyableVoid< T > | addArrayInternal (const ElementType *otherElements, int numElements) |
template<typename Type , typename T = ElementType> | |
TriviallyCopyableVoid< T > | addArrayInternal (const Type *otherElements, int numElements) |
template<typename Type , typename T = ElementType> | |
NonTriviallyCopyableVoid< T > | addArrayInternal (const Type *otherElements, int numElements) |
void | addAssumingCapacityIsReady (const ElementType &element) |
void | addAssumingCapacityIsReady (ElementType &&element) |
template<typename... OtherElements> | |
void | addAssumingCapacityIsReady (const ElementType &firstNewElement, OtherElements... otherElements) |
template<typename... OtherElements> | |
void | addAssumingCapacityIsReady (ElementType &&firstNewElement, OtherElements... otherElements) |
void | checkSourceIsNotAMember (const ElementType *element) |
ElementType * | createInsertSpace (int indexToInsertAt, int numElements) |
template<typename T = ElementType> | |
TriviallyCopyableVoid< T > | createInsertSpaceInternal (int indexToInsertAt, int numElements) |
template<typename T = ElementType> | |
NonTriviallyCopyableVoid< T > | createInsertSpaceInternal (int indexToInsertAt, int numElements) |
template<typename T = ElementType> | |
std::enable_if< std::is_move_assignable< T >::value, void >::type | moveAssignElement (ElementType *destination, ElementType &&source) |
template<typename T = ElementType> | |
std::enable_if<! std::is_move_assignable< T >::value, void >::type | moveAssignElement (ElementType *destination, ElementType &&source) |
template<typename T = ElementType> | |
TriviallyCopyableVoid< T > | moveInternal (int currentIndex, int newIndex) noexcept |
template<typename T = ElementType> | |
NonTriviallyCopyableVoid< T > | moveInternal (int currentIndex, int newIndex) noexcept |
template<typename T = ElementType> | |
TriviallyCopyableVoid< T > | removeElementsInternal (int indexToRemoveAt, int numElementsToRemove) |
template<typename T = ElementType> | |
NonTriviallyCopyableVoid< T > | removeElementsInternal (int indexToRemoveAt, int numElementsToRemove) |
template<typename T = ElementType> | |
TriviallyCopyableVoid< T > | setAllocatedSizeInternal (int numElements) |
template<typename T = ElementType> | |
NonTriviallyCopyableVoid< T > | setAllocatedSizeInternal (int numElements) |
Private Attributes | |
HeapBlock< ElementType > | elements |
int | numAllocated = 0 |
int | numUsed = 0 |
Friends | |
template<class OtherElementType , class OtherCriticalSection > | |
class | ArrayBase |
A basic object container.
This class isn't really for public use - it's used by the other array classes, but might come in handy for some purposes.
It inherits from a critical section class to allow the arrays to use the "empty base class optimisation" pattern to reduce their footprint.
{Core}
|
private |
|
private |
|
private |
|
private |
|
private |
|
default |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Converting move constructor.
Only enabled when the other array has a different type to this one. If you see a compile error here, it's probably because you're attempting a conversion that HeapBlock won't allow.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlinenoexcept |
Referenced by juce::ReferenceCountedArray< Block >::addOrReplaceSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::addSorted(), juce::ReferenceCountedArray< Block >::addSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::begin(), juce::ReferenceCountedArray< Block >::begin(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::checkSourceIsNotAMember(), juce::OwnedArray< juce::AudioProcessorParameter >::contains(), juce::ReferenceCountedArray< Block >::contains(), juce::OwnedArray< juce::AudioProcessorParameter >::getRawDataPointer(), juce::ReferenceCountedArray< Block >::getRawDataPointer(), juce::OwnedArray< juce::AudioProcessorParameter >::indexOf(), juce::ReferenceCountedArray< Block >::indexOf(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator==(), juce::OwnedArray< juce::AudioProcessorParameter >::remove(), juce::ReferenceCountedArray< Block >::remove(), juce::ReferenceCountedArray< Block >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::sort(), and juce::ReferenceCountedArray< Block >::sort().
|
inlinenoexcept |
Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::remove(), juce::ReferenceCountedArray< Block >::remove(), juce::OwnedArray< juce::AudioProcessorParameter >::removeAndReturn(), juce::ReferenceCountedArray< Block >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::removeRange(), and juce::ReferenceCountedArray< Block >::removeRange().
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlinenoexcept |
|
inlinenoexcept |
Referenced by juce::ReferenceCountedArray< Block >::addArray(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::checkSourceIsNotAMember(), juce::OwnedArray< juce::AudioProcessorParameter >::contains(), juce::ReferenceCountedArray< Block >::contains(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpaceInternal(), juce::OwnedArray< juce::AudioProcessorParameter >::end(), juce::ReferenceCountedArray< Block >::end(), juce::OwnedArray< juce::AudioProcessorParameter >::indexOf(), and juce::ReferenceCountedArray< Block >::indexOf().
|
inline |
Referenced by juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::add(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addArray(), juce::OwnedArray< juce::AudioProcessorParameter >::addCopiesOf(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpace(), juce::OwnedArray< juce::AudioProcessorParameter >::ensureStorageAllocated(), and juce::ReferenceCountedArray< Block >::ensureStorageAllocated().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlineprivate |
|
inlineprivate |
|
inlineprivatenoexcept |
|
inlineprivatenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Converting move assignment operator.
Only enabled when the other array has a different type to this one. If you see a compile error here, it's probably because you're attempting a conversion that HeapBlock won't allow.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::remove(), juce::ReferenceCountedArray< Block >::remove(), juce::OwnedArray< juce::AudioProcessorParameter >::removeAndReturn(), juce::ReferenceCountedArray< Block >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::removeRange(), and juce::ReferenceCountedArray< Block >::removeRange().
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlinenoexcept |
Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::addCopiesOf(), juce::ReferenceCountedArray< Block >::addOrReplaceSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::addSorted(), juce::ReferenceCountedArray< Block >::addSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::indexOfSorted(), juce::ReferenceCountedArray< Block >::indexOfSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::minimiseStorageOverheads(), juce::ReferenceCountedArray< Block >::minimiseStorageOverheads(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator==(), juce::OwnedArray< juce::AudioProcessorParameter >::remove(), juce::ReferenceCountedArray< Block >::remove(), juce::OwnedArray< juce::AudioProcessorParameter >::removeAndReturn(), juce::ReferenceCountedArray< Block >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::removeLast(), juce::ReferenceCountedArray< Block >::removeLast(), juce::OwnedArray< juce::AudioProcessorParameter >::removeObject(), juce::OwnedArray< juce::AudioProcessorParameter >::removeRange(), juce::ReferenceCountedArray< Block >::removeRange(), juce::OwnedArray< juce::AudioProcessorParameter >::set(), juce::ReferenceCountedArray< Block >::set(), juce::OwnedArray< juce::AudioProcessorParameter >::size(), juce::ReferenceCountedArray< Block >::size(), juce::ReferenceCountedArray< Block >::sort(), and juce::ReferenceCountedArray< Block >::swap().
|
inline |
Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::swap().
|
inlinenoexcept |
|
friend |
|
private |
Referenced by juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addArray(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addArrayInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addAssumingCapacityIsReady(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::begin(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::clear(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpace(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpaceInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::data(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::end(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::ensureAllocatedSize(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getFirst(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getLast(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getValueWithDefault(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::moveInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator=(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator[](), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::removeElementsInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::setAllocatedSize(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::setAllocatedSizeInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::swap(), and juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::swapWith().
|
private |
Referenced by juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::capacity(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::ensureAllocatedSize(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator=(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::setAllocatedSize(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::shrinkToNoMoreThan(), and juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::swapWith().
|
private |
Referenced by juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::add(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addArray(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addArrayInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::addAssumingCapacityIsReady(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::clear(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpace(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::createInsertSpaceInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::end(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getFirst(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getLast(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::getValueWithDefault(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::insert(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::insertArray(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::move(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator=(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::operator[](), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::removeElements(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::removeElementsInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::setAllocatedSize(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::setAllocatedSizeInternal(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::size(), juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::swap(), and juce::ArrayBase< IIRCoefficients *, DummyCriticalSection >::swapWith().