SPH
|
Building block of a simulation hierarchy. More...
#include <Node.h>
Public Types | |
using | Accessor = Function< void(JobNotificationType, const Any &value)> |
![]() | |
using | SHARE_FROM_THIS_TAG = void |
Public Member Functions | |
JobNode (AutoPtr< IJob > &&job) | |
Creates a new node, given a job object. More... | |
std::string | instanceName () const |
Returns the instance name of the job. More... | |
std::string | className () const |
Returns the class name of the job. More... | |
VirtualSettings | getSettings () const |
Returns settings object allowing to access and modify the state of the job. More... | |
RawPtr< IJob > | getJob () const |
Returns the underlying job. More... | |
void | addAccessor (const SharedToken &owner, const Accessor &accessor) |
Adds an accessor for entries returned by the getSettings function. More... | |
Optional< ExtJobType > | provides () const |
Returns the type of the job. More... | |
void | connect (SharedPtr< JobNode > dependent, const std::string &slotName) |
Connects this node to given dependent node. More... | |
void | disconnect (SharedPtr< JobNode > dependent) |
Disconnects this node from given dependent node. More... | |
void | disconnectAll () |
Disconnects all dependent nodes from this node. More... | |
Size | getSlotCnt () const |
Returns the number of provider slots of this node. More... | |
SlotData | getSlot (const Size index) const |
Returns the information about given slot. More... | |
Size | getDependentCnt () const |
Returns the number of dependent nodes. More... | |
SharedPtr< JobNode > | getDependent (const Size index) const |
Returns a dependent node with given index. More... | |
void | enumerate (Function< void(const SharedPtr< JobNode > &job)> func) |
Enumerates all nodes in the hierarchy. More... | |
void | enumerate (Function< void(const SharedPtr< JobNode > &job, Size depth)> func) |
Enumerates all nodes in the hierarchy. More... | |
virtual void | run (const RunSettings &global, IJobCallbacks &callbacks) override |
Evaluates the node and all its providers. More... | |
virtual void | prepare (const RunSettings &global, IJobCallbacks &callbacks) |
Evaluates all provides, without executing the node itself. More... | |
![]() | |
void | setWeakPtr (const WeakPtr< JobNode > &weakPtr) |
SharedPtr< JobNode > | sharedFromThis () const |
WeakPtr< JobNode > | weakFromThis () const |
![]() | |
virtual | ~Polymorphic () |
Building block of a simulation hierarchy.
Each node can have any number of providers (preconditions of the job).
using JobNode::Accessor = Function<void(JobNotificationType, const Any& value)> |
|
explicit |
void JobNode::addAccessor | ( | const SharedToken & | owner, |
const Accessor & | accessor | ||
) |
Adds an accessor for entries returned by the getSettings function.
std::string JobNode::className | ( | ) | const |
Connects this node to given dependent node.
dependent | Dependent node to which this node is connected. |
slotName | Name of the slot of the dependent node. |
InvalidSetup | if no such slot exists or it has a different type. |
Disconnects this node from given dependent node.
dependent | Dependent node to be disconnected. |
InvalidSetup | if the given node is not a dependent. |
void JobNode::disconnectAll | ( | ) |
Enumerates all nodes in the hierarchy.
Function call provided function for this node and recursively for all providers of this node. Each node is visited only once.
Enumerates all nodes in the hierarchy.
Function call provided function for this node and recursively for all providers of this node. Each node is visited only once.
The function is given the visited job and its depth in the hierarchy.
Size JobNode::getDependentCnt | ( | ) | const |
VirtualSettings JobNode::getSettings | ( | ) | const |
Size JobNode::getSlotCnt | ( | ) | const |
std::string JobNode::instanceName | ( | ) | const |
|
virtual |
Optional< ExtJobType > JobNode::provides | ( | ) | const |
|
overridevirtual |
Evaluates the node and all its providers.
The job is evaluated after all the providers finished and all inputs of the job have been set up.
global | Global settings, used by all nodes in the hierarchy. |
callbacks | Interface allowing to get a feedback from evaluated nodes, see IJobCallbacks. |
Implements INode.