public void PullToStream() { int arraySize; IntPtr arrayPointer = _GetDataStream(out arraySize); //TODO: temporary flush untill the HD streaming is implemented (performance) if ((_dataStream._dataStream.Count + arraySize) > _dataStream._storageLimit) { FlushStream(); } if (arrayPointer != IntPtr.Zero && arraySize > 0) { for (int i = 0; i < arraySize; ++i) { object data = new ET_GazeData(); IntPtr ptr = new IntPtr(arrayPointer.ToInt64() + (i * Marshal.SizeOf(data))); if (data != null) { Marshal.PtrToStructure(ptr, data); } _dataStream._dataStream.Add((ET_GazeData)data); } } }
public List <ET_GazeData> GetAllData() { List <ET_GazeData> totaldataList = new List <ET_GazeData>(); int arraySize; IntPtr arrayPointer = _GetAllData(out arraySize); if (arrayPointer != IntPtr.Zero && arraySize > 0) { for (int i = 0; i < arraySize; ++i) { object data = new ET_GazeData(); IntPtr ptr = new IntPtr(arrayPointer.ToInt64() + (i * Marshal.SizeOf(data))); if (data != null) { Marshal.PtrToStructure(ptr, data); } totaldataList.Add((ET_GazeData)data); } } return(totaldataList); }