/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 2.0.12 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ namespace RakNet { using System; using System.Runtime.InteropServices; public class RakNetStatistics : IDisposable { private HandleRef swigCPtr; protected bool swigCMemOwn; internal RakNetStatistics(IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new HandleRef(this, cPtr); } internal static HandleRef getCPtr(RakNetStatistics obj) { if (obj != null) { if (obj.bytesInSendBufferIsCached) { obj.SetBytesInSendBuffer(obj.bytesInSendBuffer, obj.bytesInSendBuffer.Length); } if (obj.messageInSendBufferIsCached) { obj.SetMessageInSendBuffer(obj.messageInSendBuffer, obj.messageInSendBuffer.Length); } if (obj.runningTotalIsCached) { obj.SetRunningTotal(obj.runningTotal, obj.runningTotal.Length); } if (obj.valueOverLastSecondIsCached) { obj.SetValueOverLastSecond(obj.valueOverLastSecond, obj.valueOverLastSecond.Length); } obj.bytesInSendBufferIsCached=false; obj.messageInSendBufferIsCached=false; obj.runningTotalIsCached=false; obj.valueOverLastSecondIsCached=false; } return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } ~RakNetStatistics() { Dispose(); } public virtual void Dispose() { lock(this) { if (swigCPtr.Handle != IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; RakNetPINVOKE.delete_RakNetStatistics(swigCPtr); } swigCPtr = new HandleRef(null, IntPtr.Zero); } GC.SuppressFinalize(this); } } private bool bytesInSendBufferIsCached = false; private bool messageInSendBufferIsCached = false; private bool runningTotalIsCached = false; private bool valueOverLastSecondIsCached = false; private double[] bytesInSendBufferCache; private uint[] messageInSendBufferCache; private ulong[] runningTotalCache; private ulong[] valueOverLastSecondCache; public ulong[] valueOverLastSecond { set { valueOverLastSecondCache=value; valueOverLastSecondIsCached = true; SetValueOverLastSecond (value, value.Length); } get { ulong[] returnArray; if (!valueOverLastSecondIsCached) { IntPtr cPtr = RakNetPINVOKE.RakNetStatistics_valueOverLastSecond_get (swigCPtr); int len = (int) RNSPerSecondMetrics.RNS_PER_SECOND_METRICS_COUNT; if (len<=0) { return null; } returnArray = new ulong[len]; long[] marshalArray = new long[len]; Marshal.Copy(cPtr, marshalArray, 0, len); for (int i=0;i