JUCE
Public Member Functions | Public Attributes | List of all members
juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse > Class Template Reference

Implements some basic array storage allocation functions. More...

Inherits TypeOfCriticalSectionToUse.

Public Member Functions

 ArrayAllocationBase () noexcept
 Creates an empty array. More...
 
 ~ArrayAllocationBase () noexcept
 Destructor. More...
 
 ArrayAllocationBase (ArrayAllocationBase &&other) noexcept
 
ArrayAllocationBaseoperator= (ArrayAllocationBase &&other) noexcept
 
void setAllocatedSize (int numElements)
 Changes the amount of storage allocated. More...
 
void ensureAllocatedSize (int minNumElements)
 Increases the amount of storage allocated if it is less than a given amount. More...
 
void shrinkToNoMoreThan (int maxNumElements)
 Minimises the amount of storage allocated so that it's no more than the given number of elements. More...
 
void swapWith (ArrayAllocationBase &other) noexcept
 Swap the contents of two objects. More...
 

Public Attributes

HeapBlock< ElementType > elements
 
int numAllocated = 0
 

Detailed Description

template<class ElementType, class TypeOfCriticalSectionToUse>
class juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >

Implements some basic array storage allocation functions.

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.

See also
Array, OwnedArray, ReferenceCountedArray

Constructor & Destructor Documentation

◆ ArrayAllocationBase() [1/2]

template<class ElementType, class TypeOfCriticalSectionToUse>
juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::ArrayAllocationBase ( )
noexcept

Creates an empty array.

◆ ~ArrayAllocationBase()

template<class ElementType, class TypeOfCriticalSectionToUse>
juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::~ArrayAllocationBase ( )
noexcept

Destructor.

◆ ArrayAllocationBase() [2/2]

template<class ElementType, class TypeOfCriticalSectionToUse>
juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::ArrayAllocationBase ( ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse > &&  other)
noexcept

Member Function Documentation

◆ operator=()

template<class ElementType, class TypeOfCriticalSectionToUse>
ArrayAllocationBase& juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::operator= ( ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse > &&  other)
noexcept

◆ setAllocatedSize()

template<class ElementType, class TypeOfCriticalSectionToUse>
void juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::setAllocatedSize ( int  numElements)

◆ ensureAllocatedSize()

template<class ElementType, class TypeOfCriticalSectionToUse>
void juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::ensureAllocatedSize ( int  minNumElements)

◆ shrinkToNoMoreThan()

template<class ElementType, class TypeOfCriticalSectionToUse>
void juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::shrinkToNoMoreThan ( int  maxNumElements)

Minimises the amount of storage allocated so that it's no more than the given number of elements.

Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::minimiseStorageOverheads(), and juce::ReferenceCountedArray< Block >::minimiseStorageOverheads().

◆ swapWith()

template<class ElementType, class TypeOfCriticalSectionToUse>
void juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::swapWith ( ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse > &  other)
noexcept

Member Data Documentation

◆ elements

template<class ElementType, class TypeOfCriticalSectionToUse>
HeapBlock<ElementType> juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::elements

Referenced by juce::OwnedArray< juce::AudioProcessorParameter >::add(), juce::ReferenceCountedArray< Block >::add(), juce::OwnedArray< juce::AudioProcessorParameter >::addArray(), juce::OwnedArray< juce::AudioProcessorParameter >::addCopiesOf(), juce::ReferenceCountedArray< Block >::addOrReplaceSorted(), juce::ReferenceCountedArray< Block >::addSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::addSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::begin(), juce::ReferenceCountedArray< Block >::begin(), juce::OwnedArray< juce::AudioProcessorParameter >::contains(), juce::ReferenceCountedArray< Block >::contains(), juce::OwnedArray< juce::AudioProcessorParameter >::end(), juce::ReferenceCountedArray< Block >::end(), juce::ArrayAllocationBase< juce::TouchList::TouchEntry, DummyCriticalSection >::ensureAllocatedSize(), juce::OwnedArray< juce::AudioProcessorParameter >::getFirst(), juce::ReferenceCountedArray< Block >::getFirst(), juce::OwnedArray< juce::AudioProcessorParameter >::getLast(), juce::ReferenceCountedArray< Block >::getLast(), juce::ReferenceCountedArray< Block >::getObjectPointer(), juce::ReferenceCountedArray< Block >::getObjectPointerUnchecked(), juce::OwnedArray< juce::AudioProcessorParameter >::getRawDataPointer(), juce::ReferenceCountedArray< Block >::getRawDataPointer(), juce::OwnedArray< juce::AudioProcessorParameter >::getUnchecked(), juce::OwnedArray< juce::AudioProcessorParameter >::indexOf(), juce::ReferenceCountedArray< Block >::indexOf(), juce::ReferenceCountedArray< Block >::indexOfSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::indexOfSorted(), juce::OwnedArray< juce::AudioProcessorParameter >::insert(), juce::ReferenceCountedArray< Block >::insert(), juce::OwnedArray< juce::AudioProcessorParameter >::insertArray(), juce::ReferenceCountedArray< Block >::move(), juce::OwnedArray< juce::AudioProcessorParameter >::move(), juce::ArrayAllocationBase< juce::TouchList::TouchEntry, DummyCriticalSection >::operator=(), juce::ReferenceCountedArray< Block >::operator==(), juce::OwnedArray< juce::AudioProcessorParameter >::operator[](), juce::ReferenceCountedArray< Block >::ReferenceCountedArray(), juce::ReferenceCountedArray< Block >::remove(), juce::OwnedArray< juce::AudioProcessorParameter >::remove(), juce::ReferenceCountedArray< Block >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::removeAndReturn(), juce::OwnedArray< juce::AudioProcessorParameter >::removeObject(), juce::ReferenceCountedArray< Block >::removeRange(), juce::OwnedArray< juce::AudioProcessorParameter >::removeRange(), juce::OwnedArray< juce::AudioProcessorParameter >::set(), juce::ReferenceCountedArray< Block >::set(), juce::ArrayAllocationBase< juce::TouchList::TouchEntry, DummyCriticalSection >::setAllocatedSize(), juce::ReferenceCountedArray< Block >::sort(), juce::OwnedArray< juce::AudioProcessorParameter >::sort(), juce::ReferenceCountedArray< Block >::swap(), juce::OwnedArray< juce::AudioProcessorParameter >::swap(), and juce::ArrayAllocationBase< juce::TouchList::TouchEntry, DummyCriticalSection >::swapWith().

◆ numAllocated

template<class ElementType, class TypeOfCriticalSectionToUse>
int juce::ArrayAllocationBase< ElementType, TypeOfCriticalSectionToUse >::numAllocated = 0

The documentation for this class was generated from the following file: