public void init(string service, ServiceFunction <MReq, MRes> callback) { this.service = service; srv_func = callback; helper = new ServiceCallbackHelper <MReq, MRes>(callback); req_datatype = new MReq().msgtype.ToString().Replace("__", "/").Replace("/Request", "__Request"); res_datatype = new MRes().msgtype.ToString().Replace("__", "/").Replace("/Response", "__Response"); srvtype = (SrvTypes)Enum.Parse(typeof(SrvTypes), req_datatype.Replace("__Request", "").Replace("/", "__")); datatype = srvtype.ToString().Replace("__", "/"); md5sum = IRosService.generate(srvtype).MD5Sum; }
public ServiceCallback(ServicePublication <MReq, MRes> sp, ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, int num_bytes, IServiceClientLink link, bool has_tracked_object, object tracked_object) { isp = sp; if (isp != null && _helper != null) { isp.helper = _helper; } buffer = buf; _numBytes = num_bytes; this.link = link; _hasTrackedObject = has_tracked_object; _trackedObject = tracked_object; }
//internal ftw? public ServicePublication(string name, string md5Sum, string datatype, string reqDatatype, string resDatatype, ServiceCallbackHelper <MReq, MRes> helper, CallbackQueueInterface callback, object trackedObject) { if (name == null) { throw new Exception("NULL NAME?!"); } // TODO: Complete member initialization this.name = name; md5sum = md5Sum; this.datatype = datatype; req_datatype = reqDatatype; res_datatype = resDatatype; this.helper = helper; this.callback = callback; tracked_object = trackedObject; if (trackedObject != null) { has_tracked_object = true; } }
public ServiceCallback(ServiceCallbackHelper <MReq, MRes> _helper, byte[] buf, int num_bytes, IServiceClientLink link, bool has_tracked_object, object tracked_object) : this(null, _helper, buf, num_bytes, link, has_tracked_object, tracked_object) { }