NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode Class Reference
Inheritance diagram for Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode:
Collaboration diagram for Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode:

Public Member Functions

 TrafficGraphSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >
void Add (ISyntaxNode node)
 
void Assemble (ISyntaxNode node)
 
Compile ()
 
void CompileNode ()
 
IEnumerator< ISyntaxNodeGetEnumerator ()
 
void Resolve (SymbolTable table)
 
void Validate (SymbolTable table)
 

Protected Member Functions

override TrafficGraphConfiguration InternalCompile ()
 
override void ValidateMandatories ()
 Override to validates the mandatory types in this syntax node. More...
 
override void ValidateTypes ()
 Override to validates the types in this syntax node. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >
 SyntaxNode (Symbol symbol, string name, int line, bool requirePath=false)
 
void AddError (string message)
 
void AddReferenceNameError (ISyntaxNode node, string keyword, string name)
 
void AddReferenceTypeError (ISyntaxNode node, string keyword, string section, string name)
 
void CheckAllIsPresent (IEnumerable< Symbol > list)
 
void CheckIsUnique (IEnumerable< Symbol > list)
 
Uri CheckLink (string link, string keyword)
 
void CheckOneIsPresent (IEnumerable< Symbol > list)
 
void CheckOnlyOneIsPresent (IEnumerable< Symbol > list)
 
void CheckTypeIs< TU > (Symbol symbol)
 
void CheckTypeIs< TU, TV > (Symbol symbol)
 
virtual void InternalResolve (SymbolTable table)
 Override to resolve references to other syntax nodes from this syntax node. More...
 
virtual void ValidateReferences (SymbolTable table)
 Override to validates the references in this syntax node. More...
 

Additional Inherited Members

- Public Attributes inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >
ConfigurationNode CompiledNode
 
IEnumerable< string > Errors
 
bool HasErrors
 
- Properties inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >
int Line [get]
 
string Name [get]
 
List< ISyntaxNodeNodes [get]
 
bool RequirePath [get]
 
Symbol Symbol [get]
 

Detailed Description

Definition at line 31 of file TrafficGraphSyntaxNode.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode.TrafficGraphSyntaxNode ( string  name,
int  line 
)
inline

Definition at line 33 of file TrafficGraphSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordTrafficGraph.

34  : base(Symbol.KeywordTrafficGraph, name, line, true)
35  {
36  }

Member Function Documentation

override TrafficGraphConfiguration Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

Implements Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >.

Definition at line 38 of file TrafficGraphSyntaxNode.cs.

39  {
40  var frequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFrequency) as IntegerSettingNode;
41  var initialRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordInitialRun) as BooleanSettingNode;
42  var fixedRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFixedRun) as BooleanSettingNode;
43  var title = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTitle) as StringSettingNode;
44  var width = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordWidth) as IntegerSettingNode;
45  var height = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordHeight) as IntegerSettingNode;
46  var timespan = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTimespan) as IntegerSettingNode;
47  var stamp = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordTimeStamp) as TimeStampNode ??
48  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphTime) as TimeStampNode;
49  var recv = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphReceived) as NumericSettingNode;
50  var ignore = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphIgnored) as NumericSettingNode;
51  var drop = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphDropped) as NumericSettingNode;
52  var sent = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphSent) as NumericSettingNode;
53  var notSent = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphNotSent) as NumericSettingNode;
54  var avgRecv = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphAvgReceived) as NumericSettingNode;
55  var avgIgnore = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphAvgIgnored) as NumericSettingNode;
56  var avgDrop = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphAvgDropped) as NumericSettingNode;
57  var avgSent = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphAvgSent) as NumericSettingNode;
58  var avgNotSent = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphAvgNotSent) as NumericSettingNode;
59  var interval = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphPlotInterval) as IntegerSettingNode;
60  var rate = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphPacketRate) as IntegerSettingNode;
61  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as FileDestinationSyntaxNode;
62  var links = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordWebLinks) as WebLinkSyntaxNode;
63 
64  return new TrafficGraphConfiguration(
65  Name,
66  frequency?.Value,
67  initialRun?.Value,
68  fixedRun?.Value,
69  title?.Value,
70  width?.Value,
71  height?.Value,
72  timespan?.Value,
73  stamp?.DateTimeKind,
74  recv?.Value,
75  ignore?.Value,
76  drop?.Value,
77  sent?.Value,
78  notSent?.Value,
79  avgRecv?.Value,
80  avgIgnore?.Value,
81  avgDrop?.Value,
82  avgSent?.Value,
83  avgNotSent?.Value,
84  interval?.Value,
85  rate?.Value,
86  dest?.Compile(),
87  links?.Compile()
88  );
89  }
Traffic graph configuration used when creating Analyzer.Graph.TrafficGraph.
override void Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode.ValidateMandatories ( )
inlineprotectedvirtual

Override to validates the mandatory types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >.

Definition at line 91 of file TrafficGraphSyntaxNode.cs.

92  {
93  CheckIsUnique(new List<Symbol>
94  {
95  Symbol.KeywordFrequency,
96  Symbol.KeywordInitialRun,
97  Symbol.KeywordFixedRun,
98  Symbol.KeywordTitle,
99  Symbol.KeywordWidth,
100  Symbol.KeywordHeight,
101  Symbol.KeywordTimespan,
102  Symbol.KeywordTimeStamp,
103  Symbol.KeywordGraphTime,
104  Symbol.KeywordGraphReceived,
105  Symbol.KeywordGraphIgnored,
106  Symbol.KeywordGraphDropped,
107  Symbol.KeywordGraphSent,
108  Symbol.KeywordGraphNotSent,
109  Symbol.KeywordGraphAvgReceived,
110  Symbol.KeywordGraphAvgIgnored,
111  Symbol.KeywordGraphAvgDropped,
112  Symbol.KeywordGraphAvgSent,
113  Symbol.KeywordGraphAvgNotSent,
114  Symbol.KeywordGraphPlotInterval,
115  Symbol.KeywordGraphPacketRate,
116  Symbol.KeywordDestinations,
117  Symbol.KeywordWebLinks
118  });
119 
120  CheckAllIsPresent(new List<Symbol>
121  {
122  Symbol.KeywordTitle,
123  Symbol.KeywordDestinations
124  });
125 
126  CheckOneIsPresent(new List<Symbol>
127  {
128  Symbol.KeywordGraphReceived,
129  Symbol.KeywordGraphIgnored,
130  Symbol.KeywordGraphDropped,
131  Symbol.KeywordGraphSent,
132  Symbol.KeywordGraphNotSent,
133  Symbol.KeywordGraphAvgReceived,
134  Symbol.KeywordGraphAvgIgnored,
135  Symbol.KeywordGraphAvgDropped,
136  Symbol.KeywordGraphAvgSent,
137  Symbol.KeywordGraphAvgNotSent,
138  Symbol.KeywordGraphPlotInterval,
139  Symbol.KeywordGraphPacketRate
140  });
141 
142  CheckOnlyOneIsPresent(new List<Symbol>
143  {
144  Symbol.KeywordGraphTime,
145  Symbol.KeywordTimeStamp
146  });
147  }
override void Ntp.Analyzer.Config.Syntax.TrafficGraphSyntaxNode.ValidateTypes ( )
inlineprotectedvirtual

Override to validates the types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< TrafficGraphConfiguration >.

Definition at line 149 of file TrafficGraphSyntaxNode.cs.

150  {
151  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
152  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
153  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
154  CheckTypeIs<StringSettingNode>(Symbol.KeywordTitle);
155  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordWidth);
156  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordHeight);
157  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordTimespan);
158  CheckTypeIs<TimeStampNode>(Symbol.KeywordGraphTime);
159  CheckTypeIs<TimeStampNode>(Symbol.KeywordTimeStamp);
160  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphReceived);
161  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphIgnored);
162  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphDropped);
163  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphSent);
164  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphNotSent);
165  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphAvgReceived);
166  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphAvgIgnored);
167  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphAvgDropped);
168  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphAvgSent);
169  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphAvgNotSent);
170  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphPlotInterval);
171  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphPacketRate);
172  }

The documentation for this class was generated from the following file: