|
tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation |
Holds a list of function objects and enables you to call them asyncronously. More...
#include "tracktion_AsyncFunctionUtils.h"
Public Member Functions | |
| AsyncFunctionCaller ()=default | |
| Creates an empty AsyncFunctionCaller. | |
| ~AsyncFunctionCaller () override | |
| Destructor. | |
| void | addFunction (int functionID, const std::function< void()> &f) |
| Adds a function and associates a functionID with it. | |
| void | updateAsync (int functionID) |
| Triggers an asyncronous call to one of the functions. | |
| void | handleUpdateNowIfNeeded () |
| If an update has been triggered and is pending, this will invoke it synchronously. | |
| void | handleAsyncUpdate () override |
Public Attributes | |
| std::map< int, std::pair< bool, std::function< void(void)> > > | functions |
Holds a list of function objects and enables you to call them asyncronously.
Definition at line 54 of file tracktion_AsyncFunctionUtils.h.
|
override |
Destructor.
Definition at line 60 of file tracktion_AsyncFunctionUtils.h.
| void tracktion::engine::AsyncFunctionCaller::addFunction | ( | int | functionID, |
| const std::function< void()> & | f | ||
| ) |
Adds a function and associates a functionID with it.
Definition at line 66 of file tracktion_AsyncFunctionUtils.h.
|
overridevirtual |
Implements juce::AsyncUpdater.
Definition at line 99 of file tracktion_AsyncFunctionUtils.h.
| void tracktion::engine::AsyncFunctionCaller::handleUpdateNowIfNeeded | ( | ) |
If an update has been triggered and is pending, this will invoke it synchronously.
Use this as a kind of "flush" operation - if an update is pending, the handleAsyncUpdate() method will be called immediately; if no update is pending, then nothing will be done.
Because this may invoke the callback, this method must only be called on the main event thread.
Definition at line 93 of file tracktion_AsyncFunctionUtils.h.
| void tracktion::engine::AsyncFunctionCaller::updateAsync | ( | int | functionID | ) |
Triggers an asyncronous call to one of the functions.
Definition at line 72 of file tracktion_AsyncFunctionUtils.h.
| std::map<int, std::pair<bool, std::function<void (void)> > > tracktion::engine::AsyncFunctionCaller::functions |
Definition at line 115 of file tracktion_AsyncFunctionUtils.h.