ezEngine  Release 25.03
ArrayPtrTask< ElemType > Class Template Referencefinal
Inheritance diagram for ArrayPtrTask< ElemType >:

Public Member Functions

 ArrayPtrTask (ezArrayPtr< ElemType > payload, ezParallelForFunction< ElemType > taskCallback, ezUInt32 uiItemsPerInvocation)
 
void Execute () override
 Override this to implement the task's supposed functionality. More...
 
void ExecuteWithMultiplicity (ezUInt32 uiInvocation) const override
 Override this to implement the task's supposed functionality. More...
 
- Public Member Functions inherited from ezTask
void ConfigureTask (const char *szTaskName, ezTaskNesting nestingMode, ezOnTaskFinishedCallback callback=ezOnTaskFinishedCallback())
 Sets the most important task properties. This has to be done before the task is added to a task group for the first time. More...
 
void SetMultiplicity (ezUInt32 uiMultiplicity)
 Changes the multiplicity of this task. More...
 
ezUInt32 GetMultiplicity () const
 
bool IsTaskFinished () const
 Returns whether the task has been finished. This includes being canceled. More...
 
bool HasBeenCanceled () const
 Can be used inside an overridden 'Execute' function to terminate execution prematurely.
 
- Public Member Functions inherited from ezRefCounted
virtual ~ezRefCounted ()=default
 Adds a virtual destructor.
 
- Public Member Functions inherited from ezRefCountingImpl
 ezRefCountingImpl ()=default
 Constructor.
 
 ezRefCountingImpl (const ezRefCountingImpl &rhs)
 
void operator= (const ezRefCountingImpl &rhs)
 
ezInt32 AddRef () const
 Increments the reference counter. Returns the new reference count.
 
ezInt32 ReleaseRef () const
 Decrements the reference counter. Returns the new reference count.
 
bool IsReferenced () const
 Returns true if the reference count is greater than 0, false otherwise.
 
ezInt32 GetRefCount () const
 Returns the current reference count.
 

Additional Inherited Members

Member Function Documentation

◆ Execute()

template<typename ElemType >
void ArrayPtrTask< ElemType >::Execute ( )
inlineoverridevirtual

Override this to implement the task's supposed functionality.

This function is called for tasks that do not use multiplicity. They are executed a single time for each time they are added to the ezTaskSystem.

Reimplemented from ezTask.

◆ ExecuteWithMultiplicity()

template<typename ElemType >
void ArrayPtrTask< ElemType >::ExecuteWithMultiplicity ( ezUInt32  uiInvocation) const
inlineoverridevirtual

Override this to implement the task's supposed functionality.

This function is called for tasks that use multiplicity. A task that uses multiplicity is automatically run N times by the ezTaskSystem, each time with an increasing invocation index. This allows to have a single task to handle something, but then decide dynamically how often to execute it, to subdivide the workload into multiple pieces. Since the same task is executed multiple times in parallel, tasks with multiplicity should not have any mutable state, which is why this function is const.

Reimplemented from ezTask.


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