public CharVector(CharVector other) : this(CNTKLibPINVOKE.new_CharVector__SWIG_1(CharVector.getCPtr(other)), true) { if (CNTKLibPINVOKE.SWIGPendingException.Pending) { throw CNTKLibPINVOKE.SWIGPendingException.Retrieve(); } }
public CharVector(CharVector orig) : this(modshogunPINVOKE.new_CharVector__SWIG_5(CharVector.getCPtr(orig)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) { throw modshogunPINVOKE.SWIGPendingException.Retrieve(); } }
public CharVectorEnumerator(CharVector collection) { collectionRef = collection; currentIndex = -1; currentObject = null; currentSize = collectionRef.Count; }
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)); }
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); }
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)); }
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); }
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); } }
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; }
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); }
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); }
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(); } }
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()); } }
internal static HandleRef getCPtr(CharVector obj) { return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; }
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); } }
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; }
internal static HandleRef getCPtr(CharVector obj) { return((obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr); }
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); }
public CharVector(CharVector orig) : this(modshogunPINVOKE.new_CharVector__SWIG_5(CharVector.getCPtr(orig)), true) { if (modshogunPINVOKE.SWIGPendingException.Pending) throw modshogunPINVOKE.SWIGPendingException.Retrieve(); }