AGX Dynamics  2.37.2.0
agx::TaskJob Class Reference

A task job is a job which executes an agx::Task. More...

#include <Job.h>

+ Inheritance diagram for agx::TaskJob:

Public Member Functions

 TaskJob ()
 
 TaskJob (Task *task)
 
virtual ~TaskJob ()
 
void execute ()
 
void init (Task *task)
 
void init ()
 
- Public Member Functions inherited from agx::Job
 Job ()
 
 Job (const Job &other)
 
 Job (const Callback &callback, agx::UInt32 costEstimate=100)
 
virtual ~Job ()
 
void addDependency (Job *parent)
 Add a dependency to a job. More...
 
void clearChildDependencies ()
 Remove all child dependencies. More...
 
void decrementNumDependencies (agx::UInt32 size=1)
 Explicitly decrement the number of parent dependencies. More...
 
Thread * getAssignedThread ()
 
const Callback & getCallback () const
 Return the current callback. More...
 
const JobPtrVector & getChildDependencies () const
 
agx::UInt32 getCostEstimate () const
 
Real getExecutionTime () const
 
const char * getName () const
 
agx::UInt32 getNumDependencies () const
 
const JobPtrVector & getParentDependencies () const
 
SyncTag * getSyncTag ()
 
agx::UInt32 getTag () const
 
Thread * getTargetThread ()
 
Task * getTask ()
 
const Timer & getTimer () const
 
bool hasDependency (Job *parent)
 
virtual void implementation ()
 Job implementation, override in subclass. More...
 
void incrementNumDependencies (agx::UInt32 size=1)
 Explicitly increment the number of parent dependencies. More...
 
agx::Index & index ()
 
const agx::Index & index () const
 
void init (const Callback &callback=Callback(), agx::UInt32 costEstimate=100)
 Initialize the job. More...
 
Job & operator= (const Job &other)
 
void removeAllDependencies ()
 Remove all parent dependencies. More...
 
void removeDependency (Job *parent)
 Remove a dependency from a job. More...
 
bool resolve ()
 Increase the dependency counter for the job, and queue job for execution if all dependencies are resolved. More...
 
void setCallback (const Callback &callback)
 Set the callback which is called when execute() runs. More...
 
void setCostEstimate (agx::UInt32 cost)
 Specify the cost estimate for this job. More...
 
void setName (const char *name)
 Set the name of the job, for debugging. More...
 
void setNumDependencies (agx::UInt32 numDependencies)
 Explicitly set the number of parent dependencies. More...
 
void setSyncTag (SyncTag *tag)
 Set the synchronization tag which must enter completion status before the job is executed. More...
 
void setTag (agx::UInt32 tag)
 Set the job tag, can be used to keep track of different job classes etc. More...
 
void setTargetThread (Thread *thread)
 Set the target thread which the job will be executed on. More...
 
void setTask (Task *task)
 Set the task which the job belongs to. More...
 
void spawn ()
 Schedule job for execution in thread pool. More...
 
- Public Member Functions inherited from agx::Callback
 Callback ()
 
 Callback (const CallbackFunction &func, bool repeatEnable=true)
 
template<class ClassT >
 Callback (void(ClassT::*fun)(), ClassT *obj, bool repeatEnable=true)
 
const CallbackFunction & implementation () const
 Return the std representation. More...
 
bool isRepeating () const
 
bool isValid () const
 
 operator bool () const
 
 operator const CallbackFunction & () const
 
void operator() () const
 Execute the callback. More...
 
void run () const
 

Additional Inherited Members

- Public Types inherited from agx::Callback
typedef std::function< void()> CallbackFunction
 
- Protected Attributes inherited from agx::Job
Thread * m_assignedThread
 
Callback m_callback
 
JobPtrVector m_children
 
agx::UInt32 m_cost
 
std::atomic< Int32 > m_dependencyCounter
 
agx::Index m_index
 
const char * m_name
 
agx::UInt32 m_numDependencies
 
JobPtrVector m_parents
 
SyncTagRef m_syncTag
 
agx::UInt32 m_tag
 
Thread * m_targetThread
 
Task * m_task
 
Timer m_timer
 

Detailed Description

A task job is a job which executes an agx::Task.

Definition at line 397 of file Job.h.

Constructor & Destructor Documentation

◆ TaskJob() [1/2]

agx::TaskJob::TaskJob ( )

Definition at line 677 of file Job.h.

◆ TaskJob() [2/2]

agx::TaskJob::TaskJob ( Task *  task)

Definition at line 681 of file Job.h.

◆ ~TaskJob()

virtual agx::TaskJob::~TaskJob ( )
virtual

Member Function Documentation

◆ execute()

void agx::TaskJob::execute ( )

Referenced by init().

◆ init() [1/2]

void agx::TaskJob::init ( Task *  task)

Definition at line 685 of file Job.h.

References agx::Callback::Callback(), execute(), and agx::Job::init().

◆ init() [2/2]

void agx::TaskJob::init ( )

Definition at line 691 of file Job.h.

References agx::Callback::Callback(), execute(), and agx::Job::init().


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