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

Public Member Functions

 PeerGraphSyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< PeerGraphConfiguration >
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 PeerGraphConfiguration 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< PeerGraphConfiguration >
 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< PeerGraphConfiguration >
ConfigurationNode CompiledNode
 
IEnumerable< string > Errors
 
bool HasErrors
 
- Properties inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< PeerGraphConfiguration >
int Line [get]
 
string Name [get]
 
List< ISyntaxNodeNodes [get]
 
bool RequirePath [get]
 
Symbol Symbol [get]
 

Detailed Description

Definition at line 31 of file PeerGraphSyntaxNode.cs.

Constructor & Destructor Documentation

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

Definition at line 33 of file PeerGraphSyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordPeerGraph.

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

Member Function Documentation

override PeerGraphConfiguration Ntp.Analyzer.Config.Syntax.PeerGraphSyntaxNode.InternalCompile ( )
inlineprotectedvirtual

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

Definition at line 38 of file PeerGraphSyntaxNode.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 filter = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFilterFactor) as NumericSettingNode;
50  var jitter = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordJitter) as NumericSettingNode;
51  var offset = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordOffset) as NumericSettingNode;
52  var balance = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphBalance) as NumericSettingNode;
53  var delay = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordGraphDelay) as NumericSettingNode;
54  var dest = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordDestinations) as DirDestinationSyntaxNode;
55  var links = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordWebLinks) as WebLinkSyntaxNode;
56 
57  return new PeerGraphConfiguration(
58  Name,
59  frequency?.Value,
60  initialRun?.Value,
61  fixedRun?.Value,
62  title?.Value,
63  width?.Value,
64  height?.Value,
65  timespan?.Value,
66  stamp?.DateTimeKind,
67  filter?.Value,
68  balance?.Value,
69  delay?.Value,
70  jitter?.Value,
71  offset?.Value,
72  dest?.Compile(),
73  links?.Compile()
74  );
75  }
Peer graph configuration used when creating Ntp.Analyzer.Graph.PeerGraph.
override void Ntp.Analyzer.Config.Syntax.PeerGraphSyntaxNode.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< PeerGraphConfiguration >.

Definition at line 77 of file PeerGraphSyntaxNode.cs.

78  {
79  CheckIsUnique(new List<Symbol>
80  {
81  Symbol.KeywordFrequency,
82  Symbol.KeywordInitialRun,
83  Symbol.KeywordFixedRun,
84  Symbol.KeywordTitle,
85  Symbol.KeywordWidth,
86  Symbol.KeywordHeight,
87  Symbol.KeywordTimespan,
88  Symbol.KeywordTimeStamp,
89  Symbol.KeywordGraphTime,
90  Symbol.KeywordFilterFactor,
91  Symbol.KeywordGraphBalance,
92  Symbol.KeywordGraphDelay,
93  Symbol.KeywordJitter,
94  Symbol.KeywordOffset,
95  Symbol.KeywordDestinations,
96  Symbol.KeywordWebLinks
97  });
98 
99  CheckAllIsPresent(new List<Symbol>
100  {
101  Symbol.KeywordTitle,
102  Symbol.KeywordDestinations
103  });
104 
105  CheckOneIsPresent(new List<Symbol>
106  {
107  Symbol.KeywordGraphBalance,
108  Symbol.KeywordGraphDelay,
109  Symbol.KeywordJitter,
110  Symbol.KeywordOffset
111  });
112 
113  CheckOnlyOneIsPresent(new List<Symbol>
114  {
115  Symbol.KeywordGraphTime,
116  Symbol.KeywordTimeStamp
117  });
118  }
override void Ntp.Analyzer.Config.Syntax.PeerGraphSyntaxNode.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< PeerGraphConfiguration >.

Definition at line 120 of file PeerGraphSyntaxNode.cs.

121  {
122  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
123  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
124  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
125  CheckTypeIs<StringSettingNode>(Symbol.KeywordTitle);
126  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordWidth);
127  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordHeight);
128  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordTimespan);
129  CheckTypeIs<TimeStampNode>(Symbol.KeywordGraphTime);
130  CheckTypeIs<TimeStampNode>(Symbol.KeywordTimeStamp);
131  CheckTypeIs<NumericSettingNode>(Symbol.KeywordFilterFactor);
132  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphBalance);
133  CheckTypeIs<NumericSettingNode>(Symbol.KeywordGraphDelay);
134  CheckTypeIs<NumericSettingNode>(Symbol.KeywordJitter);
135  CheckTypeIs<NumericSettingNode>(Symbol.KeywordOffset);
136  }

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