SPH
ScriptJobs.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "run/Job.h"
4 
6 
7 #ifdef SPH_USE_CHAISCRIPT
8 
9 class ChaiScriptJob : public IParticleJob {
10 private:
11  Path file = Path("script.chai");
12 
13  int inputCnt = 8; // needs to be max for proper loading ...
15 
16  int paramCnt = 8;
17  StaticArray<std::string, 8> paramNames;
18  StaticArray<Float, 8> paramValues;
19 
20 public:
21  ChaiScriptJob(const std::string& name);
22 
23  virtual std::string className() const override {
24  return "custom script";
25  }
26 
27  virtual UnorderedMap<std::string, ExtJobType> getSlots() const override;
28 
29  virtual VirtualSettings getSettings() override;
30 
31  virtual void evaluate(const RunSettings& global, IRunCallbacks& UNUSED(callbacks)) override;
32 };
33 
34 #endif
35 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
#define UNUSED(x)
Definition: Object.h:37
#define NAMESPACE_SPH_END
Definition: Object.h:12
virtual UnorderedMap< std::string, ExtJobType > getSlots() const =0
Lists all potential inputs of the job.
virtual VirtualSettings getSettings()=0
Returns a settings object which allows to query and modify the state of the job.
virtual std::string className() const =0
Name representing the type of the job (e.e. "SPH").
virtual void evaluate(const RunSettings &global, IRunCallbacks &callbacks)=0
Runs the operation provided by the job.
Base class for all jobs providing particle data.
Definition: Job.h:242
Callbacks executed by the simulation to provide feedback to the user.
Definition: IRun.h:27
Object representing a path on a filesystem.
Definition: Path.h:17
Array with fixed number of allocated elements.
Definition: StaticArray.h:19
Holds a map of virtual entries, associated with a unique name.