示例#1
0
        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;
            }
        }
示例#2
0
        public override bool Equals(PredicateAtom other)
        {
            if (other.AtomType != PredicateAtomType.SubPredicate)
            {
                return(false);
            }

            var tmp = (SubPredicateAtom)other;

            return(Predicate == tmp.Predicate);
        }
示例#3
0
        public override bool Equals(PredicateAtom other)
        {
            if (other.AtomType != PredicateAtomType.Not)
            {
                return(false);
            }

            var tmp = (NotAtom)other;

            return(Operand == tmp.Operand);
        }
示例#4
0
        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);
        }
示例#5
0
        public override bool Equals(PredicateAtom other)
        {
            if (other.AtomType != PredicateAtomType.Protocol)
            {
                return(false);
            }

            var tmp = (ProtocolAtom)other;

            return(Protocol == tmp.Protocol);
        }
示例#6
0
 public NotAtom(PredicateAtom operand)
 {
     AtomType     = PredicateAtomType.Not;
     this.Operand = operand;
 }