tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
tracktion::engine::AsyncFunctionCaller Struct Reference

Holds a list of function objects and enables you to call them asyncronously. More...

#include "tracktion_AsyncFunctionUtils.h"

Inheritance diagram for tracktion::engine::AsyncFunctionCaller:
juce::AsyncUpdater

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
 

Detailed Description

Holds a list of function objects and enables you to call them asyncronously.

Definition at line 54 of file tracktion_AsyncFunctionUtils.h.

Constructor & Destructor Documentation

◆ ~AsyncFunctionCaller()

tracktion::engine::AsyncFunctionCaller::~AsyncFunctionCaller ( )
override

Destructor.

Definition at line 60 of file tracktion_AsyncFunctionUtils.h.

Member Function Documentation

◆ addFunction()

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.

◆ handleAsyncUpdate()

void tracktion::engine::AsyncFunctionCaller::handleAsyncUpdate ( )
overridevirtual

Implements juce::AsyncUpdater.

Definition at line 99 of file tracktion_AsyncFunctionUtils.h.

◆ handleUpdateNowIfNeeded()

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.

◆ updateAsync()

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.

Member Data Documentation

◆ functions

std::map<int, std::pair<bool, std::function<void (void)> > > tracktion::engine::AsyncFunctionCaller::functions

Definition at line 115 of file tracktion_AsyncFunctionUtils.h.


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