Ejemplo n.º 1
0
Archivo: RdList.cs Proyecto: epeshk/rd
        public static RdList <V> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <V> readValue, CtxWriteDelegate <V> writeValue)
        {
            var nextVersion = reader.ReadLong();
            var id          = reader.ReadRdId();

            return(new RdList <V>(readValue, writeValue, nextVersion).WithId(id));
        }
Ejemplo n.º 2
0
        public static RdEndpoint <TReq, TRes> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <TReq> readRequest, CtxWriteDelegate <TReq> writeRequest, CtxReadDelegate <TRes> readResponse, CtxWriteDelegate <TRes> writeResponse)
        {
            var id = reader.ReadRdId();

            return(new RdEndpoint <TReq, TRes>(readRequest, writeRequest, readResponse, writeResponse).WithId(id));
//      throw new InvalidOperationException("Deserialization of RdEndpoint is not allowed, the only valid option is to create RdEndpoint with constructor.");
        }
Ejemplo n.º 3
0
        public static RdProperty <T> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <T> readValue, CtxWriteDelegate <T> writeValue)
        {
            var id  = reader.ReadRdId();
            var res = new RdProperty <T>(readValue, writeValue).WithId(id);

            if (reader.ReadBool())
            {
                res.myProperty.Value = readValue(ctx, reader);
            }
            return(res);
        }
Ejemplo n.º 4
0
Archivo: RdSet.cs Proyecto: yvvan/rd
        public static RdSet <T> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <T> readValue, CtxWriteDelegate <T> writeValue)
        {
            var id = reader.ReadRdId();

            return(new RdSet <T>(readValue, writeValue).WithId(id));
        }
Ejemplo n.º 5
0
Archivo: RdMap.cs Proyecto: yvvan/rd
        public static RdMap <K, V> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <K> readKey, CtxWriteDelegate <K> writeKey, CtxReadDelegate <V> readValue, CtxWriteDelegate <V> writeValue)
        {
            var id = reader.ReadRdId();

            return(new RdMap <K, V>(readKey, writeKey, readValue, writeValue).WithId(id));
        }
Ejemplo n.º 6
0
 public static RdCall <TReq, TRes> Read(SerializationCtx ctx, UnsafeReader reader, CtxReadDelegate <TReq> readRequest, CtxWriteDelegate <TReq> writeRequest, CtxReadDelegate <TRes> readResponse, CtxWriteDelegate <TRes> writeResponse)
 {
     return(new RdCall <TReq, TRes>(readRequest, writeRequest, readResponse, writeResponse).WithId(reader.ReadRdId()));
 }