Monado OpenXR Runtime
xrt::auxiliary::util::TaskCollection Class Reference

Class to let users fall into a pit of success by being designed as a one shot dispatcher instance. More...

#include <util/u_worker.hpp>

Public Types

typedef std::function< void()> Functor
 

Public Member Functions

 TaskCollection (SharedThreadGroup const &stc, std::vector< Functor > const &funcs)
 Give all Functors when constructed, some what partially avoids use after leaving scope issues of function delegates. More...
 
void waitAll ()
 Waits for all given tasks to complete, also frees the group. More...
 
 TaskCollection (TaskCollection const &)=delete
 
 TaskCollection (TaskCollection &&)=delete
 
TaskCollectionoperator= (TaskCollection const &)=delete
 
TaskCollectionoperator= (TaskCollection &&)=delete
 

Detailed Description

Class to let users fall into a pit of success by being designed as a one shot dispatcher instance.

Constructor & Destructor Documentation

◆ TaskCollection()

xrt::auxiliary::util::TaskCollection::TaskCollection ( SharedThreadGroup const &  stc,
std::vector< Functor > const &  funcs 
)
inline

Give all Functors when constructed, some what partially avoids use after leaving scope issues of function delegates.

References u_worker_group_push(), and u_worker_group_reference().

Member Function Documentation

◆ waitAll()

void xrt::auxiliary::util::TaskCollection::waitAll ( )
inline

Waits for all given tasks to complete, also frees the group.

References u_worker_group_reference(), and u_worker_group_wait_all().


The documentation for this class was generated from the following files: