TracktionEngine
Loading...
Searching...
No Matches
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...

#include <tracktion_Selectable.h>

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)
template<typename SelectableType>
 SelectableList (const std::vector< SelectableType * > &initialItems)
SelectableClass * getSelectableClass (int index) const
 Returns the selectable class for a given Selectable in the list.
std::pair< Selectable *, SelectableClass * > getSelectableAndClass (int index) const
 Returns the selectable and it's associated class.
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
Selectable * operator[] (int index) const
Selectable * getUnchecked (int index) const
Selectable * getFirst () const
Selectable * getLast () 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)
Selectable * removeAndReturn (int indexToRemove)
bool contains (Selectable *elementToLookFor) const
int indexOf (Selectable *elementToLookFor) 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

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

Constructor & Destructor Documentation

◆ SelectableList() [1/5]

engine::SelectableList::SelectableList ( )
default

Referenced by operator!=(), and operator==().

◆ SelectableList() [2/5]

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

◆ SelectableList() [3/5]

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

◆ SelectableList() [4/5]

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

◆ SelectableList() [5/5]

template<typename SelectableType>
engine::SelectableList::SelectableList ( const std::vector< SelectableType * > & initialItems)

Member Function Documentation

◆ getSelectableClass()

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

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

◆ getSelectableAndClass()

std::pair< Selectable *, SelectableClass * > 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 * > engine::SelectableList::getItemsOfType ( ) const

◆ getFirstOfType()

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

◆ containsType()

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

◆ size()

int engine::SelectableList::size ( ) const

◆ isEmpty()

bool engine::SelectableList::isEmpty ( ) const

Referenced by isNotEmpty().

◆ isNotEmpty()

bool engine::SelectableList::isNotEmpty ( ) const

References isEmpty().

◆ begin() [1/2]

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

Referenced by data(), and data().

◆ begin() [2/2]

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

◆ end() [1/2]

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

◆ end() [2/2]

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

◆ data() [1/2]

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

References begin().

◆ data() [2/2]

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

References begin().

◆ operator[]()

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

◆ getUnchecked()

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

◆ getFirst()

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

◆ getLast()

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

◆ addArray()

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

◆ mergeArray()

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

◆ add()

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

◆ addIfNotAlreadyThere()

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

Referenced by mergeArray().

◆ clear()

void engine::SelectableList::clear ( )

◆ remove()

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

◆ removeAllInstancesOf()

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

◆ removeAndReturn()

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

◆ contains()

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

◆ indexOf()

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

◆ operator==() [1/2]

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

◆ operator!=() [1/2]

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

◆ operator==() [2/2]

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

References SelectableList().

◆ operator!=() [2/2]

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

References SelectableList().

◆ getLock()

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

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