OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce::ArrayBase< ElementType, TypeOfCriticalSectionToUse > Class Template Reference

#include <juce_ArrayBase.h>

Inherits 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
 
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
ArrayBaseoperator= (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept
 
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) noexcept
 
const ElementType & operator[] (const int index) const noexcept
 
ElementType getValueWithDefault (const int index) const noexcept
 
ElementType getFirst () const noexcept
 
ElementType getLast () const noexcept
 
ElementType * begin () noexcept
 
const ElementType * begin () const noexcept
 
ElementType * end () noexcept
 
const ElementType * end () const noexcept
 
ElementType * data () noexcept
 
const 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 40 of file juce_ArrayBase.h.

Constructor & Destructor Documentation

◆ ~ArrayBase()

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

Definition at line 53 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 58 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 86 of file juce_ArrayBase.h.

Member Function Documentation

◆ add() [1/4]

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

Definition at line 271 of file juce_ArrayBase.h.

◆ add() [2/4]

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

Definition at line 256 of file juce_ArrayBase.h.

◆ add() [3/4]

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

Definition at line 279 of file juce_ArrayBase.h.

◆ add() [4/4]

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

Definition at line 263 of file juce_ArrayBase.h.

◆ addArray() [1/4]

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

Definition at line 305 of file juce_ArrayBase.h.

◆ addArray() [2/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 316 of file juce_ArrayBase.h.

◆ addArray() [3/4]

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

Definition at line 296 of file juce_ArrayBase.h.

◆ addArray() [4/4]

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

Definition at line 288 of file juce_ArrayBase.h.

◆ begin() [1/2]

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

Definition at line 174 of file juce_ArrayBase.h.

◆ begin() [2/2]

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

Definition at line 169 of file juce_ArrayBase.h.

◆ capacity()

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

Definition at line 204 of file juce_ArrayBase.h.

◆ clear()

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

Definition at line 239 of file juce_ArrayBase.h.

◆ data() [1/2]

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

Definition at line 194 of file juce_ArrayBase.h.

◆ data() [2/2]

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

Definition at line 189 of file juce_ArrayBase.h.

◆ end() [1/2]

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

Definition at line 184 of file juce_ArrayBase.h.

◆ end() [2/2]

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

Definition at line 179 of file juce_ArrayBase.h.

◆ ensureAllocatedSize()

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

Definition at line 225 of file juce_ArrayBase.h.

◆ getFirst()

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

Definition at line 158 of file juce_ArrayBase.h.

◆ getLast()

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

Definition at line 163 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 153 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 336 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 347 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 383 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 133 of file juce_ArrayBase.h.

◆ operator=() [1/2]

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

Definition at line 67 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 103 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 118 of file juce_ArrayBase.h.

◆ operator[]() [1/2]

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

Definition at line 146 of file juce_ArrayBase.h.

◆ operator[]() [2/2]

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

Definition at line 139 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 358 of file juce_ArrayBase.h.

◆ setAllocatedSize()

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

Definition at line 210 of file juce_ArrayBase.h.

◆ shrinkToNoMoreThan()

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

Definition at line 233 of file juce_ArrayBase.h.

◆ size()

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

Definition at line 199 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 372 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 248 of file juce_ArrayBase.h.


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