コード例 #1
0
    public static bool exists(string port, ContactStyle style)
    {
        bool ret = yarpPINVOKE.NetworkBase_exists__SWIG_4(port, ContactStyle.getCPtr(style));

        if (yarpPINVOKE.SWIGPendingException.Pending)
        {
            throw yarpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
コード例 #2
0
    public static bool writeToNameServer(PortWriter cmd, PortReader reply, ContactStyle style)
    {
        bool ret = yarpPINVOKE.NetworkBase_writeToNameServer(PortWriter.getCPtr(cmd), PortReader.getCPtr(reply), ContactStyle.getCPtr(style));

        if (yarpPINVOKE.SWIGPendingException.Pending)
        {
            throw yarpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
コード例 #3
0
    public static bool isConnected(string src, string dest, ContactStyle style)
    {
        bool ret = yarpPINVOKE.NetworkBase_isConnected__SWIG_2(src, dest, ContactStyle.getCPtr(style));

        if (yarpPINVOKE.SWIGPendingException.Pending)
        {
            throw yarpPINVOKE.SWIGPendingException.Retrieve();
        }
        return(ret);
    }
コード例 #4
0
ファイル: YarpPort.cs プロジェクト: FACE-Team/FACETools
        /// <summary>
        /// 
        /// </summary>
        /// <param name="nameInputPort"></param>
        /// <param name="nameOutputPort"></param>
        public void openReceiver(string nameOutputPort,string nameInputPort) 
        {
            if (!String.IsNullOrEmpty(nameInputPort) && !String.IsNullOrEmpty(nameOutputPort))
            {
                Network.init();
                input = new BufferedPortBottle();       
                input.open(nameInputPort);
               
                style = new ContactStyle();
                style.persistent=true;

                if(Network.isConnected(nameOutputPort,nameInputPort,style))
                    Network.disconnect(nameOutputPort,nameInputPort,style);

                if (Network.connect(nameOutputPort, nameInputPort, style))
                    Console.WriteLine(nameInputPort + " port is connected to " + nameOutputPort);

            }
        }
コード例 #5
0
ファイル: NetworkBase.cs プロジェクト: johnty/YarpUnity
 public static bool connect(string src, string dest, ContactStyle style)
 {
     bool ret = yarpPINVOKE.NetworkBase_connect__SWIG_3(src, dest, ContactStyle.getCPtr(style));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #6
0
ファイル: NetworkBase.cs プロジェクト: johnty/YarpUnity
 public static bool writeToNameServer(PortWriter cmd, PortReader reply, ContactStyle style)
 {
     bool ret = yarpPINVOKE.NetworkBase_writeToNameServer(PortWriter.getCPtr(cmd), PortReader.getCPtr(reply), ContactStyle.getCPtr(style));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #7
0
ファイル: NetworkBase.cs プロジェクト: johnty/YarpUnity
 public static new bool write(Contact contact, PortWriter cmd, PortReader reply, ContactStyle style)
 {
     bool ret = yarpPINVOKE.NetworkBase_write__SWIG_4(Contact.getCPtr(contact), PortWriter.getCPtr(cmd), PortReader.getCPtr(reply), ContactStyle.getCPtr(style));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #8
0
ファイル: NetworkBase.cs プロジェクト: johnty/YarpUnity
 public static bool exists(string port, ContactStyle style)
 {
     bool ret = yarpPINVOKE.NetworkBase_exists__SWIG_2(port, ContactStyle.getCPtr(style));
     if (yarpPINVOKE.SWIGPendingException.Pending) throw yarpPINVOKE.SWIGPendingException.Retrieve();
     return ret;
 }
コード例 #9
0
 internal static HandleRef getCPtr(ContactStyle obj)
 {
     return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
コード例 #10
0
ファイル: YarpPort.cs プロジェクト: FACE-Team/FACETools
        /// <summary>
        /// 
        /// </summary>
        /// <param name="nameOutputPort"></param>
        /// <param name="namePortDb"></param>
        /// <returns></returns>
        public bool openConnectionToDb(string nameOutputPort, string namePortDb)
        {
            if (!String.IsNullOrEmpty(namePortDb) && !String.IsNullOrEmpty(nameOutputPort))
            {
                Network.init();

                outPort = new Port();
                outPort.open(nameOutputPort);

                style = new ContactStyle();
                style.persistent = true;

                if (PortExists(namePortDb))
                {
                    //if (Network.isConnected(nameOutputPort, namePortDb, style))
                        Network.disconnect(nameOutputPort, namePortDb,style);

                        if (Network.connect(nameOutputPort, namePortDb, style))
                    {
                        Console.WriteLine(namePortDb + " port is connected to " + nameOutputPort);
                        return true;
                    }
                    else
                        return false;
                }
                else
                    return false;

            }
            else
                return false;
        }
コード例 #11
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ContactStyle obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }