Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LeafIterativeEvaluator.cs
1using System.Threading.Tasks;
3
4namespace Waher.Script.Model
5{
10 {
11 private readonly ScriptLeafNode node;
12
18 {
19 this.node = Node;
20 }
21
25 public ScriptLeafNode Node => this.node;
26
30 public abstract void RestartEvaluator();
31
35 public abstract IElement GetAggregatedResult();
36
40 public virtual bool UsesElement => true;
41
46 public abstract void AggregateElement(IElement Element);
47
52 public virtual bool IsAsynchronous => false;
53
62
70 public virtual Task<IElement> EvaluateAsync(Variables Variables)
71 {
72 return Task.FromResult(this.Evaluate(Variables));
73 }
74 }
75}
Base class for all types of elements.
Definition: Element.cs:14
An interative evaluator of a leaf script node.
LeafIterativeEvaluator(ScriptLeafNode Node)
An interative evaluator of a leaf script node.
abstract IElement Evaluate(Variables Variables)
Evaluates the evaluator, using the variables provided in the Variables collection and an object inst...
virtual Task< IElement > EvaluateAsync(Variables Variables)
Evaluates the evaluator, using the variables provided in the Variables collection and an object inst...
virtual bool UsesElement
If the evaluator uses the current element in its aggregate evaluation.
abstract IElement GetAggregatedResult()
Gets the aggregated result.
virtual bool IsAsynchronous
If the evaluator include asynchronous evaluation. Asynchronous evaluators should be evaluated using E...
abstract void AggregateElement(IElement Element)
Aggregates one new element.
abstract void RestartEvaluator()
Restarts the evaluator.
ScriptLeafNode Node
Node being evaluated.
Base class for leaf nodes in a parsed script tree.
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:21
An interative evaluator of a function supporting the IIterativeEvaluation interface.