TracktionEngine
Public Types | Public Member Functions | List of all members
tracktion::engine::SelectableList Struct Reference

A list of Selectables, similar to a juce::Array but contains a cached list of the SelectableClasses for each entry. More...

Public Types

using ScopedLockType = juce::Array< Selectable * >::ScopedLockType
 

Public Member Functions

 SelectableList ()=default
 
 SelectableList (const std::initializer_list< Selectable * > &initialItems)
 
template<typename SelectableType >
 SelectableList (const juce::Array< SelectableType * > &initialItems)
 
template<typename SelectableType >
 SelectableList (const juce::ReferenceCountedArray< SelectableType > &initialItems)
 
SelectableClassgetSelectableClass (int index) const
 Returns the selectable class for a given Selectable in the list. More...
 
std::pair< Selectable *, SelectableClass * > getSelectableAndClass (int index) const
 Returns the selectable and it's associated class. More...
 
template<typename SubclassType >
juce::Array< SubclassType * > getItemsOfType () const
 
template<typename SubclassType >
SubclassType * getFirstOfType () const
 
template<typename SubclassType >
bool containsType () const
 
int size () const
 
bool isEmpty () const
 
bool isNotEmpty () const
 
Selectable ** begin ()
 
Selectable *const * begin () const
 
Selectable ** end ()
 
Selectable *const * end () const
 
Selectable ** data ()
 
Selectable *const * data () const
 
Selectableoperator[] (int index) const
 
SelectablegetUnchecked (int index) const
 
SelectablegetFirst () const
 
SelectablegetLast () const
 
template<class OtherArrayType >
void addArray (const OtherArrayType &arrayToAddFrom, int startIndex=0, int numElementsToAdd=-1)
 
template<class OtherArrayType >
void mergeArray (const OtherArrayType &arrayToMergeFrom)
 
void add (Selectable *newElement)
 
bool addIfNotAlreadyThere (Selectable *newElement)
 
void clear ()
 
void remove (int indexToRemove)
 
int removeAllInstancesOf (Selectable *s)
 
SelectableremoveAndReturn (int indexToRemove)
 
bool contains (Selectable *elementToLookFor) const
 
int indexOf (Selectable *elementToLookFor) const
 
juce::Array< Selectable::WeakRefgetAsWeakRefList () const
 
template<class OtherArrayType >
bool operator== (const OtherArrayType &other) const
 
template<class OtherArrayType >
bool operator!= (const OtherArrayType &other) const
 
bool operator== (const SelectableList &other) const
 
bool operator!= (const SelectableList &other) const
 
const juce::DummyCriticalSection & getLock () const noexcept
 

Detailed Description

A list of Selectables, similar to a juce::Array but contains a cached list of the SelectableClasses for each entry.

Member Typedef Documentation

◆ ScopedLockType

Constructor & Destructor Documentation

◆ SelectableList() [1/4]

tracktion::engine::SelectableList::SelectableList ( )
default

◆ SelectableList() [2/4]

tracktion::engine::SelectableList::SelectableList ( const std::initializer_list< Selectable * > &  initialItems)

◆ SelectableList() [3/4]

template<typename SelectableType >
tracktion::engine::SelectableList::SelectableList ( const juce::Array< SelectableType * > &  initialItems)

◆ SelectableList() [4/4]

template<typename SelectableType >
tracktion::engine::SelectableList::SelectableList ( const juce::ReferenceCountedArray< SelectableType > &  initialItems)

Member Function Documentation

◆ getSelectableClass()

SelectableClass* tracktion::engine::SelectableList::getSelectableClass ( int  index) const

Returns the selectable class for a given Selectable in the list.

◆ getSelectableAndClass()

std::pair<Selectable*, SelectableClass*> tracktion::engine::SelectableList::getSelectableAndClass ( int  index) const

Returns the selectable and it's associated class.

N.B. This does no bounds checking so make sure index is in range!

◆ getItemsOfType()

template<typename SubclassType >
juce::Array<SubclassType*> tracktion::engine::SelectableList::getItemsOfType ( ) const

◆ getFirstOfType()

template<typename SubclassType >
SubclassType* tracktion::engine::SelectableList::getFirstOfType ( ) const

◆ containsType()

template<typename SubclassType >
bool tracktion::engine::SelectableList::containsType ( ) const

◆ size()

int tracktion::engine::SelectableList::size ( ) const

◆ isEmpty()

bool tracktion::engine::SelectableList::isEmpty ( ) const

Referenced by isNotEmpty().

◆ isNotEmpty()

bool tracktion::engine::SelectableList::isNotEmpty ( ) const

References isEmpty().

◆ begin() [1/2]

Selectable** tracktion::engine::SelectableList::begin ( )

Referenced by data().

◆ begin() [2/2]

Selectable* const* tracktion::engine::SelectableList::begin ( ) const

◆ end() [1/2]

Selectable** tracktion::engine::SelectableList::end ( )

◆ end() [2/2]

Selectable* const* tracktion::engine::SelectableList::end ( ) const

◆ data() [1/2]

Selectable** tracktion::engine::SelectableList::data ( )

References begin().

◆ data() [2/2]

Selectable* const* tracktion::engine::SelectableList::data ( ) const

References begin().

◆ operator[]()

Selectable* tracktion::engine::SelectableList::operator[] ( int  index) const

◆ getUnchecked()

Selectable* tracktion::engine::SelectableList::getUnchecked ( int  index) const

◆ getFirst()

Selectable* tracktion::engine::SelectableList::getFirst ( ) const

◆ getLast()

Selectable* tracktion::engine::SelectableList::getLast ( ) const

◆ addArray()

template<class OtherArrayType >
void tracktion::engine::SelectableList::addArray ( const OtherArrayType &  arrayToAddFrom,
int  startIndex = 0,
int  numElementsToAdd = -1 
)

◆ mergeArray()

template<class OtherArrayType >
void tracktion::engine::SelectableList::mergeArray ( const OtherArrayType &  arrayToMergeFrom)

◆ add()

void tracktion::engine::SelectableList::add ( Selectable newElement)

◆ addIfNotAlreadyThere()

bool tracktion::engine::SelectableList::addIfNotAlreadyThere ( Selectable newElement)

Referenced by mergeArray().

◆ clear()

void tracktion::engine::SelectableList::clear ( )

◆ remove()

void tracktion::engine::SelectableList::remove ( int  indexToRemove)

◆ removeAllInstancesOf()

int tracktion::engine::SelectableList::removeAllInstancesOf ( Selectable s)

◆ removeAndReturn()

Selectable* tracktion::engine::SelectableList::removeAndReturn ( int  indexToRemove)

◆ contains()

bool tracktion::engine::SelectableList::contains ( Selectable elementToLookFor) const

◆ indexOf()

int tracktion::engine::SelectableList::indexOf ( Selectable elementToLookFor) const

◆ getAsWeakRefList()

juce::Array<Selectable::WeakRef> tracktion::engine::SelectableList::getAsWeakRefList ( ) const

◆ operator==() [1/2]

template<class OtherArrayType >
bool tracktion::engine::SelectableList::operator== ( const OtherArrayType &  other) const

◆ operator!=() [1/2]

template<class OtherArrayType >
bool tracktion::engine::SelectableList::operator!= ( const OtherArrayType &  other) const

◆ operator==() [2/2]

bool tracktion::engine::SelectableList::operator== ( const SelectableList other) const

◆ operator!=() [2/2]

bool tracktion::engine::SelectableList::operator!= ( const SelectableList other) const

◆ getLock()

const juce::DummyCriticalSection& tracktion::engine::SelectableList::getLock ( ) const
noexcept

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