182 std::set<JobNode*>& visited);
190 template <
typename TJob,
typename... TArgs>
192 return makeShared<JobNode>(makeAuto<TJob>(std::forward<TArgs>(args)...));
Object that can store value of any type.
uint32_t Size
Integral type used to index arrays (by default).
Basic interface defining a single run.
AutoPtr< JobNode > cloneNode(const JobNode &node, const std::string &name="")
Clones a single node.
SharedPtr< JobNode > makeNode(TArgs &&... args)
Helper function for creating job nodes.
SharedPtr< JobNode > cloneHierarchy(JobNode &node, const Optional< std::string > &prefix=NOTHING)
Clones all nodes in the hierarchy.
#define NAMESPACE_SPH_END
const NothingType NOTHING
Saving and loading particle data.
Statistics gathered and periodically displayed during the run.
Container for storing particle quantities and materials.
Key-value associative container.
Object providing connection between component parameters and values exposed to the user.
Type-safe object that can store value of any type, similar to std::any.
Generic dynamically allocated resizable storage.
Represents a single node in the hierarchy written into config file.
Interface used during job evaluation.
virtual void onEnd(const Storage &storage, const Statistics &stats)=0
Notifies the caller that the current job ended.
virtual void onStart(const IJob &job)=0
Notifies the caller that a new job started running.
Base class for all object performing an operation in a simulation hierarchy.
Provides an interface for running a simulation.
virtual void run(const RunSettings &global, IJobCallbacks &callbacks)=0
Callbacks executed by the simulation to provide feedback to the user.
Building block of a simulation hierarchy.
Size getSlotCnt() const
Returns the number of provider slots of this node.
virtual void run(const RunSettings &global, IJobCallbacks &callbacks) override
Evaluates the node and all its providers.
void addAccessor(const SharedToken &owner, const Accessor &accessor)
Adds an accessor for entries returned by the getSettings function.
Size getDependentCnt() const
Returns the number of dependent nodes.
void enumerate(Function< void(const SharedPtr< JobNode > &job, Size depth)> func)
Enumerates all nodes in the hierarchy.
std::string instanceName() const
Returns the instance name of the job.
std::string className() const
Returns the class name of the job.
Optional< ExtJobType > provides() const
Returns the type of the job.
RawPtr< IJob > getJob() const
Returns the underlying job.
SlotData getSlot(const Size index) const
Returns the information about given slot.
virtual void prepare(const RunSettings &global, IJobCallbacks &callbacks)
Evaluates all provides, without executing the node itself.
void disconnect(SharedPtr< JobNode > dependent)
Disconnects this node from given dependent node.
void disconnectAll()
Disconnects all dependent nodes from this node.
void connect(SharedPtr< JobNode > dependent, const std::string &slotName)
Connects this node to given dependent node.
SharedPtr< JobNode > getDependent(const Size index) const
Returns a dependent node with given index.
JobNode(AutoPtr< IJob > &&job)
Creates a new node, given a job object.
void enumerate(Function< void(const SharedPtr< JobNode > &job)> func)
Enumerates all nodes in the hierarchy.
VirtualSettings getSettings() const
Returns settings object allowing to access and modify the state of the job.
virtual void onStart(const IJob &UNUSED(job)) override
virtual bool shouldAbortRun() const override
Returns whether current run should be aborted or not.
virtual void onEnd(const Storage &UNUSED(storage), const Statistics &UNUSED(stats)) override
virtual void onSetUp(const Storage &UNUSED(storage), Statistics &UNUSED(stats)) override
virtual void onTimeStep(const Storage &UNUSED(storage), Statistics &UNUSED(stats)) override
Wrapper of type value of which may or may not be present.
Non-owning wrapper of pointer.
Object holding various statistics about current run.
Container storing all quantities used within the simulations.
Holds a map of virtual entries, associated with a unique name.
Base class for all polymorphic objects.
bool used
Whether the node is used by the job.
ExtJobType type
Specifies the type of the slot, or the type of the node connecting to it.
std::string name
Identifier of the slot, used by the job to obtain the provided data.
SharedPtr< JobNode > provider
Node currently connected to the slot.