/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.35
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

namespace FreeSWITCH.Native {

using System;
using System.Runtime.InteropServices;

public partial class MonoSession : CoreSession {
  private HandleRef swigCPtr;

  internal MonoSession(IntPtr cPtr, bool cMemoryOwn) : base(freeswitchPINVOKE.MonoSessionUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new HandleRef(this, cPtr);
  }

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

  ~MonoSession() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
        swigCMemOwn = false;
        freeswitchPINVOKE.delete_MonoSession(swigCPtr);
      }
      swigCPtr = new HandleRef(null, IntPtr.Zero);
      GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public MonoSession() : this(freeswitchPINVOKE.new_MonoSession__SWIG_0(), true) {
  }

  public MonoSession(string uuid) : this(freeswitchPINVOKE.new_MonoSession__SWIG_1(uuid), true) {
  }

  public MonoSession(SWIGTYPE_p_switch_core_session session) : this(freeswitchPINVOKE.new_MonoSession__SWIG_2(SWIGTYPE_p_switch_core_session.getCPtr(session)), true) {
  }

}

}
