SPH
|
Data exchanged by jobs. More...
#include <Job.h>
Public Member Functions | |
JobContext ()=default | |
template<typename TValue > | |
JobContext (SharedPtr< TValue > value) | |
template<typename TValue > | |
SharedPtr< TValue > | getValue () const |
Returns the stored value. More... | |
template<typename TValue > | |
SharedPtr< TValue > | tryGetValue () const |
Returns the stored value or nullptr if the provided type TValue does not match the type of the stored value. More... | |
JobContext | clone () const |
Duplicates the stored data. More... | |
void | release () |
Releases all allocated data. More... | |
Public Member Functions inherited from Polymorphic | |
virtual | ~Polymorphic () |
Data exchanged by jobs.
The context is a variant, containing either particle data, material or geometry. Each job receives a number of contexts as inputs, performs its operation and returns contexts as a result. The returned context can be the same as the input context; this is mostly used by jobs than perform a minor modification of the input.
|
default |
JobContext::JobContext | ( | SharedPtr< TValue > | value | ) |
NAMESPACE_SPH_BEGIN JobContext JobContext::clone | ( | ) | const |
Duplicates the stored data.
Note that JobContext has a pointer semantics, a copy will thus reference the same object as the original. Use this function to perform a deep copy and return an independent instance.
SharedPtr< TValue > JobContext::getValue |
Returns the stored value.
Type TValue can be either ParticleData, IMaterial or IDomain. If the type of the stored value is different or no value is stored, InvalidSetup exception is thrown.
SharedPtr< TValue > JobContext::tryGetValue |
Returns the stored value or nullptr if the provided type TValue does not match the type of the stored value.
Type TValue can be either ParticleData, IMaterial or IDomain.