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); }
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); } }
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); }
// <summary> // Default handler for all constant Ops // </summary> protected virtual TResultType VisitConstantOp(ConstantBaseOp op, Node n) { return(VisitScalarOpDefault(op, n)); }