DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Public Member Functions | List of all members
Deveel.Data.Sql.Query.SystemContextExtensions Class Reference

Static Public Member Functions

static void SerializeQueryPlan (this ISystemContext context, IQueryPlanNode planNode, Stream stream)
 
static void SerializeQueryPlan (this ISystemContext context, IQueryPlanNode node, BinaryWriter writer)
 
static IQueryPlanNode DeserializeQueryPlan (this ISystemContext context, Type nodeType, BinaryReader reader)
 

Detailed Description

Definition at line 24 of file SystemContextExtensions.cs.

Member Function Documentation

static IQueryPlanNode Deveel.Data.Sql.Query.SystemContextExtensions.DeserializeQueryPlan ( this ISystemContext  context,
Type  nodeType,
BinaryReader  reader 
)
inlinestatic

Definition at line 45 of file SystemContextExtensions.cs.

45  {
46  var serializers = context.ResolveAllServices<IQueryPlanNodeSerializer>();
47  foreach (var serializer in serializers) {
48  if (serializer.CanSerialize(nodeType)) {
49  return (IQueryPlanNode)serializer.Deserialize(reader);
50  }
51  }
52 
53  throw new InvalidOperationException(string.Format("Could not find any serializer for node type '{0}'.", nodeType));
54  }
static void Deveel.Data.Sql.Query.SystemContextExtensions.SerializeQueryPlan ( this ISystemContext  context,
IQueryPlanNode  planNode,
Stream  stream 
)
inlinestatic

Definition at line 25 of file SystemContextExtensions.cs.

25  {
26  using (var writer = new BinaryWriter(stream, Encoding.Unicode)) {
27  context.SerializeQueryPlan(planNode, writer);
28  }
29  }
static void Deveel.Data.Sql.Query.SystemContextExtensions.SerializeQueryPlan ( this ISystemContext  context,
IQueryPlanNode  node,
BinaryWriter  writer 
)
inlinestatic

Definition at line 31 of file SystemContextExtensions.cs.

31  {
32  var nodeType = node.GetType();
33 
34  var serializers = context.ResolveAllServices<IQueryPlanNodeSerializer>();
35  foreach (var serializer in serializers) {
36  if (serializer.CanSerialize(nodeType)) {
37  serializer.Serialize(node, writer);
38  return;
39  }
40  }
41 
42  throw new InvalidOperationException(string.Format("Could not find any serializer for node type '{0}'.", nodeType));
43  }

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