Exemplo n.º 1
0
 static private ILValue GenerateInspectedObjectRead_Nullable(Type type, ILValue buffer)
 {
     return(new ILIfValue(
                buffer.GetILInvoke("ReadBoolean"),
                TypeSerializer.GetTypeSerializer(type).GenerateRead(buffer),
                null
                ));
 }
Exemplo n.º 2
0
 static private ILStatement GenerateInspectedObjectWrite_Nullable(ILValue value, ILValue buffer)
 {
     return(new ILIf(
                value.GetILIsNotNull(),
                new ILBlock(
                    buffer.GetILInvoke("WriteBoolean", true),
                    TypeSerializer.GetTypeSerializer(value.GetValueType()).GenerateWrite(value, buffer)
                    ),
                new ILBlock(
                    buffer.GetILInvoke("WriteBoolean", false)
                    )
                ));
 }
Exemplo n.º 3
0
            static public ILStatement GenerateInspectedObjectWrite(ILValue src, ILValue buffer)
            {
                if (src.GetValueType().HasChildTypes())
                {
                    return(GenerateInspectedObjectWrite_Polymorphic(src, buffer));
                }

                if (src.GetValueType().IsNullable())
                {
                    return(GenerateInspectedObjectWrite_Nullable(src, buffer));
                }

                return(TypeSerializer.GetTypeSerializer(src.GetValueType()).GenerateWrite(src, buffer));
            }
Exemplo n.º 4
0
            static public ILValue GenerateInspectedObjectRead(Type type, ILValue buffer)
            {
                if (type.HasChildTypes())
                {
                    return(GenerateInspectedObjectRead_Polymorphic(type, buffer));
                }

                if (type.IsNullable())
                {
                    return(GenerateInspectedObjectRead_Nullable(type, buffer));
                }

                return(TypeSerializer.GetTypeSerializer(type).GenerateRead(buffer));
            }