public override MessageElement CallGetProperty(string membername, WrappedServiceSkelAsyncAdapter async_adapter)
        {
            switch (membername)
            {
            case "d1":
            {
                if (async_obj != null)
                {
                    async_adapter.MakeAsync();
                    async_obj.async_get_d1().ContinueWith(t => async_adapter.EndTask <double>(t, async_ret => MessageElementUtil.PackScalar <double>("return", async_ret)));
                    return(null);
                }
                double ret = obj.d1;
                return(MessageElementUtil.PackScalar <double>("return", ret));
            }

            case "d2":
            {
                if (async_obj != null)
                {
                    async_adapter.MakeAsync();
                    async_obj.async_get_d2().ContinueWith(t => async_adapter.EndTask <double[]>(t, async_ret => MessageElementUtil.PackArray <double>("return", async_ret)));
                    return(null);
                }
                double[] ret = obj.d2;
                return(MessageElementUtil.PackArray <double>("return", ret));
            }

            default:
                break;
            }
            throw new MemberNotFoundException("Member not found");
        }
示例#2
0
 public override void Close(WrappedServiceSkelAsyncAdapter async_adapter)
 {
     try
     {
         async_adapter.MakeAsync();
         generator.AsyncClose().ContinueWith(t => async_adapter.EndTask(t));
     }
     catch (Exception e)
     {
         using (MessageEntry merr = new MessageEntry())
         {
             RobotRaconteurExceptionUtil.ExceptionToMessageEntry(e, merr);
             RRDirectorExceptionHelper.SetError(merr, e.ToString());
             return;
         }
     }
 }
示例#3
0
 public override MessageElement Next(MessageElement m, WrappedServiceSkelAsyncAdapter async_adapter)
 {
     using (m)
     {
         try
         {
             async_adapter.MakeAsync();
             generator.AsyncNext().ContinueWith(t => async_adapter.EndTask <ReturnType>(t, async_ret => RobotRaconteurNode.s.PackAnyType <ReturnType>("return", ref async_ret)));
             return(null);
         }
         catch (Exception e)
         {
             using (MessageEntry merr = new MessageEntry())
             {
                 RobotRaconteurExceptionUtil.ExceptionToMessageEntry(e, merr);
                 RRDirectorExceptionHelper.SetError(merr, e.ToString());
                 return(null);
             }
         }
     }
 }
        public override MessageElement CallFunction(string rr_membername, vectorptr_messageelement rr_m, WrappedServiceSkelAsyncAdapter rr_async_adapter)
        {
            switch (rr_membername)
            {
            case "add_val":
            {
                double v = (MessageElementUtil.UnpackScalar <double>(vectorptr_messageelement_util.FindElement(rr_m, "v")));
                if (async_obj != null)
                {
                    rr_async_adapter.MakeAsync();
                    async_obj.async_add_val(v).ContinueWith(t => rr_async_adapter.EndTask <double>(t, async_ret => MessageElementUtil.PackScalar <double>("return", async_ret)));
                    return(null);
                }
                double rr_ret = this.obj.add_val(v);
                return(MessageElementUtil.PackScalar <double>("return", rr_ret));
            }

            default:
                break;
            }
            throw new MemberNotFoundException("Member not found");
        }
        public override void CallSetProperty(string membername, MessageElement m, WrappedServiceSkelAsyncAdapter async_adapter)
        {
            switch (membername)
            {
            case "d1":
            {
                if (async_obj != null)
                {
                    async_adapter.MakeAsync();
                    async_obj.async_set_d1((MessageElementUtil.UnpackScalar <double>(m))).ContinueWith(t => async_adapter.EndTask(t));
                    return;
                }
                obj.d1 = (MessageElementUtil.UnpackScalar <double>(m));
                return;
            }

            case "d2":
            {
                if (async_obj != null)
                {
                    async_adapter.MakeAsync();
                    async_obj.async_set_d2(MessageElementUtil.UnpackArray <double>(m)).ContinueWith(t => async_adapter.EndTask(t));
                    return;
                }
                obj.d2 = MessageElementUtil.UnpackArray <double>(m);
                return;
            }

            default:
                break;
            }
            throw new MemberNotFoundException("Member not found");
        }