private void StoreAtom(PredicateAtom atom) { switch (atom.AtomType) { case PredicateAtomType.SubPredicate: var tmp = ((SubPredicateAtom)atom).Predicate; if (tmp.Subpredicates.Count > 0) { Layer = Math.Max(tmp.Subpredicates.Select(s => s.Layer).Max() + 1, Layer); Subpredicates.AddRange(tmp.Subpredicates); } Subpredicates.Add(tmp); break; case PredicateAtomType.Protocol: ProtocolTargets.Add((ProtocolAtom)atom); break; case PredicateAtomType.Filter: FilterTargets.Add((FilterAtom)atom); break; case PredicateAtomType.Not: StoreAtom(((NotAtom)atom).Operand); break; } }
public override bool Equals(PredicateAtom other) { if (other.AtomType != PredicateAtomType.SubPredicate) { return(false); } var tmp = (SubPredicateAtom)other; return(Predicate == tmp.Predicate); }
public override bool Equals(PredicateAtom other) { if (other.AtomType != PredicateAtomType.Not) { return(false); } var tmp = (NotAtom)other; return(Operand == tmp.Operand); }
public override bool Equals(PredicateAtom other) { if (other.AtomType != PredicateAtomType.Filter) { return(false); } var tmp = (FilterAtom)other; return(Protocol == tmp.Protocol && Field == tmp.Field && Filter == tmp.Filter); }
public override bool Equals(PredicateAtom other) { if (other.AtomType != PredicateAtomType.Protocol) { return(false); } var tmp = (ProtocolAtom)other; return(Protocol == tmp.Protocol); }
public NotAtom(PredicateAtom operand) { AtomType = PredicateAtomType.Not; this.Operand = operand; }