/* ----------------------------------------------------------------------------
 * 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 SLNet {

using System;
using System.Runtime.InteropServices;

public class UnsignedShortPointer : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal UnsignedShortPointer(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(UnsignedShortPointer obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~UnsignedShortPointer() {
    Dispose();
  }

  public virtual void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          SLikeNetPINVOKE.delete_UnsignedShortPointer(swigCPtr);
        }
        swigCPtr = new HandleRef(null, IntPtr.Zero);
      }
      GC.SuppressFinalize(this);
    }
  }

  public UnsignedShortPointer() : this(SLikeNetPINVOKE.new_UnsignedShortPointer(), true) {
  }

  public void assign(ushort value) {
    SLikeNetPINVOKE.UnsignedShortPointer_assign(swigCPtr, value);
  }

  public ushort value() {
    ushort ret = SLikeNetPINVOKE.UnsignedShortPointer_value(swigCPtr);
    return ret;
  }

  public SWIGTYPE_p_unsigned_short cast() {
    IntPtr cPtr = SLikeNetPINVOKE.UnsignedShortPointer_cast(swigCPtr);
    SWIGTYPE_p_unsigned_short ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_short(cPtr, false);
    return ret;
  }

  public static UnsignedShortPointer frompointer(SWIGTYPE_p_unsigned_short t) {
    IntPtr cPtr = SLikeNetPINVOKE.UnsignedShortPointer_frompointer(SWIGTYPE_p_unsigned_short.getCPtr(t));
    UnsignedShortPointer ret = (cPtr == IntPtr.Zero) ? null : new UnsignedShortPointer(cPtr, false);
    return ret;
  }

}

}
