TracktionEngine
Loading...
Searching...
No Matches
engine::SortedValueTreeObjectList< ObjectType > Struct Template Referenceabstract

#include <tracktion_ValueTreeUtilities.h>

Inheritance diagram for engine::SortedValueTreeObjectList< ObjectType >:

Public Member Functions

 SortedValueTreeObjectList (const juce::ValueTree &v)
virtual void sortObjects (juce::Array< ObjectType * > &objectsToBeSorted) const =0
 Must sort the given array.
virtual bool isSortableProperty (juce::ValueTree &, const juce::Identifier &)=0
 Should return true if the given Identifier is used to sort the tree.
virtual bool objectsAreSorted (const ObjectType &first, const ObjectType &second)=0
 Should return true if the objects are in a sorted order.
const juce::Array< ObjectType * > & getSortedObjects () const
 Returns the object for a given state.
void newObjectAdded (ObjectType *o) override
void objectOrderChanged () override
void valueTreePropertyChanged (juce::ValueTree &v, const juce::Identifier &id) override

Additional Inherited Members

Protected Types inherited from engine::ValueTreeObjectList< ObjectType, CriticalSectionType >
using ScopedLockType = typename CriticalSectionType::ScopedLockType
Protected Member Functions inherited from engine::ValueTreeObjectList< ObjectType, CriticalSectionType >
void deleteAllObjects ()
bool isChildTree (juce::ValueTree &v) const
int indexOf (const juce::ValueTree &v) const noexcept
void sortArray ()
 ValueTreeObjectList (const juce::ValueTree &parentTree)
 ~ValueTreeObjectList () override
int size () const
bool isEmpty () const noexcept
ObjectType * operator[] (int idx) const
ObjectType * at (int idx)
ObjectType ** begin ()
ObjectType *const * begin () const
ObjectType ** end ()
ObjectType *const * end () const
void rebuildObjects ()
void freeObjects ()
virtual bool isSuitableType (const juce::ValueTree &) const =0
virtual ObjectType * createNewObject (const juce::ValueTree &)=0
virtual void deleteObject (ObjectType *)=0
virtual void objectRemoved (ObjectType *)=0
void valueTreeChildAdded (juce::ValueTree &, juce::ValueTree &tree) override
void valueTreeChildRemoved (juce::ValueTree &exParent, juce::ValueTree &tree, int) override
void valueTreeChildOrderChanged (juce::ValueTree &tree, int, int) override
void valueTreePropertyChanged (juce::ValueTree &, const juce::Identifier &) override
void valueTreeParentChanged (juce::ValueTree &) override
void valueTreeRedirected (juce::ValueTree &) override
int compareElements (ObjectType *first, ObjectType *second) const
Protected Attributes inherited from engine::ValueTreeObjectList< ObjectType, CriticalSectionType >
juce::ValueTree parent
juce::Array< ObjectType * > objects
CriticalSectionType arrayLock

Constructor & Destructor Documentation

◆ SortedValueTreeObjectList()

template<typename ObjectType>
engine::SortedValueTreeObjectList< ObjectType >::SortedValueTreeObjectList ( const juce::ValueTree & v)

Member Function Documentation

◆ sortObjects()

template<typename ObjectType>
virtual void engine::SortedValueTreeObjectList< ObjectType >::sortObjects ( juce::Array< ObjectType * > & objectsToBeSorted) const
pure virtual

Must sort the given array.

Referenced by getSortedObjects().

◆ isSortableProperty()

template<typename ObjectType>
virtual bool engine::SortedValueTreeObjectList< ObjectType >::isSortableProperty ( juce::ValueTree & ,
const juce::Identifier &  )
pure virtual

Should return true if the given Identifier is used to sort the tree.

This will be called when one of the items properties changes so this should return true if that property means the objects should now be in a different order.

Referenced by valueTreePropertyChanged().

◆ objectsAreSorted()

template<typename ObjectType>
virtual bool engine::SortedValueTreeObjectList< ObjectType >::objectsAreSorted ( const ObjectType & first,
const ObjectType & second )
pure virtual

Should return true if the objects are in a sorted order.

This might look at a property of the objects (i.e. a start time) to determine their order.

◆ getSortedObjects()

template<typename ObjectType>
const juce::Array< ObjectType * > & engine::SortedValueTreeObjectList< ObjectType >::getSortedObjects ( ) const

Returns the object for a given state.

References engine::ValueTreeObjectList< ObjectType, CriticalSectionType >::objects, and sortObjects().

◆ newObjectAdded()

template<typename ObjectType>
void engine::SortedValueTreeObjectList< ObjectType >::newObjectAdded ( ObjectType * o)
overridevirtual

◆ objectOrderChanged()

template<typename ObjectType>
void engine::SortedValueTreeObjectList< ObjectType >::objectOrderChanged ( )
overridevirtual

◆ valueTreePropertyChanged()

template<typename ObjectType>
void engine::SortedValueTreeObjectList< ObjectType >::valueTreePropertyChanged ( juce::ValueTree & v,
const juce::Identifier & id )
override

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