VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VSTGUI::Standalone::Async Namespace Reference

asynchronous tasks More...

Classes

struct  Group
 Group of asynchronous tasks. More...
 

Typedefs

using QueuePtr = std::shared_ptr< Queue >
 
using GroupPtr = std::shared_ptr< Group >
 
using Task = std::function< void()>
 

Functions

const QueuePtrmainQueue ()
 Get main/UI serial queue.
 
const QueuePtrbackgroundQueue ()
 Get background concurrent queue.
 
QueuePtr makeSerialQueue (const char *name)
 Make a new serial queue.
 
void schedule (QueuePtr queue, Task &&task)
 Schedule a task to be performed asynchronous on a queue.
 

Detailed Description

asynchronous tasks

Typedef Documentation

using GroupPtr = std::shared_ptr<Group>
using QueuePtr = std::shared_ptr<Queue>
using Task = std::function<void ()>

Function Documentation

const QueuePtr& VSTGUI::Standalone::Async::backgroundQueue ( )

Get background concurrent queue.

Tasks scheduled on this queue are performed concurrently on background threads. The number of background threads are depending on the systems number of CPU cores.

const QueuePtr& VSTGUI::Standalone::Async::mainQueue ( )

Get main/UI serial queue.

Tasks scheduled on this queue are performed serially on the main/ui thread.

QueuePtr VSTGUI::Standalone::Async::makeSerialQueue ( const char *  name)

Make a new serial queue.

Tasks scheduled on this queue are performed serially on a background thread.

Parameters
namethe name of the serial queue (optional)
Returns
a new serial queue
void VSTGUI::Standalone::Async::schedule ( QueuePtr  queue,
Task &&  task 
)

Schedule a task to be performed asynchronous on a queue.

Can be called from any thread, but should not be called from realtime constraint threads as it may involves locks and memory allocations

Parameters
queueon which queue to perform the task
tasktask to be performed