public virtual MReq deserialize <MReq, MRes>(ServiceCallbackHelperParams <MReq, MRes> parms) where MReq : IRosMessage where MRes : IRosMessage { //EDB.WriteLine("ISubscriptionCallbackHelper: deserialize"); IRosMessage msg = ROS.MakeMessage(type); assignSubscriptionConnectionHeader(ref msg, parms.connection_header); MReq t = (MReq)msg; t.Deserialize(parms.response.Serialized); return(t); //return SerializationHelper.Deserialize<T>(parms.buffer); }
public virtual T deserialize <T>(SubscriptionCallbackHelperDeserializeParams parms) where T : IRosMessage { //EDB.WriteLine("ISubscriptionCallbackHelper: deserialize"); IRosMessage msg = ROS.MakeMessage(type); assignSubscriptionConnectionHeader(ref msg, parms.connection_header); T t = (T)msg; t.Deserialize(parms.buffer); return(t); //return SerializationHelper.Deserialize<T>(parms.buffer); }
public IMessageDeserializer MakeDeserializer(MsgTypes type, ISubscriptionCallbackHelper helper, IRosMessage m, IDictionary connection_header) { if (type == MsgTypes.Unknown) { return(null); } //return ROS.MakeDeserializer(ROS.MakeMessage(type)); return ((IMessageDeserializer) Activator.CreateInstance( typeof(MessageDeserializer <>).MakeGenericType( ROS.MakeMessage(type).GetType()), helper, m, connection_header)); }