VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Group Struct Referencefinal

Group of asynchronous tasks. More...

+ Inheritance diagram for Group:

Public Member Functions

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

Static Public Member Functions

static GroupPtr make (QueuePtr queue)
 Create a new group.
 

Detailed Description

Group of asynchronous tasks.

Member Function Documentation

bool add ( T &&  task)
inline

Add a task to the group.

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

Parameters
taskthe task to add
Returns
true on success
static GroupPtr make ( QueuePtr  queue)
inlinestatic

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
queuethe queue where to schedule the groups tasks
Returns
a shared pointer to the new group
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
finishTaskan 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: