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. More...
 
template<class OtherElementType , class OtherCriticalSection , typename = AllowConversion<OtherElementType, OtherCriticalSection>>
ArrayBaseoperator= (ArrayBase< OtherElementType, OtherCriticalSection > &&other) noexcept
 Converting move assignment operator. More...
 
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
 

Friends

template<class OtherElementType , class OtherCriticalSection >
class ArrayBase
 

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>
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=()

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.


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