Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
|
A Task payload that embeds a function pointer and data argument into the the Task's data. More...
#include <Task.h>
Inherits gts::Task.
Public Types | |
using | TaskRoutine = Task *(*)(void *pData, TaskContext const &taskContext) |
Public Member Functions | |
GTS_INLINE | CStyleTask () |
template<typename TData > | |
GTS_INLINE | CStyleTask (TaskRoutine taskRountine, TData *pData=nullptr) |
GTS_INLINE | CStyleTask (CStyleTask const &) |
virtual GTS_INLINE Task * | execute (TaskContext const &ctx) final |
template<typename TData > | |
GTS_INLINE TData * | setData (TData *data) |
GTS_INLINE void const * | getData () const |
GTS_INLINE void * | getData () |
template<typename TData > | |
CStyleTask (TaskRoutine taskRountine, TData *pData) | |
template<typename TData > | |
TData * | setData (TData *pData) |
template<typename TData > | |
void | _resetDataDestructor () |
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 Task * | parent () |
GTS_INLINE const char * | name () const |
CStyleTask::CStyleTask | ( | ) |
Construct an empty Task. Needed for some container classes.
|
explicit |
Construct an Task from a TaskRoutine and data pointer
CStyleTask::CStyleTask | ( | CStyleTask const & | ) |
Copy constructor needed for STL containers. Do not use!
void * CStyleTask::getData | ( | ) |
void const * CStyleTask::getData | ( | ) | const |
GTS_INLINE TData* gts::CStyleTask::setData | ( | TData * | data | ) |
Copies a data pointer into the task.