VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Public Member Functions | Static Public Member Functions | List of all members
Group Struct Referencefinal

Group of asynchronous tasks. More...

`#include <async.h>`

Inheritance diagram for Group:

## Public Member Functions
template<typename T >
bool | add (T &&task)
| Add a task to the group. More...
bool | start (Task &&finishTask=nullptr)
| Start the groups tasks. More...

## Static Public Member Functions
static GroupPtr | make (QueuePtr queue)
| Create a new group. More...

## Detailed Description

Group of asynchronous tasks.

## Member Function Documentation

## ◆ add()

bool add | ( | T && | task | ) |
| inline

Add a task to the group.

If the group was started, new tasks cannot be added.

Parameters

  task | the task to add

Returns
  true on success

## ◆ make()

static GroupPtr make | ( | QueuePtr | queue | ) |
| inline static

Create a new group.

Note that all calls to the group must be from one thread. If you want to call them from different threads, you have to lock the access of it with a mutex yourself.

Parameters

  queue | the queue where to schedule the groups tasks

Returns
  a shared pointer to the new group

## ◆ start()

bool start | ( | Task && | finishTask = `nullptr` | ) |
| inline

Start the groups tasks.

A group can only be started once. The optional finishTask is performed after all tasks in this group have executed. The finish task will execute on the same queue as the tasks.

Parameters

  finishTask | an optional task to run after all group tasks were executed.

Returns
  true on success

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

- async.h