DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Protected Member Functions | Properties | Static Private Member Functions | List of all members
Deveel.Data.Spatial.SpatialFunctionProvider Class Reference
Inheritance diagram for Deveel.Data.Spatial.SpatialFunctionProvider:
Deveel.Data.Routines.FunctionProvider Deveel.Data.Routines.IRoutineResolver Deveel.Data.Sql.Fluid.IConfigurationContext

Protected Member Functions

override ObjectName NormalizeName (ObjectName functionName)
 
override void OnInit ()
 
- Protected Member Functions inherited from Deveel.Data.Routines.FunctionProvider
 FunctionProvider ()
 
void Register (FunctionInfo functionInfo, Func< InvokeContext, InvokeResult > body, Func< InvokeContext, SqlType > returnType)
 
void Register (Func< IFunctionConfiguration, IFunctionConfiguration > config)
 
void Register (IFunction function)
 
virtual void Dispose (bool disposing)
 

Properties

override string SchemaName [get]
 
- Properties inherited from Deveel.Data.Routines.FunctionProvider
abstract string SchemaName [get]
 
- Properties inherited from Deveel.Data.Sql.Fluid.IConfigurationContext
string SchemaName [get]
 

Static Private Member Functions

static InvokeResult Simple (InvokeContext context, Func< DataObject[], DataObject > func)
 

Additional Inherited Members

- Public Member Functions inherited from Deveel.Data.Routines.FunctionProvider
IFunction ResolveFunction (Invoke invoke, IQuery query)
 
void Dispose ()
 

Detailed Description

Definition at line 10 of file SpatialFunctionProvider.cs.

Member Function Documentation

override ObjectName Deveel.Data.Spatial.SpatialFunctionProvider.NormalizeName ( ObjectName  functionName)
inlineprotectedvirtual

Reimplemented from Deveel.Data.Routines.FunctionProvider.

Definition at line 15 of file SpatialFunctionProvider.cs.

15  {
16  if (functionName.Parent == null)
17  functionName = new ObjectName(new ObjectName(SchemaName), functionName.Name);
18 
19  return base.NormalizeName(functionName);
20  }
Describes the name of an object within a database.
Definition: ObjectName.cs:44
ObjectName Parent
Gets the parent reference of the current one, if any or null if none.
Definition: ObjectName.cs:99
string Name
Gets the name of the object being referenced.
Definition: ObjectName.cs:108
override void Deveel.Data.Spatial.SpatialFunctionProvider.OnInit ( )
inlineprotectedvirtual

Implements Deveel.Data.Routines.FunctionProvider.

Definition at line 28 of file SpatialFunctionProvider.cs.

28  {
29  Register(config => config.Named("from_wkb")
30  .WithParameter(p => p.Named("source").OfType(PrimitiveTypes.Binary()))
31  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.FromWkb(args[0])))
32  .ReturnsType(SpatialType.Geometry()));
33 
34  Register(config => config.Named("from_wkt")
35  .WithParameter(p => p.Named("source").OfType(PrimitiveTypes.String()))
36  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.FromWkt(context.Request, args[0])))
37  .ReturnsType(SpatialType.Geometry()));
38 
39  Register(config => config.Named("to_wkt")
40  .WithParameter(p => p.Named("g").OfType(SpatialType.Geometry()))
41  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.ToWkt(args[0])))
42  .ReturnsString());
43 
44  Register(config => config.Named("to_wkb")
45  .WithParameter(p => p.Named("g").OfType(SpatialType.Geometry()))
46  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.ToWkb(args[0])))
47  .ReturnsBinary());
48 
49  Register(config => config.Named("envelope")
50  .WithParameter(p => p.Named("g").OfType(SpatialType.Geometry()))
51  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.Envelope(args[0])))
52  .ReturnsType(SpatialType.Geometry()));
53 
54  Register(config => config.Named("distance")
55  .WithParameter(p => p.Named("g1").OfType(SpatialType.Geometry()))
56  .WithParameter(p => p.Named("g2").OfType(SpatialType.Geometry()))
57  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.Distance(args[0], args[1])))
58  .ReturnsNumeric());
59 
60  Register(config => config.Named("contains")
61  .WithSpatialParameter("g1")
62  .WithSpatialParameter("g2")
63  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.Contains(args[0], args[1])))
64  .ReturnsBoolean());
65 
66  Register(config => config.Named("area")
67  .WithSpatialParameter("g")
68  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.Area(args[0])))
69  .ReturnsSpatialType());
70 
71  Register(config => config.Named("boundary")
72  .WithSpatialParameter("g")
73  .WhenExecute(context => Simple(context, args => SpatialSystemFunctions.Boundary(args[0])))
74  .ReturnsSpatialType());
75 
76 
77  // TODO: Implement the functions
78  }
Provides some helper functions for resolving and creating SqlType instances that are primitive to the...
static InvokeResult Simple(InvokeContext context, Func< DataObject[], DataObject > func)
static BinaryType Binary(int maxSize)
void Register(FunctionInfo functionInfo, Func< InvokeContext, InvokeResult > body, Func< InvokeContext, SqlType > returnType)
static InvokeResult Deveel.Data.Spatial.SpatialFunctionProvider.Simple ( InvokeContext  context,
Func< DataObject[], DataObject func 
)
inlinestaticprivate

Definition at line 22 of file SpatialFunctionProvider.cs.

22  {
23  var args = context.EvaluatedArguments;
24  var funcResult = func(args);
25  return context.Result(funcResult);
26  }
InvokeResult Result(DataObject value)

Property Documentation

override string Deveel.Data.Spatial.SpatialFunctionProvider.SchemaName
get

Definition at line 11 of file SpatialFunctionProvider.cs.


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