Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ReferenceNode.cs
1using System;
2using System.Threading.Tasks;
3using Waher.Groups;
5using Waher.Things;
7
9{
13 public abstract class ReferenceNode : JobNode, IGroup
14 {
19 : base()
20 {
21 this.NodeId = Guid.NewGuid().ToString();
22 }
23
27 [Header(65, "Label:", 10)]
28 [Page(66, "Job", 0)]
29 [ToolTip(67, "Label presenting the node in the job source.")]
30 [Required]
31 public string Label { get; set; }
32
36 public override string LocalId => string.IsNullOrEmpty(this.Label) ? this.NodeId : this.Label;
37
41 public override string LogId => this.LocalId;
42
48 public override Task<bool> AcceptsChildAsync(INode Child)
49 {
50 return Task.FromResult(false);
51 }
52
58 public override Task<bool> AcceptsParentAsync(INode Parent)
59 {
60 return Task.FromResult(Parent is SensorDataReadoutTaskNode);
61 }
62
66 public async Task<T[]> FindNodes<T>()
67 where T : INode
68 {
69 ChunkedList<T> Nodes = new ChunkedList<T>();
70 await this.FindNodes(Nodes);
71 return Nodes.ToArray();
72 }
73
78 public abstract Task FindNodes<T>(ChunkedList<T> Nodes)
79 where T : INode;
80 }
81}
Base class for all job nodes.
Definition: JobNode.cs:30
INode Parent
Parent Node, or null if a root node.
Definition: JobNode.cs:621
Abstract base class for reference nodes.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
override string LogId
If provided, an ID for the node, as it would appear or be used in system logs. Can be null,...
ReferenceNode()
Abstract base class for reference nodes.
override string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
async Task< T[]> FindNodes< T >()
Finds nodes referenced by the group node.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
A chunked list is a linked list of chunks of objects of type T .
Definition: ChunkedList.cs:54
T[] ToArray()
Returns an array containing all elements of the collection.
Base Interface for all metering nodes.
Definition: IGroup.cs:11
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49