I have to implement a call graph such as Now I have to implement a calculator which lists one at a time, which is all topological ordering between calls which satisfy the dependency order . And here's the problem. This is a simple node for the call graph: And this call graph is the same class: Now, the problem is that it will not work. When I try to create a Then I have tried: This works, but the method Any thoughts? The problem is that you both To apply a "normal" interface: Alternatively, you can stick with clear interface implementation, but use it: Id = Id (absolute); And there was not a problem
class Call Graph: INIMERABLE & lt; list & lt; call graphnode & gt; & gt; {public list & lt; call graphnode & gt; nodes = new list & lt; callGraphNode & gt; ( ); Public Zero AddNode (CallGraphNode n) {Add Node;} Public Static Zero Show (IEnumerable & lt; CallGraphNode & gt; n) {foreach (ng in callGraphNode node) {Console.Write ("{0} ", Node);} console. Wrightite ();} Fixed IEnumerable & lt; list & gt; callGraphNode & gt; & gt; enfymerfunctions (list & amp; lt; call graphnode & gt; executable, list & amp; lift; CallGraphNode & gt; res) {If (executable.ccount == 0) yield returns ridge; Second Forex (CallGraphNode n in executable) {If (! N.Executed) res.Add (n); & Lt; CallGraphNode & gt; Next_executable = New list & lt; CallGraphNode & gt; (Executable); Executable.Remove (N); Foreach (call.graphNode M in independent.g) if (--m.dependencies == 0) next_executable.Add (m); Foreign exchange (list & amp; lt; CallGraphNode & gt; in other enfimated functions (Next_Great, Ridge) yield returns; Foreach (CallGraphNode M in n.dependents) m. Dependencies ++; If (! N.Executed) res.Remove (n); }} IEnumerator & lt; List & lt; CallGraphNode & gt; & Gt; IEnumerable & lt; List & lt; CallGraphNode & gt; & Gt; .GetEnumerator () {List & lt; CallGraphNode & gt; Executable = New list & lt; CallGraphNode & gt; (); Forward (call graph node in nodes) if (n.Executable || n.Executed) is executable. Add (n); & Lt; CallGraphNode & gt; Output = new list & lt; CallGraphNode & gt; (); Novel (list & lt; CallGraphNode & gt; list) yield list in advance (encuitable, output); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () {Throw New NotImplementedException); }}
IEnumerator and assign it a
GetEnumerator () return value, I get a casting error and try to do it honestly What time did I expect:
IEnumerator & lt; List & lt; CallGraphNode & gt; & Gt; Lt = cg.GetEnumerator ();
system Selection. GenericList & lt; CallGraphNode & gt; Enumerator en = cg.nodes.GetEnumerator ();
anamoretifon is never called and the calculator has the basic list of graph nodes only.
IEnumerable <
IEnumerator & lt; List & lt; CallGraphNode & gt; & Gt; T & gt; IEnumerable & lt; List & lt; CallGraphNode & gt; & Gt; .GetEnumerator ()
Public IEnumerator & lt; List & lt; CallGraphNode & gt; & Gt; ; GetEnumerator ()
IEnumerable & lt; List & lt; CallGraphNode & gt; & Gt; Sequence = CG; IEnumerator & LT; From the list & lt; CallGraphNode & gt; & Gt; Lieutenant = sequence GETEnumerator ();
Comments
Post a Comment