Esempio n. 1
0
 public CharVector(CharVector other) : this(CNTKLibPINVOKE.new_CharVector__SWIG_1(CharVector.getCPtr(other)), true)
 {
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 2
0
 public CharVector(CharVector orig) : this(modshogunPINVOKE.new_CharVector__SWIG_5(CharVector.getCPtr(orig)), true)
 {
     if (modshogunPINVOKE.SWIGPendingException.Pending)
     {
         throw modshogunPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Esempio n. 3
0
 public CharVectorEnumerator(CharVector collection)
 {
     collectionRef = collection;
     currentIndex  = -1;
     currentObject = null;
     currentSize   = collectionRef.Count;
 }
Esempio n. 4
0
 public void SetRange(int index, CharVector values)
 {
     CNTKLibPINVOKE.CharVector_SetRange(swigCPtr, index, CharVector.getCPtr(values));
     if (CNTKLibPINVOKE.SWIGPendingException.Pending)
     {
         throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
     }
 }
 public override void Send(CharVector data)
 {
     byte[] send = new byte[data.Count];
     for (int i = 0; i < data.Count; i++)
         send[i] = (byte)data[i];
     evt.WaitOne(300);
     tcp.GetStream().Write(send, 0, data.Count);
     Console.WriteLine(Encoding.ASCII.GetString(send, 0, data.Count));
 }
Esempio n. 6
0
        public static CharVector Repeat(char value, int count)
        {
            global::System.IntPtr cPtr = CNTKLibPINVOKE.CharVector_Repeat(value, count);
            CharVector            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new CharVector(cPtr, true);

            if (CNTKLibPINVOKE.SWIGPendingException.Pending)
            {
                throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 7
0
 public override void Send(CharVector data)
 {
     byte[] send = new byte[data.Count];
     for (int i = 0; i < data.Count; i++)
     {
         send[i] = (byte)data[i];
     }
     evt.WaitOne(300);
     tcp.GetStream().Write(send, 0, data.Count);
     Console.WriteLine(Encoding.ASCII.GetString(send, 0, data.Count));
 }
Esempio n. 8
0
        public CharVector GetRange(int index, int count)
        {
            global::System.IntPtr cPtr = CNTKLibPINVOKE.CharVector_GetRange(swigCPtr, index, count);
            CharVector            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new CharVector(cPtr, true);

            if (CNTKLibPINVOKE.SWIGPendingException.Pending)
            {
                throw CNTKLibPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Esempio n. 9
0
 public override void Send(CharVector data)
 {
     byte[] send = new byte[data.Count];
     for (int i = 0; i < data.Count; i++)
     {
         send[i] = (byte)data[i];
     }
     lock (writelock)
     {
         innerStream.Write(send, 0, data.Count);
     }
 }
Esempio n. 10
0
  public static byte[] get_vector(CharVector src) {
		IntPtr ptr = modshogunPINVOKE.CharVector_get_vector__SWIG_1(CharVector.getCPtr(src));
    if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
		int[] size = new int[1];
		Marshal.Copy(ptr, size, 0, 1);

		int len = size[0];

		byte[] ret = new byte[len];

		Marshal.Copy(new IntPtr(ptr.ToInt64() + Marshal.SizeOf(typeof(int))), ret, 0, len);
		return ret;
}
Esempio n. 11
0
        public override CharVector Recieve()
        {
            byte[]     recv     = new byte[256];
            int        recieved = innerStream.Read(recv, 0, recv.Length);
            CharVector cv       = new CharVector(recieved);

            for (int i = 0; i < recieved; i++)
            {
                cv.Add((char)recv[i]);
            }
            Console.Write(Encoding.ASCII.GetString(recv, 0, cv.Count));
            return(cv);
        }
Esempio n. 12
0
    public static byte[] get_vector(CharVector src, bool own)
    {
        IntPtr ptr = modshogunPINVOKE.CharVector_get_vector__SWIG_0(CharVector.getCPtr(src), own);

        if (modshogunPINVOKE.SWIGPendingException.Pending)
        {
            throw modshogunPINVOKE.SWIGPendingException.Retrieve();
        }
        int[] size = new int[1];
        Marshal.Copy(ptr, size, 0, 1);

        int len = size[0];

        byte[] ret = new byte[len];

        Marshal.Copy(new IntPtr(ptr.ToInt64() + Marshal.SizeOf(typeof(int))), ret, 0, len);
        return(ret);
    }
Esempio n. 13
0
 public override CharVector Recieve()
 {
     try
     {
         byte[] recv = new byte[256];
         int recieved = tcp.GetStream().Read(recv, 0, recv.Length);
         evt.Set();
         CharVector cv = new CharVector(recieved);
         for (int i = 0; i < recieved; i++)
         {
             cv.Add((char)recv[i]);
         }
         return cv;
     }
     catch
     {
         return new CharVector();
     }
 }
Esempio n. 14
0
 public override CharVector Recieve()
 {
     try
     {
         byte[] recv     = new byte[256];
         int    recieved = tcp.GetStream().Read(recv, 0, recv.Length);
         evt.Set();
         CharVector cv = new CharVector(recieved);
         for (int i = 0; i < recieved; i++)
         {
             cv.Add((char)recv[i]);
         }
         return(cv);
     }
     catch
     {
         return(new CharVector());
     }
 }
Esempio n. 15
0
 internal static HandleRef getCPtr(CharVector obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
Esempio n. 16
0
 public override void Send(CharVector data)
 {
     byte[] send = new byte[data.Count];
     for (int i = 0; i < data.Count; i++)
         send[i] = (byte)data[i];
     lock(writelock)
     {
         innerStream.Write(send, 0, data.Count);
     }
 }
Esempio n. 17
0
 public override CharVector Recieve()
 {
     byte[] recv = new byte[256];
     int recieved = innerStream.Read(recv, 0, recv.Length);
     CharVector cv = new CharVector(recieved);
     for (int i = 0; i < recieved; i++)
     {
         cv.Add((char)recv[i]);
     }
     Console.Write(Encoding.ASCII.GetString(recv, 0, cv.Count));
     return cv;
 }
Esempio n. 18
0
 internal static HandleRef getCPtr(CharVector obj)
 {
     return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr);
 }
Esempio n. 19
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CharVector obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Esempio n. 20
0
 public CharVector(CharVector orig) : this(modshogunPINVOKE.new_CharVector__SWIG_5(CharVector.getCPtr(orig)), true) {
   if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve();
 }