public override ServiceStub CreateStub(WrappedServiceStub innerstub) { string objecttype = innerstub.RR_objecttype.GetServiceDefinition().Name + "." + innerstub.RR_objecttype.Name; string objshort; if (CompareNamespace(objecttype, out objshort)) { switch (objshort) { case "baseobj": return(new baseobj_stub(innerstub)); case "subobj": return(new subobj_stub(innerstub)); default: break; } } else { string ext_service_type = RobotRaconteurNode.SplitQualifiedName(objecttype).Item1; return(RobotRaconteurNode.s.GetServiceType(ext_service_type).CreateStub(innerstub)); } throw new ServiceException("Could not create stub"); }
public override ServiceSkel CreateSkel(object obj) { string objtype = RobotRaconteurNode.GetTypeString(ServiceSkelUtil.FindParentInterface(obj.GetType())); string objshort; if (CompareNamespace(objtype, out objshort)) { switch (objshort) { case "baseobj": return(new baseobj_skel((baseobj)obj)); case "subobj": return(new subobj_skel((subobj)obj)); default: break; } } else { string ext_service_type = RobotRaconteurNode.SplitQualifiedName(objtype).Item1; return(RobotRaconteurNode.s.GetServiceFactory(ext_service_type).CreateSkel(obj)); } throw new ServiceException("Could not create skel"); }
public override MessageElementStructure PackStructure(Object s) { if (s == null) { return(null); } string objtype = s.GetType().ToString(); if (RobotRaconteurNode.SplitQualifiedName(objtype)[0].TrimEnd(new char[] { '_' }) == "sensors.ati.mini45") { string objshort = RemovePath(objtype); switch (objshort) { case "FTData": return(FTData_stubentry.PackStructure(s)); default: break; } } else { return(RobotRaconteurNode.s.PackStructure(s)); } throw new Exception(); }
public override ServiceSkel CreateSkel(object obj) { string objtype = ServiceSkelUtil.UnfixName(ServiceSkelUtil.FindParentInterface(obj.GetType()).ToString()); if (RobotRaconteurNode.SplitQualifiedName(objtype.ToString())[0].TrimEnd(new char[] { '_' }) == "sensors.ati.mini45") { string sobjtype = RemovePath(objtype); switch (sobjtype) { case "ATImini45Host": return(new ATImini45Host_skel((ATImini45Host)obj)); case "ATImini45": return(new ATImini45_skel((ATImini45)obj)); default: break; } } else { string ext_service_type = RobotRaconteurNode.SplitQualifiedName(objtype.ToString())[0].TrimEnd(new char[] { '_' }); return(RobotRaconteurNode.s.GetServiceFactory(ext_service_type).CreateSkel(obj)); } throw new ServiceException("Could not create skel"); }
public override ServiceStub CreateStub(WrappedServiceStub innerstub) { string objecttype = innerstub.RR_objecttype.GetServiceDefinition().Name + "." + innerstub.RR_objecttype.Name; if (RobotRaconteurNode.SplitQualifiedName(objecttype)[0].TrimEnd(new char[] { '_' }) == "sensors.ati.mini45") { string objshort = RemovePath(objecttype); switch (objshort) { case "ATImini45Host": return(new ATImini45Host_stub(innerstub)); case "ATImini45": return(new ATImini45_stub(innerstub)); default: break; } } else { string ext_service_type = RobotRaconteurNode.SplitQualifiedName(objecttype)[0].TrimEnd(new char[] { '_' }); return(RobotRaconteurNode.s.GetServiceType(ext_service_type).CreateStub(innerstub)); } throw new ServiceException("Could not create stub"); }
public override RobotRaconteurException DownCastException(RobotRaconteurException rr_exp) { if (rr_exp == null) { return(rr_exp); } string rr_type = rr_exp.Error; if (!rr_type.Contains(".")) { return(rr_exp); } string[] rr_stype = RobotRaconteurNode.SplitQualifiedName(rr_type); if (rr_stype[0] != "sensors.ati.mini45") { return(RobotRaconteurNode.s.DownCastException(rr_exp)); } return(rr_exp); }
public override T UnpackStructure <T>(MessageElementStructure l) { if (l == null) { return(default(T)); } if (RobotRaconteurNode.SplitQualifiedName(l.Type)[0].TrimEnd(new char[] { '_' }) == "sensors.ati.mini45") { string objshort = RemovePath(l.Type); switch (objshort) { case "FTData": return(FTData_stubentry.UnpackStructure <T>(l)); default: break; } } else { return(RobotRaconteurNode.s.UnpackStructure <T>(l)); } throw new DataTypeException("Could not unpack structure"); }