Exemplo n.º 1
0
        internal override bool IsEquivalent(Op other)
        {
            ConstantBaseOp constantBaseOp = other as ConstantBaseOp;

            if (constantBaseOp == null || this.OpType != other.OpType || !constantBaseOp.Type.EdmEquals((MetadataItem)this.Type))
            {
                return(false);
            }
            if (constantBaseOp.Value != null || this.Value != null)
            {
                return(constantBaseOp.Value.Equals(this.Value));
            }
            return(true);
        }
Exemplo n.º 2
0
 protected override void VisitConstantOp(ConstantBaseOp op, Node n)
 {
     using (new AutoString(this, op))
     {
         if (null == op.Value)
         {
             WriteString("null");
         }
         else
         {
             WriteString("(");
             WriteString(op.Type.EdmType.FullName);
             WriteString(")");
             WriteString(String.Format(CultureInfo.InvariantCulture, "{0}", op.Value));
         }
         VisitChildren(n);
     }
 }
Exemplo n.º 3
0
 protected override void VisitConstantOp(ConstantBaseOp op, Node n)
 {
     using (new Dump.AutoString(this, (Op)op))
     {
         if (op.Value == null)
         {
             this.WriteString("null");
         }
         else
         {
             this.WriteString("(");
             this.WriteString(op.Type.EdmType.FullName);
             this.WriteString(")");
             this.WriteString(string.Format((IFormatProvider)CultureInfo.InvariantCulture, "{0}", op.Value));
         }
         this.VisitChildren(n);
     }
 }
        protected override NodeInfo VisitSortOp(SortBaseOp op, Node n)
        {
            ExtendedNodeInfo extendedNodeInfo1 = this.InitExtendedNodeInfo(n);
            ExtendedNodeInfo extendedNodeInfo2 = this.GetExtendedNodeInfo(n.Child0);

            extendedNodeInfo1.Definitions.Or(extendedNodeInfo2.Definitions);
            extendedNodeInfo1.ExternalReferences.Or(extendedNodeInfo2.ExternalReferences);
            extendedNodeInfo1.ExternalReferences.Minus(extendedNodeInfo2.Definitions);
            extendedNodeInfo1.Keys.InitFrom(extendedNodeInfo2.Keys);
            extendedNodeInfo1.NonNullableDefinitions.InitFrom(extendedNodeInfo2.NonNullableDefinitions);
            extendedNodeInfo1.NonNullableVisibleDefinitions.InitFrom(extendedNodeInfo2.NonNullableDefinitions);
            extendedNodeInfo1.InitRowCountFrom(extendedNodeInfo2);
            if (OpType.ConstrainedSort == op.OpType && n.Child2.Op.OpType == OpType.Constant && !((ConstrainedSortOp)op).WithTies)
            {
                ConstantBaseOp op1 = (ConstantBaseOp)n.Child2.Op;
                if (TypeHelpers.IsIntegerConstant(op1.Type, op1.Value, 1L))
                {
                    extendedNodeInfo1.SetRowCount(RowCount.Zero, RowCount.One);
                }
            }
            return((NodeInfo)extendedNodeInfo1);
        }
 /// <summary>
 ///     Default handler for all constantOps
 /// </summary>
 /// <param name="op"> the constant op </param>
 /// <param name="n"> the node </param>
 protected virtual void VisitConstantOp(ConstantBaseOp op, Node n)
 {
     VisitScalarOpDefault(op, n);
 }
 protected virtual void VisitConstantOp(ConstantBaseOp op, Node n)
 {
     this.VisitScalarOpDefault((ScalarOp)op, n);
 }
Exemplo n.º 7
0
 // <summary>
 // Default handler for all constant Ops
 // </summary>
 protected virtual TResultType VisitConstantOp(ConstantBaseOp op, Node n)
 {
     return(VisitScalarOpDefault(op, n));
 }