コード例 #1
0
        public static ComplexData Deserialize(BinaryReader r)
        {
            {
                bool isNotNull = r.ReadBoolean();
                if (!isNotNull)
                {
                    return(null);
                }
            }
            var ret = new ComplexData();

            ret.SomeByte   = r.ReadByte();
            ret.SomeShort  = r.ReadInt16();
            ret.SomeUShort = r.ReadUInt16();
            ret.SomeInt    = r.ReadInt32();
            ret.SomeUInt   = r.ReadUInt32();
            ret.SomeLong   = r.ReadInt64();
            ret.SomeULong  = r.ReadUInt64();
            ret.SomeString = StringSerializer.Deserialize(r);
            {
                if (!r.ReadBoolean())
                {
                    ret.SomeArrString = null;
                }
                else
                {
                    int lenght = r.ReadInt32();
                    var list   = new List <String>(lenght);
                    for (int i = 0; i < lenght; i++)
                    {
                        var x = StringSerializer.Deserialize(r);
                        list.Add(x);
                    }
                    ret.SomeArrString = list;
                }
            }
            {
                if (!r.ReadBoolean())
                {
                    ret.SomeArrRec = null;
                }
                else
                {
                    int lenght = r.ReadInt32();
                    var list   = new List <SubData>(lenght);
                    for (int i = 0; i < lenght; i++)
                    {
                        var x = SubDataSerializer.Deserialize(r);
                        list.Add(x);
                    }
                    ret.SomeArrRec = list;
                }
            }
            return(ret);
        }
コード例 #2
0
		public async Task< ComplexData > Complex ( Int32 requestId, ComplexData data, String name, List<SubData> datas )
		{
			var request = MessageFactory.New< ISomeServiceComplexRequest >();
			request.requestId=requestId;
			request.data=data;
			request.name=name;
			request.datas=datas;
			Message reply = await ExecuteOperation(request);
			var ret = ((ISomeServiceComplexReply)reply).RetVal;
			MessageFactory.Free(reply);
			return ret;
		}
コード例 #3
0
 public Task<ComplexData> Complex(int requestId, ComplexData data, string name, List<SubData> datas)
 {
     return Task.FromResult(
         new ComplexData
         {
             SomeInt = requestId,
             SomeULong = 0,
             SomeString = name,
             SomeArrString = new List<string> { "Test1", "Test2" },
             SomeArrRec = datas
         });
 }
コード例 #4
0
        public async Task <ComplexData> Complex(Int32 requestId, ComplexData data, String name, List <SubData> datas)
        {
            var request = MessageFactory.New <ISomeServiceComplexRequest>();

            request.requestId = requestId;
            request.data      = data;
            request.name      = name;
            request.datas     = datas;
            Message reply = await ExecuteOperation(request);

            var ret = ((ISomeServiceComplexReply)reply).RetVal;

            MessageFactory.Free(reply);
            return(ret);
        }
コード例 #5
0
 public static void Serialize(ComplexData x, BinaryWriter w)
 {
     if (x == null)
     {
         w.Write(false);
         return;
     }
     w.Write(true);
     w.Write(x.SomeByte);
     w.Write(x.SomeShort);
     w.Write(x.SomeUShort);
     w.Write(x.SomeInt);
     w.Write(x.SomeUInt);
     w.Write(x.SomeLong);
     w.Write(x.SomeULong);
     StringSerializer.Serialize(x.SomeString, w);
     if (x.SomeArrString != null)
     {
         w.Write(true);
         w.Write((int)x.SomeArrString.Count);
         foreach (var element in x.SomeArrString)
         {
             StringSerializer.Serialize(element, w);
         }
     }
     else
     {
         w.Write(false);
     }
     if (x.SomeArrRec != null)
     {
         w.Write(true);
         w.Write((int)x.SomeArrRec.Count);
         foreach (var element in x.SomeArrRec)
         {
             SubDataSerializer.Serialize(element, w);
         }
     }
     else
     {
         w.Write(false);
     }
 }
コード例 #6
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     requestId = r.ReadInt32();
     data      = ComplexDataSerializer.Deserialize(r);
     name      = StringSerializer.Deserialize(r);
     {
         if (!r.ReadBoolean())
         {
             datas = null;
         }
         else
         {
             int lenght = r.ReadInt32();
             var list   = new List <SubData>(lenght);
             for (int i = 0; i < lenght; i++)
             {
                 var x = SubDataSerializer.Deserialize(r);
                 list.Add(x);
             }
             datas = list;
         }
     }
 }
コード例 #7
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     RetVal = ComplexDataSerializer.Deserialize(r);
 }
コード例 #8
0
		public static ComplexData Deserialize(BinaryReader r)
		{
			{
				bool isNotNull = r.ReadBoolean();
				if(!isNotNull)
					return null;
			}
			var ret = new ComplexData();
			ret.SomeByte = r.ReadByte();
			ret.SomeShort = r.ReadInt16();
			ret.SomeUShort = r.ReadUInt16();
			ret.SomeInt = r.ReadInt32();
			ret.SomeUInt = r.ReadUInt32();
			ret.SomeLong = r.ReadInt64();
			ret.SomeULong = r.ReadUInt64();
			ret.SomeString = StringSerializer.Deserialize(r);
			{
				if(!r.ReadBoolean())
					ret.SomeArrString = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<String>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = StringSerializer.Deserialize(r);
						list.Add(x);
					}
					ret.SomeArrString = list;
				}
			}
			{
				if(!r.ReadBoolean())
					ret.SomeArrRec = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<SubData>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = SubDataSerializer.Deserialize(r);
						list.Add(x);
					}
					ret.SomeArrRec = list;
				}
			}
			return ret;
		}
コード例 #9
0
		public static void Serialize(ComplexData x, BinaryWriter w)
		{
			if(x == null)
			{
				w.Write(false);
				return;
			}
			w.Write(true);
			w.Write(x.SomeByte);
			w.Write(x.SomeShort);
			w.Write(x.SomeUShort);
			w.Write(x.SomeInt);
			w.Write(x.SomeUInt);
			w.Write(x.SomeLong);
			w.Write(x.SomeULong);
			StringSerializer.Serialize(x.SomeString, w);
			if(x.SomeArrString != null)
			{
				w.Write(true);
				w.Write((int)x.SomeArrString.Count);
				foreach(var element in x.SomeArrString)
					StringSerializer.Serialize(element, w);
			}
			else
				w.Write(false);
			if(x.SomeArrRec != null)
			{
				w.Write(true);
				w.Write((int)x.SomeArrRec.Count);
				foreach(var element in x.SomeArrRec)
					SubDataSerializer.Serialize(element, w);
			}
			else
				w.Write(false);
		}
コード例 #10
0
        public override void Deserialize(BinaryReader r)
        {
            base.Deserialize(r);
			RetVal = ComplexDataSerializer.Deserialize(r);
        }
コード例 #11
0
        public override void Deserialize(BinaryReader r)
        {
            base.Deserialize(r);
			requestId = r.ReadInt32();
			data = ComplexDataSerializer.Deserialize(r);
			name = StringSerializer.Deserialize(r);
			{
				if(!r.ReadBoolean())
					datas = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<SubData>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = SubDataSerializer.Deserialize(r);
						list.Add(x);
					}
					datas = list;
				}
			}
        }