DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Private Attributes | List of all members
Deveel.Data.Routines.FunctionProvider.DelegateFunction Class Reference
Inheritance diagram for Deveel.Data.Routines.FunctionProvider.DelegateFunction:
Deveel.Data.Routines.Function Deveel.Data.Routines.IFunction Deveel.Data.Routines.IRoutine Deveel.Data.Sql.IDbObject

Public Member Functions

 DelegateFunction (FunctionInfo functionInfo, Func< InvokeContext, InvokeResult > functionBody, Func< InvokeContext, SqlType > returnType)
 
override InvokeResult Execute (InvokeContext context)
 Executes the function and provides a result. More...
 
override SqlType ReturnType (InvokeContext context)
 Resolves the function return type against the given context. More...
 
- Public Member Functions inherited from Deveel.Data.Routines.Function
SqlType ReturnType ()
 Gets the function static return type More...
 

Private Attributes

readonly Func< InvokeContext, InvokeResultfunctionBody
 
readonly Func< InvokeContext, SqlTypereturnType
 

Additional Inherited Members

- Static Public Attributes inherited from Deveel.Data.Routines.Function
static readonly SqlType DynamicType = new DynamicSqlType()
 A special SqlType that is used to mark an argument of a function as dynamic. More...
 
- Protected Member Functions inherited from Deveel.Data.Routines.Function
 Function (FunctionInfo functionInfo)
 
 Function (ObjectName name, RoutineParameter[] parameters, FunctionType functionType)
 
 Function (ObjectName name, RoutineParameter[] parameters, SqlType returnType)
 
 Function (ObjectName name, RoutineParameter[] parameters, SqlType returnType, FunctionType functionType)
 
- Properties inherited from Deveel.Data.Routines.Function
FunctionType FunctionType [get]
 
FunctionInfo FunctionInfo [get, private set]
 
ObjectName FunctionName [get]
 
RoutineInfo IRoutine. RoutineInfo [get]
 
RoutineType IRoutine. Type [get]
 
DbObjectType IDbObject. ObjectType [get]
 
ObjectName IDbObject. FullName [get]
 
- Properties inherited from Deveel.Data.Routines.IFunction
FunctionType FunctionType [get]
 Gets the type of function. More...
 
- Properties inherited from Deveel.Data.Routines.IRoutine
RoutineType Type [get]
 Gets the type of routine that will be executed. More...
 
RoutineInfo RoutineInfo [get]
 
- Properties inherited from Deveel.Data.Sql.IDbObject
ObjectName FullName [get]
 Gets the fully qualified name of the object used to resolve it uniquely within the database. More...
 
DbObjectType ObjectType [get]
 Gets the type of database object that the implementation is for More...
 

Detailed Description

Definition at line 105 of file FunctionProvider.cs.

Constructor & Destructor Documentation

Deveel.Data.Routines.FunctionProvider.DelegateFunction.DelegateFunction ( FunctionInfo  functionInfo,
Func< InvokeContext, InvokeResult functionBody,
Func< InvokeContext, SqlType returnType 
)
inline

Definition at line 109 of file FunctionProvider.cs.

110  : base(functionInfo) {
111  this.functionBody = functionBody;
112  this.returnType = returnType;
113  }
readonly Func< InvokeContext, InvokeResult > functionBody
readonly Func< InvokeContext, SqlType > returnType

Member Function Documentation

override InvokeResult Deveel.Data.Routines.FunctionProvider.DelegateFunction.Execute ( InvokeContext  context)
inlinevirtual

Executes the function and provides a result.

Parameters
contextThe context of the execution.
Returns
Returns a InvokeResult instance that encapsulates the returned value of the function.
See also
InvokeResult.ReturnValue

Implements Deveel.Data.Routines.Function.

Definition at line 115 of file FunctionProvider.cs.

115  {
116  return functionBody(context);
117  }
readonly Func< InvokeContext, InvokeResult > functionBody
override SqlType Deveel.Data.Routines.FunctionProvider.DelegateFunction.ReturnType ( InvokeContext  context)
inlinevirtual

Resolves the function return type against the given context.

Parameters
contextThe execution context used to resolve the function return type.
Returns
Returns an instance of SqlType that defines the type of the returned value resolved against the given execution context..

Reimplemented from Deveel.Data.Routines.Function.

Definition at line 119 of file FunctionProvider.cs.

119  {
120  if (returnType == null)
121  return FunctionInfo.ReturnType;
122 
123  return returnType(context);
124  }
readonly Func< InvokeContext, SqlType > returnType

Member Data Documentation

readonly Func<InvokeContext, InvokeResult> Deveel.Data.Routines.FunctionProvider.DelegateFunction.functionBody
private

Definition at line 106 of file FunctionProvider.cs.

readonly Func<InvokeContext, SqlType> Deveel.Data.Routines.FunctionProvider.DelegateFunction.returnType
private

Definition at line 107 of file FunctionProvider.cs.


The documentation for this class was generated from the following file: