TracktionEngine
Public Member Functions | List of all members
tracktion::engine::SortedValueTreeObjectList< ObjectType > Struct Template Referenceabstract
Inheritance diagram for tracktion::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. More...
 
virtual bool isSortableProperty (juce::ValueTree &, const juce::Identifier &)=0
 Should return true if the given Identifier is used to sort the tree. More...
 
virtual bool objectsAreSorted (const ObjectType &first, const ObjectType &second)=0
 Should return true if the objects are in a sorted order. More...
 
const juce::Array< ObjectType * > & getSortedObjects () const
 Returns the object for a given state. More...
 
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 tracktion::engine::ValueTreeObjectList< ObjectType, CriticalSectionType >
using ScopedLockType = typename CriticalSectionType::ScopedLockType
 
- Protected Member Functions inherited from tracktion::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 tracktion::engine::ValueTreeObjectList< ObjectType, CriticalSectionType >
juce::ValueTree parent
 
juce::Array< ObjectType * > objects
 
CriticalSectionType arrayLock
 

Constructor & Destructor Documentation

◆ SortedValueTreeObjectList()

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

Member Function Documentation

◆ sortObjects()

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

◆ isSortableProperty()

template<typename ObjectType >
virtual bool tracktion::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 tracktion::engine::SortedValueTreeObjectList< ObjectType >::valueTreePropertyChanged().

◆ objectsAreSorted()

template<typename ObjectType >
virtual bool tracktion::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*>& tracktion::engine::SortedValueTreeObjectList< ObjectType >::getSortedObjects ( ) const

Returns the object for a given state.

References tracktion::engine::SortedValueTreeObjectList< ObjectType >::sortObjects().

◆ newObjectAdded()

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

◆ objectOrderChanged()

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

◆ valueTreePropertyChanged()

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

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