cello
JUCE ValueTrees for Humans
Loading...
Searching...
No Matches
cello::Sync Class Reference

Permits thread-safe Object updates by using the juce::ValueTreeSynchroniser class to generate small binary patches that are used to pass updates from one copy of a ValueTree to another, each in separate threads. This sync is only performed in one direction, so you will need a pair of these objects to perform bidirectional syncs. More...

#include <cello_sync.h>

Inheritance diagram for cello::Sync:
cello::UpdateQueue

Public Member Functions

 Sync (Object &producer, Object &consumer, juce::Thread *thread)
 Construct a new Sync object.
 
 Sync (const Sync &)=delete
 
Syncoperator= (const Sync &)=delete
 
- Public Member Functions inherited from cello::UpdateQueue
 UpdateQueue (Object &consumer, juce::Thread *thread)
 
 UpdateQueue (const UpdateQueue &)=delete
 
UpdateQueueoperator= (const UpdateQueue &)=delete
 
 UpdateQueue (UpdateQueue &&)=delete
 
UpdateQueueoperator= (UpdateQueue &&)=delete
 
int getPendingUpdateCount () const
 
void performAllUpdates ()
 Execute each of the updates that are ready.
 
void performNextUpdate ()
 Pop the next event from the queue and apply the change to the destination value tree.
 

Additional Inherited Members

- Protected Member Functions inherited from cello::UpdateQueue
void pushUpdate (juce::MemoryBlock &&update)
 

Detailed Description

Permits thread-safe Object updates by using the juce::ValueTreeSynchroniser class to generate small binary patches that are used to pass updates from one copy of a ValueTree to another, each in separate threads. This sync is only performed in one direction, so you will need a pair of these objects to perform bidirectional syncs.

Take care to not generate infinite update loops.

Constructor & Destructor Documentation

◆ Sync()

cello::Sync::Sync ( Object & producer,
Object & consumer,
juce::Thread * thread )

Construct a new Sync object.

Parameters
producercello::Object that will be sending updates
consumercello::Object that will be kept in sync with the producer
threadnon-owning pointer to the Thread on which the consumer will be updated. If the consumer object is to be updated on the message thread, pass a nullptr for this arg.

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