OpenShot Library | libopenshot-audio 0.2.0
juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse > Class Template Reference

A basic object container. More...

#include <juce_ArrayBase.h>

+ Inheritance diagram for juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >:

Public Member Functions

 ArrayBase (ArrayBase &&other) noexcept
 
ArrayBaseoperator= (ArrayBase &&other) noexcept
 
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
 ArrayBase (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept
 Converting move constructor.
 
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
ArrayBaseoperator= (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept
 Converting move assignment operator.
 
template<class OtherArrayType >
bool operator== (const OtherArrayType &other) const noexcept
 
template<class OtherArrayType >
bool operator!= (const OtherArrayType &other) const noexcept
 
ElementType & operator[] (const int index) const noexcept
 
ElementType getValueWithDefault (const int index) const noexcept
 
ElementType getFirst () const noexcept
 
ElementType getLast () const noexcept
 
ElementType * begin () const noexcept
 
ElementType * end () const noexcept
 
ElementType * data () const noexcept
 
int size () const noexcept
 
int capacity () const noexcept
 
void setAllocatedSize (int numElements)
 
void ensureAllocatedSize (int minNumElements)
 
void shrinkToNoMoreThan (int maxNumElements)
 
void clear ()
 
void swapWith (ArrayBase &other) noexcept
 
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)
 
void insert (int indexToInsertAt, ParameterType newElement, int numberOfTimesToInsertIt)
 
void insertArray (int indexToInsertAt, const ElementType *newElements, int numberOfElements)
 
void removeElements (int indexToRemoveAt, int numElementsToRemove)
 
void swap (int index1, int index2)
 
void move (int currentIndex, int newIndex) noexcept
 

Detailed Description

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

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.

See also
Array, OwnedArray, ReferenceCountedArray

Definition at line 44 of file juce_ArrayBase.h.

Constructor & Destructor Documentation

◆ ~ArrayBase()

template<class ElementType , class TypeOfCriticalSectionToUse >
juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::~ArrayBase ( )
inline

Definition at line 57 of file juce_ArrayBase.h.

◆ ArrayBase() [1/2]

template<class ElementType , class TypeOfCriticalSectionToUse >
juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::ArrayBase ( ArrayBase< ElementType, TypeOfCriticalSectionToUse > &&  other)
inlinenoexcept

Definition at line 62 of file juce_ArrayBase.h.

◆ ArrayBase() [2/2]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::ArrayBase ( ArrayBase< OtherElementType, OtherCriticalSection > &&  other)
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.

Definition at line 90 of file juce_ArrayBase.h.

Member Function Documentation

◆ operator=() [1/2]

template<class ElementType , class TypeOfCriticalSectionToUse >
ArrayBase & juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::operator= ( ArrayBase< ElementType, TypeOfCriticalSectionToUse > &&  other)
inlinenoexcept

Definition at line 71 of file juce_ArrayBase.h.

◆ operator=() [2/2]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
ArrayBase & juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::operator= ( ArrayBase< OtherElementType, OtherCriticalSection > &&  other)
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.

Definition at line 107 of file juce_ArrayBase.h.

◆ operator==()

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherArrayType >
bool juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::operator== ( const OtherArrayType &  other) const
inlinenoexcept

Definition at line 122 of file juce_ArrayBase.h.

◆ operator!=()

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherArrayType >
bool juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::operator!= ( const OtherArrayType &  other) const
inlinenoexcept

Definition at line 137 of file juce_ArrayBase.h.

◆ operator[]()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType & juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::operator[] ( const int  index) const
inlinenoexcept

Definition at line 143 of file juce_ArrayBase.h.

◆ getValueWithDefault()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::getValueWithDefault ( const int  index) const
inlinenoexcept

Definition at line 150 of file juce_ArrayBase.h.

◆ getFirst()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::getFirst ( ) const
inlinenoexcept

Definition at line 155 of file juce_ArrayBase.h.

◆ getLast()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::getLast ( ) const
inlinenoexcept

Definition at line 160 of file juce_ArrayBase.h.

◆ begin()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType * juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::begin ( ) const
inlinenoexcept

Definition at line 166 of file juce_ArrayBase.h.

◆ end()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType * juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::end ( ) const
inlinenoexcept

Definition at line 171 of file juce_ArrayBase.h.

◆ data()

template<class ElementType , class TypeOfCriticalSectionToUse >
ElementType * juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::data ( ) const
inlinenoexcept

Definition at line 176 of file juce_ArrayBase.h.

◆ size()

template<class ElementType , class TypeOfCriticalSectionToUse >
int juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::size ( ) const
inlinenoexcept

Definition at line 181 of file juce_ArrayBase.h.

◆ capacity()

template<class ElementType , class TypeOfCriticalSectionToUse >
int juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::capacity ( ) const
inlinenoexcept

Definition at line 186 of file juce_ArrayBase.h.

◆ setAllocatedSize()

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

Definition at line 192 of file juce_ArrayBase.h.

◆ ensureAllocatedSize()

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

Definition at line 207 of file juce_ArrayBase.h.

◆ shrinkToNoMoreThan()

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

Definition at line 215 of file juce_ArrayBase.h.

◆ clear()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::clear ( )
inline

Definition at line 221 of file juce_ArrayBase.h.

◆ swapWith()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::swapWith ( ArrayBase< ElementType, TypeOfCriticalSectionToUse > &  other)
inlinenoexcept

Definition at line 230 of file juce_ArrayBase.h.

◆ add() [1/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::add ( const ElementType &  newElement)
inline

Definition at line 238 of file juce_ArrayBase.h.

◆ add() [2/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::add ( ElementType &&  newElement)
inline

Definition at line 245 of file juce_ArrayBase.h.

◆ add() [3/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<typename... OtherElements>
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::add ( const ElementType &  firstNewElement,
OtherElements...  otherElements 
)
inline

Definition at line 253 of file juce_ArrayBase.h.

◆ add() [4/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<typename... OtherElements>
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::add ( ElementType &&  firstNewElement,
OtherElements...  otherElements 
)
inline

Definition at line 261 of file juce_ArrayBase.h.

◆ addArray() [1/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<typename Type >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::addArray ( const Type *  elementsToAdd,
int  numElementsToAdd 
)
inline

Definition at line 270 of file juce_ArrayBase.h.

◆ addArray() [2/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<typename TypeToCreateFrom >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::addArray ( const std::initializer_list< TypeToCreateFrom > &  items)
inline

Definition at line 278 of file juce_ArrayBase.h.

◆ addArray() [3/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherArrayType >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::addArray ( const OtherArrayType &  arrayToAddFrom)
inline

Definition at line 287 of file juce_ArrayBase.h.

◆ addArray() [4/4]

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherArrayType >
std::enable_if<!std::is_pointer< OtherArrayType >::value, int >::type juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::addArray ( const OtherArrayType &  arrayToAddFrom,
int  startIndex,
int  numElementsToAdd = -1 
)
inline

Definition at line 298 of file juce_ArrayBase.h.

◆ insert()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::insert ( int  indexToInsertAt,
ParameterType  newElement,
int  numberOfTimesToInsertIt 
)
inline

Definition at line 318 of file juce_ArrayBase.h.

◆ insertArray()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::insertArray ( int  indexToInsertAt,
const ElementType *  newElements,
int  numberOfElements 
)
inline

Definition at line 329 of file juce_ArrayBase.h.

◆ removeElements()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::removeElements ( int  indexToRemoveAt,
int  numElementsToRemove 
)
inline

Definition at line 340 of file juce_ArrayBase.h.

◆ swap()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::swap ( int  index1,
int  index2 
)
inline

Definition at line 354 of file juce_ArrayBase.h.

◆ move()

template<class ElementType , class TypeOfCriticalSectionToUse >
void juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse >::move ( int  currentIndex,
int  newIndex 
)
inlinenoexcept

Definition at line 365 of file juce_ArrayBase.h.

Friends And Related Symbol Documentation

◆ ArrayBase

template<class ElementType , class TypeOfCriticalSectionToUse >
template<class OtherElementType , class OtherCriticalSection >
friend class ArrayBase
friend

Definition at line 595 of file juce_ArrayBase.h.


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