public void insertNode(uint id) { Factory.TurnFilterOffSafely turnFilterOffSafely = new Factory.TurnFilterOffSafely(fact); if (!fact.getExist(id)) { StackTrace st = new StackTrace(new StackFrame(true)); StackFrame sf = st.GetFrame(0); throw new LimException(sf.GetFileName() + " : " + sf.GetFileLineNumber(), "Invalid NodeId (" + fact.getRef(id) + ")"); } if (selectorFunc != null) { if (!selectorFunc(fact.getRef(id))) { return; } } for (int i = reContainer.Count; i < id + 1; i++) { reContainer.Add(null); } if (reContainer[(int)id] == null) { reContainer[(int)id] = new Dictionary <Types.EdgeKind, LinkedList <uint> >(); } }
/// <summary> /// Sets the state of the node, all of its descendants and all of its ancestors to not filtered. /// </summary> /// <param name="id">[in] The id of the node.</param> /// <exception cref="Columbus.Csharp.Asg.CsharpException">Throws CsharpException if the id is too large (larger than the size of the Filter).</exception> public void setNotFiltered(uint id) { if (fact.getExist(id)) { Factory.TurnFilterOffSafely turnFilterOffSafely = new Factory.TurnFilterOffSafely(fact); Visitors.VisitorFilter visitorFilter = new Visitors.VisitorFilter(fact, false); Algorithms.AlgorithmPreorder algorithmPreorder = new Algorithms.AlgorithmPreorder(); algorithmPreorder.run(fact, visitorFilter, fact.getRef(id)); do { container[(int)id] = FilterState.NotFiltered; id = fact.getRef(id).Parent; } while (id != 0); turnFilterOffSafely.restore(); } }
public ReverseEdges(Factory factory, FuncPtrWithBaseParameterType selectorFunction) { fact = factory; selectorFunc = selectorFunction; reContainer = new List <Dictionary <Types.EdgeKind, LinkedList <uint> > >(); for (int i = 0; i < fact.Size; i++) { reContainer.Add(null); } AlgorithmPreorder ap = new AlgorithmPreorder(); ap.setSafeMode(); ap.setVisitSpecialNodes(true, true); Visitors.VisitorReverseEdges visitor = new Visitors.VisitorReverseEdges(this); Factory.TurnFilterOffSafely tfos = new Factory.TurnFilterOffSafely(fact); ap.run(fact, visitor); }