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

Classes

class  CacheNodePointSerializer
 
class  CompositeNodeSerializer
 
class  ConstantSelectNodeSerializer
 
class  CreateFunctionNodeSerializer
 
class  DistinctNodeSerializer
 
class  EquiJoinNodeSerializer
 
class  ExhaustiveSelectNodeSerializer
 
class  FetchTableNodeSerializer
 
class  FetchViewNodeSerializer
 
class  GroupNodeSerializer
 
class  JoinNodeSerializer
 
class  LeftOuterJoinNodeSerializer
 
class  LimitNodeSerializer
 
class  LogicalUnionNodeSerializer
 
class  MarkerNodeSerializer
 
class  NaturalJoinNodeSerializer
 
class  NonCorrelatedAnyAllNodeSerializer
 
class  QueryPlanNodeSerializer
 
class  QueryPlanNodeSerializerResolver
 
class  RageSelectNodeSerializer
 
class  SimplePatternSelectNodeSerializer
 
class  SimpleSelectNodeSerializer
 
class  SingleRowTableNodeSerializer
 
class  SortNodeSerializer
 
class  SubsetNodeSerializer
 

Static Public Member Functions

static void Serialize (IQueryPlanNode queryPlan, BinaryWriter writer)
 
static IQueryPlanNode Deserialize (Type nodeType, Stream inputStream)
 
static IQueryPlanNode Deserialize (Type nodeType, BinaryReader reader)
 

Static Public Attributes

static readonly IObjectSerializerResolver Resolver = new QueryPlanNodeSerializerResolver()
 

Static Package Functions

static void RegisterSerializers (ISystemContext context)
 

Static Private Member Functions

static void WriteChildNode (BinaryWriter writer, IQueryPlanNode node)
 
static IQueryPlanNode ReadChildNode (BinaryReader reader)
 
static void WriteArray< T > (T[] arrary, BinaryWriter writer, Action< T, BinaryWriter > write)
 
static void WriteObjectNames (ObjectName[] names, BinaryWriter writer)
 
static void WriteExpressions (SqlExpression[] expressions, BinaryWriter writer)
 
static void WriteStrings (string[] array, BinaryWriter writer)
 
static T[] ReadArray< T > (BinaryReader reader, Func< BinaryReader, T > read)
 
static ObjectName[] ReadObjectNames (BinaryReader reader)
 
static SqlExpression[] ReadExpressions (BinaryReader reader)
 
static string[] ReadStrings (BinaryReader reader)
 

Detailed Description

Definition at line 27 of file QueryPlanSerializers.cs.

Member Function Documentation

static IQueryPlanNode Deveel.Data.Sql.Query.QueryPlanSerializers.Deserialize ( Type  nodeType,
Stream  inputStream 
)
inlinestatic

Definition at line 65 of file QueryPlanSerializers.cs.

65  {
66  var seriializer = Resolver.ResolveSerializer(nodeType);
67  if (seriializer == null)
68  throw new InvalidOperationException(String.Format("Could not find any serializer for type '{0}'.", nodeType));
69 
70  return seriializer.Deserialize(inputStream) as IQueryPlanNode;
71  }
A long string in the system.
object Deserialize(Stream inputStream)
IObjectSerializer ResolveSerializer(Type objectType)
static readonly IObjectSerializerResolver Resolver
static IQueryPlanNode Deveel.Data.Sql.Query.QueryPlanSerializers.Deserialize ( Type  nodeType,
BinaryReader  reader 
)
inlinestatic

Definition at line 73 of file QueryPlanSerializers.cs.

73  {
74  var seriializer = Resolver.ResolveSerializer(nodeType) as IObjectBinarySerializer;
75  if (seriializer == null)
76  throw new InvalidOperationException(String.Format("Could not find any serializer for type '{0}'.", nodeType));
77 
78  return (IQueryPlanNode) seriializer.Deserialize(reader);
79  }
A long string in the system.
IObjectSerializer ResolveSerializer(Type objectType)
static readonly IObjectSerializerResolver Resolver
static T [] Deveel.Data.Sql.Query.QueryPlanSerializers.ReadArray< T > ( BinaryReader  reader,
Func< BinaryReader, T >  read 
)
inlinestaticprivate

Definition at line 131 of file QueryPlanSerializers.cs.

131  {
132  var count = reader.ReadInt32();
133  var list = new List<T>(count);
134  for (int i = 0; i < count; i++) {
135  var obj = read(reader);
136  list.Add(obj);
137  }
138 
139  return list.ToArray();
140  }
static IQueryPlanNode Deveel.Data.Sql.Query.QueryPlanSerializers.ReadChildNode ( BinaryReader  reader)
inlinestaticprivate

Definition at line 93 of file QueryPlanSerializers.cs.

93  {
94  var state = reader.ReadByte();
95  if (state == 0)
96  return null;
97 
98  var typeString = reader.ReadString();
99 #if PCL
100  var type = Type.GetType(typeString, true);
101 #else
102  var type = Type.GetType(typeString, true, true);
103 #endif
104 
105  return Deserialize(type, reader);
106  }
static IQueryPlanNode Deserialize(Type nodeType, Stream inputStream)
A user-defined TYPE that holds complex objects in a database column.
static SqlExpression [] Deveel.Data.Sql.Query.QueryPlanSerializers.ReadExpressions ( BinaryReader  reader)
inlinestaticprivate

Definition at line 146 of file QueryPlanSerializers.cs.

146  {
147  return ReadArray(reader, binaryReader => SqlExpression.Deserialize(reader));
148  }
static SqlExpression Deserialize(BinaryReader reader)
Defines the base class for instances that represent SQL expression tree nodes.
static ObjectName [] Deveel.Data.Sql.Query.QueryPlanSerializers.ReadObjectNames ( BinaryReader  reader)
inlinestaticprivate

Definition at line 142 of file QueryPlanSerializers.cs.

142  {
143  return ReadArray(reader, ObjectName.Deserialize);
144  }
static string [] Deveel.Data.Sql.Query.QueryPlanSerializers.ReadStrings ( BinaryReader  reader)
inlinestaticprivate

Definition at line 150 of file QueryPlanSerializers.cs.

150  {
151  return ReadArray(reader, binaryReader => binaryReader.ReadString());
152  }
static void Deveel.Data.Sql.Query.QueryPlanSerializers.RegisterSerializers ( ISystemContext  context)
inlinestaticpackage

Definition at line 30 of file QueryPlanSerializers.cs.

30  {
31  context.RegisterService<CacheNodePointSerializer>();
32  context.RegisterService<CompositeNodeSerializer>();
33  context.RegisterService<ConstantSelectNodeSerializer>();
34  context.RegisterService<CreateFunctionNodeSerializer>();
35  context.RegisterService<DistinctNodeSerializer>();
36  context.RegisterService<EquiJoinNodeSerializer>();
37  context.RegisterService<ExhaustiveSelectNodeSerializer>();
38  context.RegisterService<FetchTableNodeSerializer>();
39  context.RegisterService<FetchViewNodeSerializer>();
40  context.RegisterService<GroupNodeSerializer>();
41  context.RegisterService<JoinNodeSerializer>();
42  context.RegisterService<LeftOuterJoinNodeSerializer>();
43  context.RegisterService<LogicalUnionNodeSerializer>();
44  context.RegisterService<MarkerNodeSerializer>();
45  context.RegisterService<NaturalJoinNodeSerializer>();
46  context.RegisterService<NonCorrelatedAnyAllNodeSerializer>();
47  context.RegisterService<RageSelectNodeSerializer>();
48  context.RegisterService<SimplePatternSelectNodeSerializer>();
49  context.RegisterService<SimpleSelectNodeSerializer>();
50  context.RegisterService<SingleRowTableNodeSerializer>();
51  context.RegisterService<SortNodeSerializer>();
52  context.RegisterService<SubsetNodeSerializer>();
53  context.RegisterService<LimitNodeSerializer>();
54  }
static void Deveel.Data.Sql.Query.QueryPlanSerializers.Serialize ( IQueryPlanNode  queryPlan,
BinaryWriter  writer 
)
inlinestatic

Definition at line 56 of file QueryPlanSerializers.cs.

56  {
57  var nodeType = queryPlan.GetType();
58  var seriializer = Resolver.ResolveSerializer(nodeType) as IObjectBinarySerializer;
59  if (seriializer == null)
60  throw new InvalidOperationException(String.Format("Could not find any serializer for type '{0}'.", nodeType));
61 
62  seriializer.Serialize(queryPlan, writer);
63  }
A long string in the system.
IObjectSerializer ResolveSerializer(Type objectType)
void Serialize(object obj, BinaryWriter writer)
static readonly IObjectSerializerResolver Resolver
static void Deveel.Data.Sql.Query.QueryPlanSerializers.WriteArray< T > ( T[]  arrary,
BinaryWriter  writer,
Action< T, BinaryWriter >  write 
)
inlinestaticprivate

Definition at line 108 of file QueryPlanSerializers.cs.

108  {
109  var count = arrary == null ? 0 : arrary.Length;
110  writer.Write(count);
111 
112  if (arrary != null) {
113  for (int i = 0; i < count; i++) {
114  write(arrary[i], writer);
115  }
116  }
117  }
static void Deveel.Data.Sql.Query.QueryPlanSerializers.WriteChildNode ( BinaryWriter  writer,
IQueryPlanNode  node 
)
inlinestaticprivate

Definition at line 81 of file QueryPlanSerializers.cs.

81  {
82  if (node == null) {
83  writer.Write((byte) 0);
84  } else {
85  var nodeTypeString = node.GetType().FullName;
86  writer.Write((byte)1);
87  writer.Write(nodeTypeString);
88 
89  Serialize(node, writer);
90  }
91  }
static void Serialize(IQueryPlanNode queryPlan, BinaryWriter writer)
static void Deveel.Data.Sql.Query.QueryPlanSerializers.WriteExpressions ( SqlExpression[]  expressions,
BinaryWriter  writer 
)
inlinestaticprivate

Definition at line 123 of file QueryPlanSerializers.cs.

123  {
124  WriteArray(expressions, writer, (expression, binaryWriter) => SqlExpression.Serialize(expression, binaryWriter));
125  }
static void Serialize(SqlExpression expression, BinaryWriter writer)
Defines the base class for instances that represent SQL expression tree nodes.
static void Deveel.Data.Sql.Query.QueryPlanSerializers.WriteObjectNames ( ObjectName[]  names,
BinaryWriter  writer 
)
inlinestaticprivate

Definition at line 119 of file QueryPlanSerializers.cs.

119  {
120  WriteArray(names, writer, ObjectName.Serialize);
121  }
static void Deveel.Data.Sql.Query.QueryPlanSerializers.WriteStrings ( string[]  array,
BinaryWriter  writer 
)
inlinestaticprivate

Definition at line 127 of file QueryPlanSerializers.cs.

127  {
128  WriteArray(array, writer, (s, binaryWriter) => binaryWriter.Write(s));
129  }

Member Data Documentation

readonly IObjectSerializerResolver Deveel.Data.Sql.Query.QueryPlanSerializers.Resolver = new QueryPlanNodeSerializerResolver()
static

Definition at line 28 of file QueryPlanSerializers.cs.


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