multithreading
 All Classes Functions Variables Pages
Classes | Public Member Functions | Public Attributes | List of all members
CriticalThreadValueTree Class Reference

Maintain a clone of a ValueTree on a critical thread. More...

#include <value_tree_clone.h>

Inheritance diagram for CriticalThreadValueTree:

Public Member Functions

 CriticalThreadValueTree (ValueTree source, LockFreeCallQueue &q)
 Configure the CriticalThreadValueTree. More...
 
void setSource (ValueTree source)
 set the source tree to copy. This is set initally by the constructor, so you may not need to call this function.
 
void valueTreeChildAdded (ValueTree &parentTree, ValueTree &childWhichHasBeenAdded)
 
void valueTreeChildRemoved (ValueTree &parentTree, ValueTree &childWhichHasBeenRemoved)
 
void valueTreeChildOrderChanged (ValueTree &parentTreeWhoseChildrenHaveMoved)
 
void valueTreeParentChanged (ValueTree &treeWhoseParentHasChanged)
 
void syncAll ()
 Synchronise. You shouldn't have to call this. It should be called automatically from the non-critical thread when the ValueTree changes.
 
void valueTreePropertyChanged (ValueTree &tree, const Identifier &property)
 

Public Attributes

ValueTreeCopy::Ptr readonly
 The output - the clone of the ValueTree. More...
 

Detailed Description

Maintain a clone of a ValueTree on a critical thread.

Maintains a clone of a value tree for a critical thread. For example for passing complex configuration from a GUI to an audio processing thread.

Note
Simple properties (Strings, integers and so on) are updated with a simple message. Adding properties or children results in a re-copy of the whole ValueTree. This is fine for small trees, but may need some optimisation if things get bigger.
JUCE now has a ValueTreeSynchroniser class which may be useful instead of CriticalThreadValueTree

Constructor & Destructor Documentation

CriticalThreadValueTree::CriticalThreadValueTree ( ValueTree  source,
LockFreeCallQueue &  q 
)
inline

Configure the CriticalThreadValueTree.

Requires a LockFreeCallQueue to be passed which will be used for the synchronisation. You will need to regularly call synchronise on the LockFreeCallQueue from the critical thread so that the ValueTree gets updated.

Member Data Documentation

ValueTreeCopy::Ptr CriticalThreadValueTree::readonly

The output - the clone of the ValueTree.

A read-only copy of the value tree that you can access safely from your critical thread.


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