SPH
Public Member Functions | Protected Member Functions | List of all members
IRunJob Class Referenceabstract

Base class for jobs running a simulation. More...

#include <Job.h>

Inheritance diagram for IRunJob:
IParticleJob IJob Polymorphic NBodyJob SphJob SphStabilizationJob

Public Member Functions

 IRunJob (const std::string &name)
 
 ~IRunJob () override
 
virtual AutoPtr< IRungetRun (const RunSettings &overrides) const =0
 Returns the actual simulation object. More...
 
- Public Member Functions inherited from IParticleJob
 IParticleJob (const std::string &name)
 
 ~IParticleJob () override
 
virtual Optional< ExtJobTypeprovides () const override final
 Specifies the type of the job, i.e. what kind of data the job provides. More...
 
virtual JobContext getResult () const override final
 Returns the result of the job. More...
 
- Public Member Functions inherited from IJob
 IJob (const std::string &name)
 
virtual std::string instanceName () const
 Unique name representing this job. More...
 
virtual std::string className () const =0
 Name representing the type of the job (e.e. "SPH"). More...
 
virtual UnorderedMap< std::string, ExtJobTyperequires () const
 List of slots that need to be connected to evaluate the job. More...
 
virtual UnorderedMap< std::string, ExtJobTypegetSlots () const =0
 Lists all potential inputs of the job. More...
 
virtual VirtualSettings getSettings ()=0
 Returns a settings object which allows to query and modify the state of the job. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Member Functions

virtual void evaluate (const RunSettings &global, IRunCallbacks &callbacks) override final
 Runs the operation provided by the job. More...
 
- Protected Member Functions inherited from IJob
template<typename T >
SharedPtr< T > getInput (const std::string &name) const
 Convenient function to return input data for slot of given name. More...
 

Additional Inherited Members

- Protected Attributes inherited from IParticleJob
SharedPtr< ParticleDataresult
 Data filled by the job when it finishes. More...
 
- Protected Attributes inherited from IJob
std::string instName
 
UnorderedMap< std::string, JobContextinputs
 Contains all input data, identified by names of input slots. More...
 

Detailed Description

Base class for jobs running a simulation.

Simulation jobs can either derive from this or from more generic base class IParticleJob. This class allows connecting jobs with IRun interface, so a simulation can be easily plugged into the job hierarchy if it is already implemented as IRun.

Definition at line 266 of file Job.h.

Constructor & Destructor Documentation

◆ IRunJob()

IRunJob::IRunJob ( const std::string &  name)
explicit

Definition at line 110 of file Job.cpp.

◆ ~IRunJob()

IRunJob::~IRunJob ( )
overridedefault

Member Function Documentation

◆ evaluate()

void IRunJob::evaluate ( const RunSettings global,
IRunCallbacks callbacks 
)
finaloverrideprotectedvirtual

Runs the operation provided by the job.

Function may be called only after required inputs are assigned; this is provided by class JobNode, the job should not be used directly.

Parameters
globalGlobal settings, shared by all jobs. Contains parameters like number of threads, etc.
callbacksInterface allowing to get notified about current progress of the job.
Exceptions
InvalidSetupif required input is missing or job encountered a problem in initialization.

Implements IJob.

Definition at line 126 of file Job.cpp.

◆ getRun()

virtual AutoPtr<IRun> IRunJob::getRun ( const RunSettings overrides) const
pure virtual

Returns the actual simulation object.

This provides a way to implement the job functionality, as function evaluate is final and used only internally.

Parameters
overridesSettings overriding the current settings of the job.

Implemented in NBodyJob, SphStabilizationJob, and SphJob.


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