Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
IQueuedWork Class Referenceabstract

#include <IQueuedWork.h>

+ Inheritance diagram for IQueuedWork:
+ Collaboration diagram for IQueuedWork:

Public Types

using IInternalDataType = TRefCountPtr<IQueuedWorkInternalData>
 

Public Member Functions

virtual void DoThreadedWork ()=0
 
virtual void Abandon ()=0
 
virtual EQueuedWorkFlags GetQueuedWorkFlags () const
 
virtual int64 GetRequiredMemory () const
 
virtual ~IQueuedWork ()
 

Public Attributes

IInternalDataType InternalData
 

Detailed Description

Interface for queued work objects.

This interface is a type of runnable object that requires no per thread initialization. It is meant to be used with pools of threads in an abstract way that prevents the pool from needing to know any details about the object being run. This allows queuing of disparate tasks and servicing those tasks with a generic thread pool.

Definition at line 61 of file IQueuedWork.h.

Member Typedef Documentation

◆ IInternalDataType

Internal data can be used by the pool

Definition at line 98 of file IQueuedWork.h.

Constructor & Destructor Documentation

◆ ~IQueuedWork()

virtual IQueuedWork::~IQueuedWork ( )
inlinevirtual

Virtual destructor so that child implementations are guaranteed a chance to clean up any resources they allocated.

Definition at line 93 of file IQueuedWork.h.

Member Function Documentation

◆ Abandon()

virtual void IQueuedWork::Abandon ( )
pure virtual

Tells the queued work that it is being abandoned so that it can do per object clean up as needed. This will only be called if it is being abandoned before completion. NOTE: This requires the object to delete itself using whatever heap it was allocated in.

Implemented in FQueuedThreadPoolWrapper::FScheduledWork.

+ Here is the caller graph for this function:

◆ DoThreadedWork()

virtual void IQueuedWork::DoThreadedWork ( )
pure virtual

This is where the real thread work is done. All work that is done for this queued object should be done from within the call to this function.

Implemented in FQueuedThreadPoolWrapper::FScheduledWork.

+ Here is the caller graph for this function:

◆ GetQueuedWorkFlags()

virtual EQueuedWorkFlags IQueuedWork::GetQueuedWorkFlags ( ) const
inlinevirtual

Returns any special work flags.

Reimplemented in FQueuedThreadPoolWrapper::FScheduledWork.

Definition at line 81 of file IQueuedWork.h.

+ Here is the caller graph for this function:

◆ GetRequiredMemory()

virtual int64 IQueuedWork::GetRequiredMemory ( ) const
inlinevirtual

Returns an approximation of the peak memory (in bytes) this task could require during it's execution.

Reimplemented in FQueuedThreadPoolWrapper::FScheduledWork.

Definition at line 86 of file IQueuedWork.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ InternalData

IInternalDataType IQueuedWork::InternalData

Definition at line 99 of file IQueuedWork.h.


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