![]() |
Shkyera Engine
Easy to use, game engine for Python
|
#include <JobSystem.hpp>
Public Member Functions | |
JobBuilder (JobExecutor function) | |
~JobBuilder ()=default | |
JobBuilder (const JobBuilder &)=delete | |
JobBuilder & | operator= (const JobBuilder &)=delete |
JobBuilder (JobBuilder &&)=delete | |
JobBuilder & | operator= (JobBuilder &&)=delete |
JobBuilder & | dependsOn (JobHandle handle) |
template<typename ResourceType > | |
JobBuilder & | readResource () |
template<typename ResourceType > | |
JobBuilder & | writeResource () |
JobBuilder & | readResource (TypeID typeId) |
JobBuilder & | writeResource (TypeID typeId) |
void | useMainThread () |
JobHandle | submit () |
Private Attributes | |
Job | _job |
Builder class for constructing and configuring jobs.
shkyera::JobBuilder::JobBuilder | ( | JobExecutor | function | ) |
Constructs a job builder with the given executor function. The function will be executed when the job runs.
function | The function to be executed by the job |
|
default |
|
delete |
|
delete |
JobBuilder & shkyera::JobBuilder::dependsOn | ( | JobHandle | handle | ) |
Adds a dependency to the job. The job will not execute until all its dependencies have completed.
handle | Handle of the job this job depends on |
|
delete |
|
delete |
|
inline |
Specifies a resource that the job needs to read. The job will not execute if any other job is currently writing to this resource.
ResourceType | Type of the resource to read |
|
inline |
Specifies a resource by ID that the job needs to read.
typeId | ID of the resource to read |
JobHandle shkyera::JobBuilder::submit | ( | ) |
Submits the configured job to the system.
|
inline |
Forces the job to run on the main thread.
|
inline |
Specifies a resource that the job needs to write. The job will not execute if any other job is currently reading or writing to this resource.
ResourceType | Type of the resource to write |
|
inline |
Specifies a resource by ID that the job needs to write. This is used for dynamic resource types that aren't known at compile time.
typeId | ID of the resource to write |
|
private |