public void Encode(ref byte *data, ReadOnlyCollection <MemberBinding> value) { if (value == null) { intCodec.Encode(ref data, -1); return; } intCodec.Encode(ref data, value.Count); foreach (var memberBinding in value) { memberBindingCodec.Encode(ref data, memberBinding); } }
public void Encode(ref byte *data, T value) { if (value == null) { typeCodec.Encode(ref data, null); return; } Validate(value); typeCodec.Encode(ref data, value.ReflectedType); typeCodec.Encode(ref data, value.DeclaringType); stringCodec.Encode(ref data, value.Name); EncodeAdditional(ref data, value); }
protected override void EncodeTyped(ref byte *data, ConditionalExpression expression) { CommonCodec.Encode(ref data, expression.Test); CommonCodec.Encode(ref data, expression.IfTrue); CommonCodec.Encode(ref data, expression.IfFalse); typeCodec.Encode(ref data, expression.Type); }
public void Encode(ref byte *data, MemberInfo value) { memberTypesCodec.Encode(ref data, value.MemberType); switch (value.MemberType) { case MemberTypes.Constructor: constructorInfoCodec.Encode(ref data, (ConstructorInfo)value); return; case MemberTypes.Event: eventInfoCodec.Encode(ref data, (EventInfo)value); return; case MemberTypes.Field: fieldInfoCodec.Encode(ref data, (FieldInfo)value); return; case MemberTypes.Method: methodInfoCodec.Encode(ref data, (MethodInfo)value); return; case MemberTypes.Property: propertyInfoCodec.Encode(ref data, (PropertyInfo)value); return; default: throw new NotSupportedException(string.Format("MemberType '{0}' is not spported for encoding/decoding", value.MemberType)); } }
protected override void EncodeTyped(ref byte *data, LambdaExpression expression) { CommonCodec.Encode(ref data, expression.Body); stringCodec.Encode(ref data, expression.Name); boolCodec.Encode(ref data, expression.TailCall); expressionArrayCodec.Encode(ref data, expression.Parameters.Select(x => (Expression)x).ToArray()); }
public void Encode(ref byte *data, T value) { var valueType = value.GetType(); var valueCodec = codecContainer.GetAbstractManualCodecFor(valueType); typeCodec.Encode(ref data, valueType); valueCodec.Encode(ref data, value); }
protected override void EncodeTyped(ref byte *data, ConstantExpression expression) { var type = expression.Type; var valueCodec = CodecContainer.GetAbstractManualCodecFor(type); typeCodec.Encode(ref data, type); valueCodec.Encode(ref data, expression.Value); }
protected override void EncodeTyped(ref byte *data, BinaryExpression expression) { CommonCodec.Encode(ref data, expression.Left); CommonCodec.Encode(ref data, expression.Right); boolCodec.Encode(ref data, expression.IsLiftedToNull); methodInfoCodec.Encode(ref data, expression.Method); CommonCodec.Encode(ref data, expression.Conversion); }
public void Encode(ref byte *data, Expression value) { if (value == null) { expressionTypeCodec.Encode(ref data, NullExpressionType); return; } var subcodec = GetSubcodec(value.NodeType); subcodec.Encode(ref data, value); }
public static byte[] EncodeSingle <T>(this IManualCodec <T> codec, T value) { var data = new byte[codec.CalculateSize(value)]; fixed(byte *pData = data) { var p = pData; codec.Encode(ref p, value); } return(data); }
public void Encode(ref byte *data, MemberBinding value) { memberBindingTypeCodec.Encode(ref data, value.BindingType); switch (value.BindingType) { case MemberBindingType.Assignment: memberAssignmentCodec.Encode(ref data, (MemberAssignment)value); return; case MemberBindingType.MemberBinding: memberMemberBindingCodec.Encode(ref data, (MemberMemberBinding)value); return; case MemberBindingType.ListBinding: memberListBindingCodec.Encode(ref data, (MemberListBinding)value); return; default: throw new ArgumentOutOfRangeException(); } }
public void Encode(ref byte *data, MemberListBinding value) { memberInfoCodec.Encode(ref data, value.Member); elementInitArrayCodec.Encode(ref data, value.Initializers.ToArray()); }
public void Encode(ref byte *data, MemberMemberBinding value) { memberInfoCodec.Encode(ref data, value.Member); memberBindingCollectionCodec.Encode(ref data, value.Bindings); }
public void Encode(ref byte *data, Exception value) { stringCodec.Encode(ref data, value.GetType().AssemblyQualifiedName); stringCodec.Encode(ref data, value.Message); stringCodec.Encode(ref data, value.StackTrace); }
protected override void EncodeTyped(ref byte *data, UnaryExpression expression) { CommonCodec.Encode(ref data, expression.Operand); typeCodec.Encode(ref data, expression.Type); methodInfoCodec.Encode(ref data, expression.Method); }
public void Encode(ref byte *data, object value) { realCodec.Encode(ref data, (T)value); }
protected override void EncodeTyped(ref byte *data, ListInitExpression expression) { CommonCodec.Encode(ref data, expression.NewExpression); elementInitArrayCodec.Encode(ref data, expression.Initializers.ToArray()); }
protected override void EncodeTyped(ref byte *data, NewExpression expression) { constructorInfoCodec.Encode(ref data, expression.Constructor); expressionArrayCodec.Encode(ref data, expression.Arguments.ToArray()); memberInfoArrayCodec.Encode(ref data, expression.Members != null ? expression.Members.ToArray() : null); }
protected override void EncodeAdditional(ref byte *data, T value) { typeArrayCodec.Encode(ref data, value.IsGenericMethod ? value.GetGenericArguments() : null); typeArrayCodec.Encode(ref data, value.GetParameters().Select(x => x.ParameterType).ToArray()); }
protected override void EncodeTyped(ref byte *data, MemberExpression expression) { CommonCodec.Encode(ref data, expression.Expression); memberInfoCodec.Encode(ref data, expression.Member); }
protected override void EncodeTyped(ref byte *data, NewArrayExpression expression) { typeCodec.Encode(ref data, expression.Type.GetElementType()); expressionArrayCodec.Encode(ref data, expression.Expressions.ToArray()); }
protected override void EncodeTyped(ref byte *data, BlockExpression expression) { typeCodec.Encode(ref data, expression.Type); expressionArrayCodec.Encode(ref data, expression.Variables.Select(x => (Expression)x).ToArray()); expressionArrayCodec.Encode(ref data, expression.Expressions.ToArray()); }
protected override void EncodeTyped(ref byte *data, TypeBinaryExpression expression) { CommonCodec.Encode(ref data, expression.Expression); typeCodec.Encode(ref data, expression.TypeOperand); }
protected override unsafe void EncodeTyped(ref byte *data, InvocationExpression expression) { CommonCodec.Encode(ref data, expression.Expression); expressionArrayCodec.Encode(ref data, expression.Arguments.ToArray()); }
protected override void EncodeTyped(ref byte *data, MethodCallExpression expression) { CommonCodec.Encode(ref data, expression.Object); methodInfoCodec.Encode(ref data, expression.Method); expressionArrayCodec.Encode(ref data, expression.Arguments.ToArray()); }
protected override void EncodeTyped(ref byte *data, ParameterExpression expression) { typeCodec.Encode(ref data, expression.Type); stringCodec.Encode(ref data, expression.Name); }
public void Encode(ref byte *data, MemberAssignment value) { memberInfoCodec.Encode(ref data, value.Member); expressionCodec.Encode(ref data, value.Expression); }
protected override void EncodeTyped(ref byte *data, IndexExpression expression) { CommonCodec.Encode(ref data, expression.Object); propertyInfoCodec.Encode(ref data, expression.Indexer); expressionArrayCodec.Encode(ref data, expression.Arguments.ToArray()); }
public void Encode(ref byte *data, ElementInit value) { methodInfoCodec.Encode(ref data, value.AddMethod); expressionArrayCodec.Encode(ref data, value.Arguments.ToArray()); }