Exemple #1
0
        /// <summary>
        /// Copies a DistinctOp
        /// </summary>
        /// <param name="op">The Op to Copy</param>
        /// <param name="n">The Node that references the Op</param>
        /// <returns>A copy of the original Node that references a copy of the original Op</returns>
        public override Node Visit(DistinctOp op, Node n)
        {
            // Visit the Node's children and map their Vars
            List <Node> children = ProcessChildren(n);

            // Copy the DistinctOp's Keys
            VarVec newDistinctKeys = Copy(op.Keys);

            // Create a new DistinctOp that uses the copied keys
            DistinctOp newDistinctOp = m_destCmd.CreateDistinctOp(newDistinctKeys);

            // Return a new Node that references the copied DistinctOp and has the copied child Nodes as its children
            return(m_destCmd.CreateNode(newDistinctOp, children));
        }
Exemple #2
0
        public override void Visit(DistinctOp op, Node n)
        {
            Dictionary <string, object> attrs = new Dictionary <string, object>();

            StringBuilder sb        = new StringBuilder();
            string        separator = string.Empty;

            foreach (Var v in op.Keys)
            {
                sb.Append(separator);
                sb.Append(v.Id);
                separator = ",";
            }
            if (0 != sb.Length)
            {
                attrs.Add("Keys", sb.ToString());
            }

            using (new AutoXml(this, op, attrs)) {
                VisitChildren(n);
            }
        }
Exemple #3
0
 public override void Visit(DistinctOp op, Node n)
 {
     VisitRelOpDefault(op, n);
     AssertRelOp(n.Child0.Op);
 }