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

            var tmp = (SubPredicateAtom)other;

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

            var tmp = (NotAtom)other;

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

            var tmp = (ProtocolAtom)other;

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