#include <jobgroup.h>
This is a template for homogenous static job group (all job of the same type and the number of jobs is known at creation). Once you have allocated a StaticJobGroup you cannot add more than the number of jobs specified and you cannot add jobs of a different type than specified in the template. Nonetheless you can add as many subgroups as you want.
Static Public Member Functions | |
static ResultPtr< StaticJobGroupInterface > | Alloc (Int jobCnt, STATICJOBGROUPFLAGS flags=STATICJOBGROUPFLAGS::DEFAULT, Int extraBufferSize=0) |
static ResultPtr< StaticJobGroupInterface > | Alloc (JobQueueInterface *queue, Int &threadCnt, STATICJOBGROUPFLAGS flags=STATICJOBGROUPFLAGS::DEFAULT, Int extraBufferSize=0) |
Private Member Functions | |
~StaticJobGroupInterface () | |
Additional Inherited Members | |
Public Attributes inherited from JobGroupInterface | |
JOBGROUPADDFLAGS | flags |
|
private |
void Add | ( | StaticJobArray< T > & | jobs | ) |
Adds an array with multiple jobs of the same type to the group (faster than single Add()s).
[in] | jobs | A StaticJobArray that was initialized with this group. |
|
static |
Allocates a StaticJobGroup.
[in] | jobCnt | The maximum number of jobs for this group. |
[in] | flags | STATICJOBGROUPFLAGS::DEFAULT by default, the other custom modes are for ParallelFor only. |
[in] | extraBufferSize | By default 0. Size of a private buffer that can be allocated together with the group. |
|
static |
String ToString | ( | const FormatStatement * | formatStatement = nullptr | ) | const |
Returns a readable string of the content.
[in] | formatStatement | Nullptr or additional formatting instruction. Currently no additional formatting instructions are supported. |
Result<void> Add |
Adds a job to the group. The group takes exclusive ownership of the job. The job will be deleted after it has been executed, when the group will be deleted or when adding the job fails. The job must have been created using DefaultAllocator, e.g. with Create() or NewObj(). If you had created a job on the stack or used a custom allocator this would lead to a crash. As long as the group is not enqueued you can add jobs from any thread. As soon as it is enqueued only jobs belonging to the group are allowed to add further jobs. THREADSAFE.
[in] | job | Job (nullptr will return error). |
Result<void> Add |
Adds a job to the group. The group takes exclusive ownership of the job. The job will be deleted after it has been executed, when the group will be deleted or when adding the job fails. The job must have been created using DefaultAllocator, e.g. with Create() or NewObj(). If you had created a job on the stack or used a custom allocator this would lead to a crash. As long as the group is not enqueued you can add jobs from any thread. As soon as it is enqueued only jobs belonging to the group are allowed to add further jobs. THREADSAFE.
[in] | job | Job (nullptr will return error). |
Result<void> Add | ( | typename T | ) |
Adds a job to the group. The group takes exclusive ownership of the job. The job will be deleted after it has been executed, when the group will be deleted or when adding the job fails. The job must have been created using DefaultAllocator, e.g. with Create() or NewObj(). If you had created a job on the stack or used a custom allocator this would lead to a crash. As long as the group is not enqueued you can add jobs from any thread. As soon as it is enqueued only jobs belonging to the group are allowed to add further jobs. THREADSAFE.
[in] | job | Job (encapsulated in a ResultMemT directly returned from creation). |
Result<void> Add | ( | typename JOBREF | ) |
Adds a job to the group. The group takes exclusive ownership of the job. The job will be deleted after it has been executed, when the group will be deleted or when adding the job fails. The job must have been created using DefaultAllocator, e.g. with Create() or NewObj(). If you had created a job on the stack or used a custom allocator this would lead to a crash. As long as the group is not enqueued you can add jobs from any thread. As soon as it is enqueued only jobs belonging to the group are allowed to add further jobs. THREADSAFE.
[in] | job | Job (encapsulated in a ResultMemT directly returned from creation). |