public void BuildSerializeExpression(MessageMemberInfo member, BinarySerializationContext context) { context.Code.Add( Expression.Call( context.QueueParameter, MessageQueueMethods.WriteFloat, Expression.Add(context.PositionParameter, Expression.Constant(member.Offset)), member.GetProperty(context.MessageParameter))); }
public Expression BuildDeserializeExpression(MessageMemberInfo member, BinarySerializationContext context) { return Expression.Convert( Expression.Call( context.QueueParameter, MessageQueueMethods.ReadFloat, Expression.Add(context.PositionParameter, Expression.Constant(member.Offset))), member.Type); }
public Expression BuildDynamicSizeEvaluator(MessageMemberInfo member, BinarySerializationContext context) { return Expression.RightShift( Expression.Add( Expression.Constant(4), Expression.Call( ((Func<string, int>)CircularArrayQueue.ExtensionMethods.GetByteCount).Method, member.GetProperty(context.MessageParameter))), Expression.Constant(2)); }
public Expression BuildDeserializeExpression(MessageMemberInfo member, BinarySerializationContext context) { return Expression.Call( ((Func<IMessageQueue, int, string>)CircularArrayQueue.ExtensionMethods.ReadStringContent).Method, context.QueueParameter, Expression.Add( context.PositionParameter, Expression.Call( context.QueueParameter, MessageQueueMethods.ReadInt32, Expression.Add(Expression.Constant(member.Offset), context.PositionParameter)))); }
public void BuildSerializeExpression(MessageMemberInfo member, BinarySerializationContext context) { Expression expression = member.GetProperty(context.MessageParameter); if (member.Type != typeof(int)) { expression = Expression.Convert(expression, typeof(int)); } context.Code.Add( Expression.Call( context.QueueParameter, MessageQueueMethods.WriteInt32, Expression.Add(context.PositionParameter, Expression.Constant(member.Offset)), expression)); }
public void BuildSerializeExpression(MessageMemberInfo member, BinarySerializationContext context) { context.Code.Add( Expression.Call( context.QueueParameter, MessageQueueMethods.WriteInt32, Expression.Add(context.PositionParameter, Expression.Constant(member.Offset)), Expression.Subtract(context.DynamicPositionParameter, context.PositionParameter))); context.Code.Add( Expression.Assign( context.DynamicPositionParameter, Expression.Call( ((Func<IMessageQueue, int, string, int>)CircularArrayQueue.ExtensionMethods.WriteStringContent).Method, context.QueueParameter, context.DynamicPositionParameter, member.GetProperty(context.MessageParameter)))); }
public Expression BuildDynamicSizeEvaluator(MessageMemberInfo member, BinarySerializationContext context) { return null; }
public static void BuildDeSerializationAndAssignment( this ITypeBinarySerializer binarySerializer, MessageMemberInfo member, BinarySerializationContext context) { Expression expression = member.GetProperty(context.MessageParameter); context.Code.Add(Expression.Assign(expression, binarySerializer.BuildDeserializeExpression(member, context))); }