Esempio n. 1
0
 public FunctionInfo(ObjectName routineName, RoutineParameter[] parameters, SqlType returnType, FunctionType functionType)
     : base(routineName, parameters)
 {
     ReturnType = returnType;
     FunctionType = functionType;
     AssertUnboundAtEnd();
 }
Esempio n. 2
0
 public FunctionInfo(ObjectName routineName, SqlType returnType, FunctionType functionType)
     : base(routineName)
 {
     ReturnType = returnType;
     FunctionType = functionType;
     AssertUnboundAtEnd();
 }
Esempio n. 3
0
 public FunctionParameter(FunctionType[] types, string reference, FunctionParameterMatch match)
     : this(false)
 {
     this.types = types;
     if (String.IsNullOrEmpty(reference))
         reference = NoRefernece;
     this.reference = String.Intern(reference);
     this.match = match;
 }
Esempio n. 4
0
 public UserFunction(ObjectName name, RoutineParameter[] parameters, SqlType returnType, FunctionType functionType)
     : base(name, parameters, returnType, functionType)
 {
 }
Esempio n. 5
0
 public UserFunction(ObjectName name, RoutineParameter[] parameters, FunctionType functionType)
     : base(name, parameters, functionType)
 {
 }
Esempio n. 6
0
 protected Function(ObjectName name, RoutineParameter[] parameters, SqlType returnType, FunctionType functionType)
     : this(new FunctionInfo(name, parameters, returnType, functionType))
 {
 }
Esempio n. 7
0
 protected Function(ObjectName name, RoutineParameter[] parameters, FunctionType functionType)
     : this(name, parameters, null, functionType)
 {
 }
Esempio n. 8
0
        private FunctionType TypesConsume(int paramIndex, int paramConsume, IList<SqlType> args, int start, int end, FunctionType guessedT)
        {
            // If size mismatch on consumed amount
            if (end - start != paramConsume)
                return null;

            for (int i = start; i < end; ++i) {
                SqlType t = args[i];
                FunctionParameter param = function.Parameters[paramIndex];
                FunctionType[] types = param.Types;

                if (!TypeMatches(t, types))
                    return null;

                if (guessedT.IsReference) {
                    string reference = param.Reference;
                    if (guessedT.Reference.Equals(reference)) {
                        guessedT = new FunctionType(t);
                    }
                }
                // Go to the next param,
                ++paramIndex;
            }

            // All matches,
            return guessedT;
        }
Esempio n. 9
0
        private FunctionType RegexConsume(int paramIndex, IList<SqlType> args, int start, int end, FunctionType guessedT)
        {
            FunctionParameter param = function.Parameters[paramIndex];
            FunctionParameterMatch regexType = param.Match;
            string reference = param.Reference;
            FunctionType[] types = param.Types;

            if (end - start == 0)
                if (regexType == FunctionParameterMatch.OneOrMore) {
                    return null;
            }
            if (end - start > 1) {
                if (regexType == FunctionParameterMatch.ZeroOrOne) {
                    return null;
                }
            }

            for (int i = start; i < end; ++i) {
                SqlType t = args[i];

                if (!TypeMatches(t, types)) {
                    return null;
                }
                if (guessedT.IsReference) {
                    if (guessedT.Reference.Equals(reference)) {
                        guessedT = new FunctionType(t);
                    }
                }
            }

            return guessedT;
        }
Esempio n. 10
0
 public SystemFunctionInfo(string functionName, RoutineParameter[] parameters, SqlType returnType, FunctionType functionType)
     : base(new ObjectName(functionName), parameters, returnType, functionType)
 {
 }
Esempio n. 11
0
 public SystemFunctionInfo(string functionName, RoutineParameter[] parameters, FunctionType functionType)
     : this(functionName, parameters, null, functionType)
 {
 }
Esempio n. 12
0
 public IFunctionConfiguration OfType(FunctionType functionType)
 {
     FunctionType = functionType;
     return this;
 }
Esempio n. 13
0
 public FunctionParameter(FunctionType[] types)
     : this(types, FunctionParameterMatch.Exact)
 {
 }
Esempio n. 14
0
 public FunctionParameter(FunctionType[] types, FunctionParameterMatch match)
     : this(types, NoRefernece, match)
 {
 }
Esempio n. 15
0
 public FunctionInfo(ObjectName routineName, RoutineParameter[] parameters, FunctionType functionType)
     : this(routineName, parameters, null, functionType)
 {
 }
Esempio n. 16
0
 /// <summary>
 /// Constructs a <see cref="FunctionInfo"/> without arguments.
 /// </summary>
 /// <param name="routineName">The name of the function.</param>
 /// <param name="functionType">The type of function this</param>
 public FunctionInfo(ObjectName routineName, FunctionType functionType)
     : this(routineName, (SqlType)null, functionType)
 {
 }