Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CompoundQuery.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4
6{
10 public class CompoundQuery : Query
11 {
12 private readonly IEnumerable<Query> queries;
13
22 public CompoundQuery(string CommandId, string QueryId, object State, Language Language, IEnumerable<Query> Queries)
23 : base(CommandId, QueryId, State, Language, null)
24 {
25 this.queries = Queries;
26
27 foreach (Query Query in this.queries)
28 {
29 Query.OnAborted += Query_OnAborted;
30 Query.OnBeginSection += Query_OnBeginSection;
31 Query.OnDone += Query_OnDone;
32 Query.OnEndSection += Query_OnEndSection;
33 Query.OnMessage += Query_OnMessage;
34 Query.OnNewObject += Query_OnNewObject;
35 Query.OnNewRecords += Query_OnNewRecords;
36 Query.OnNewTable += Query_OnNewTable;
37 Query.OnStarted += Query_OnStarted;
38 Query.OnStatus += Query_OnStatus;
39 Query.OnTableDone += Query_OnTableDone;
40 Query.OnTitle += Query_OnTitle;
41 }
42 }
43
44 private Task Query_OnTitle(object Sender, QueryTitleEventArgs e)
45 {
46 return this.SetTitle(e);
47 }
48
49 private Task Query_OnTableDone(object Sender, QueryTableEventArgs e)
50 {
51 return this.TableDone(e);
52 }
53
54 private Task Query_OnStatus(object Sender, QueryStatusEventArgs e)
55 {
56 return this.SetStatus(e);
57 }
58
59 private Task Query_OnStarted(object Sender, QueryEventArgs e)
60 {
61 return this.Start(e);
62 }
63
64 private Task Query_OnNewTable(object Sender, QueryNewTableEventArgs e)
65 {
66 return this.NewTable(e);
67 }
68
69 private Task Query_OnNewRecords(object Sender, QueryNewRecordsEventArgs e)
70 {
71 return this.NewRecords(e);
72 }
73
74 private Task Query_OnNewObject(object Sender, QueryObjectEventArgs e)
75 {
76 return this.NewObject(e);
77 }
78
79 private Task Query_OnMessage(object Sender, QueryMessageEventArgs e)
80 {
81 return this.LogMessage(e);
82 }
83
84 private Task Query_OnEndSection(object Sender, QueryEventArgs e)
85 {
86 return this.EndSection(e);
87 }
88
89 private Task Query_OnDone(object Sender, QueryEventArgs e)
90 {
91 return this.Done(e);
92 }
93
94 private Task Query_OnBeginSection(object Sender, QueryTitleEventArgs e)
95 {
96 return this.BeginSection(e);
97 }
98
99 private Task Query_OnAborted(object Sender, QueryEventArgs e)
100 {
101 return this.Abort(e);
102 }
103
107 public IEnumerable<Query> Queries => this.queries;
108
112 public override async Task Abort()
113 {
114 await base.Abort();
115
116 foreach (Query Query in this.queries)
117 await Query.Abort();
118 }
119 }
120}
Contains information about a language.
Definition: Language.cs:17
Class handling the reception of data from a query on multiple nodes.
override async Task Abort()
Aborts the query.
CompoundQuery(string CommandId, string QueryId, object State, Language Language, IEnumerable< Query > Queries)
Class handling the reception of data from a query on multiple nodes.
IEnumerable< Query > Queries
Queries
Class handling the reception of data from a query.
Definition: Query.cs:12
Task TableDone(string TableId)
Reports a table as being complete.
Definition: Query.cs:318
Task EndSection()
Ends a section. Each call to BeginSection(string) must be followed by a call to EndSection().
Definition: Query.cs:495
Task NewObject(object Object)
Reports a new object.
Definition: Query.cs:345
virtual async Task Abort()
Aborts the query.
Definition: Query.cs:168
Task Start()
Starts query execution.
Definition: Query.cs:204
Task NewRecords(string TableId, params Record[] Records)
Reports a new set of records in a table.
Definition: Query.cs:291
object State
State object.
Definition: Query.cs:61
Task BeginSection(string Header)
Begins a new section. Sections can be nested. Each call to BeginSection(string) must be followed by a...
Definition: Query.cs:474
Task NewTable(string TableId, string TableName, params Column[] Columns)
Defines a new table in the query output.
Definition: Query.cs:263
Task LogMessage(Exception Exception)
Logs an Exception as a query message.
Definition: Query.cs:372
async Task Done()
Query execution completed.
Definition: Query.cs:232
Task SetStatus(string Status)
Sets the current status of the query execution.
Definition: Query.cs:448
Task SetTitle(string Title)
Sets the title of the report.
Definition: Query.cs:421
Event arguments for query title events.