C4 Engine Terathon Software C4 Engine API Documentation

• System Utilities

API Links
Developer Links

class BatchJob

Defined in:  C4Threads.h
The BatchJob class represents a single job that can be part of a batch.
Definition

class BatchJob : public Job, public ListElement<BatchJob>

Constructor

BatchJob(ExecuteProc *execProc, void *cookie = nullptr, unsigned_int32 flags = 0);

BatchJob(ExecuteProc *execProc, FinalizeProc *finalProc, void *cookie = nullptr, unsigned_int32 flags = 0);

Parameters
execProc The main execution function for the job.
finalProc The finalization function for the job.
cookie A pointer to user-defined data that is passed to the job's execution function.
flags The job flags. See below for possible values.
Description
The BatchJob class is used to encapsulate the execution function and data for a single job. Batch jobs are queued for execution by one of the Job Manager's worker threads by calling the JobMgr::SubmitJob function and specifying a Batch object.

The functions specified by the execProc and finalProc parameters should have the following signatures.

typedef void ExecuteProc(Job *, void *);

typedef void FinalizeProc(Job *, void *);

kJobNonpersistent The job is nonpersistent. If this flag is set, then the job is automatically destroyed when its batch is finished.
Base Classes
Job A batch job is a specialized type of job.
ListElement<BatchJob> Used internally by the Job Manager.
See Also

Batch

JobMgr