Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::LambdaTaskWrapper< TFunc, TArgs > Class Template Reference

A Task payload that embeds TFunc and TArgs into the Task's data. It makes it easy to construct a Task from a lambda or a function plus arguments similar to std::thread. More...

#include <Task.h>

Inherits gts::Task.

Public Member Functions

GTS_INLINE LambdaTaskWrapper (TFunc &&func, TArgs &&...args)
 
virtual GTS_INLINE Taskexecute (TaskContext const &ctx) final
 
template<size_t... Idxs>
Task_invoke (std::integer_sequence< size_t, Idxs... >, TaskContext const &ctx)
 
- Public Member Functions inherited from gts::Task
GTS_INLINE void addChildTaskWithoutRef (Task *pChild)
 
GTS_INLINE void addChildTaskWithRef (Task *pChild, gts::memory_order order=gts::memory_order::seq_cst)
 
GTS_INLINE void setContinuationTask (Task *pContinuation)
 
GTS_INLINE void recycle ()
 
void waitForAll ()
 
void spawnAndWaitForAll (Task *pChild)
 
GTS_INLINE void setAffinity (uint32_t workerIdx)
 
GTS_INLINE int32_t addRef (int32_t count=1, gts::memory_order order=gts::memory_order::seq_cst)
 
GTS_INLINE int32_t removeRef (int32_t count=1, gts::memory_order order=gts::memory_order::seq_cst)
 
GTS_INLINE void setRef (int32_t count, gts::memory_order order=gts::memory_order::seq_cst)
 
GTS_INLINE void setName (const char *name)
 
GTS_INLINE int32_t refCount (gts::memory_order order=gts::memory_order::acquire) const
 
GTS_INLINE uint32_t getAffinity () const
 
GTS_INLINE bool isStolen () const
 
GTS_INLINE Taskparent ()
 
GTS_INLINE const char * name () const
 

Detailed Description

template<typename TFunc, typename... TArgs>
class gts::LambdaTaskWrapper< TFunc, TArgs >

A Task payload that embeds TFunc and TArgs into the Task's data. It makes it easy to construct a Task from a lambda or a function plus arguments similar to std::thread.