VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Classes | Typedefs | Functions
VSTGUI::Standalone::Async Namespace Reference
Standalone Library

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 QueuePtr & | mainQueue ()
| Get main/UI serial queue. More...
const QueuePtr & | backgroundQueue ()
| Get background concurrent queue. More...
QueuePtr | makeSerialQueue (const char *name)
| Make a new serial queue. More...
void | schedule (QueuePtr queue, Task &&task)
| Schedule a task to be performed asynchronous on a queue. More...

## Detailed Description

asynchronous tasks

## Typedef Documentation

## ◆ GroupPtr

using GroupPtr = std::shared_ptr<Group>

## ◆ QueuePtr

using QueuePtr = std::shared_ptr<Queue>

## ◆ Task

using Task = std::function<void ()>

## Function Documentation

## ◆ backgroundQueue()

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.

## ◆ mainQueue()

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

Get main/UI serial queue.

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

## ◆ makeSerialQueue()

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

  name | the name of the serial queue (optional)

Returns
  a new serial queue

## ◆ schedule()

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

  queue | on which queue to perform the task
  task | task to be performed