SPH
Public Member Functions | List of all members
IRunCallbacks Class Referenceabstract

Callbacks executed by the simulation to provide feedback to the user. More...

#include <IRun.h>

Inheritance diagram for IRunCallbacks:
Polymorphic IJobCallbacks NullRunCallbacks Controller NullJobCallbacks UpdateCameraCallbacks

Public Member Functions

virtual void onSetUp (const Storage &storage, Statistics &stats)=0
 Called right before the run starts, i.e. after initial conditions are set up. More...
 
virtual void onTimeStep (const Storage &storage, Statistics &stats)=0
 Called every timestep. More...
 
virtual bool shouldAbortRun () const =0
 Returns whether current run should be aborted or not. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Callbacks executed by the simulation to provide feedback to the user.

All functions are called from the same thread that called IRun::run.

Definition at line 27 of file IRun.h.

Member Function Documentation

◆ onSetUp()

virtual void IRunCallbacks::onSetUp ( const Storage storage,
Statistics stats 
)
pure virtual

Called right before the run starts, i.e. after initial conditions are set up.

Implemented in NullRunCallbacks.

◆ onTimeStep()

virtual void IRunCallbacks::onTimeStep ( const Storage storage,
Statistics stats 
)
pure virtual

Called every timestep.

This is a blocking call, run is paused until the function returns. This allows to safely access the storage and run statistics. Note that accessing the storage from different thread during run is generally unsafe, as the storage can be resized during the run.

Implemented in NullRunCallbacks.

◆ shouldAbortRun()

virtual bool IRunCallbacks::shouldAbortRun ( ) const
pure virtual

Returns whether current run should be aborted or not.

Can be called any time.

Implemented in NullJobCallbacks, and NullRunCallbacks.


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