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

namespace libsbml {

using System;
using System.Runtime.InteropServices;

public class SBMLNamespaces : IDisposable {
	private HandleRef swigCPtr;
	protected bool swigCMemOwn;
	
	internal SBMLNamespaces(IntPtr cPtr, bool cMemoryOwn)
	{
		swigCMemOwn = cMemoryOwn;
		swigCPtr    = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(SBMLNamespaces obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (SBMLNamespaces obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~SBMLNamespaces() {
    Dispose();
  }

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

  public static bool operator==(SBMLNamespaces lhs, SBMLNamespaces rhs)
  {
    if((Object)lhs == (Object)rhs)
    {
      return true;
    }

    if( ((Object)lhs == null) || ((Object)rhs == null) )
    {
      return false;
    }

    return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString());
  }

  public static bool operator!=(SBMLNamespaces lhs, SBMLNamespaces rhs)
  {
    return !(lhs == rhs);
  }

  public override bool Equals(Object sb)
  {
    if ( ! (sb is SBMLNamespaces) )
    {
      return false;
    }

    return this == (SBMLNamespaces)sb;
  }

  public override int GetHashCode()
  {
    return swigCPtr.Handle.ToInt32();
  }

  public SBMLNamespaces(long level, long version) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_0(level, version), true) {
  }

  public SBMLNamespaces(long level) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_1(level), true) {
  }

  public SBMLNamespaces() : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_2(), true) {
  }

  public SBMLNamespaces(SBMLNamespaces orig) : this(libsbmlPINVOKE.new_SBMLNamespaces__SWIG_3(SBMLNamespaces.getCPtr(orig)), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public SBMLNamespaces clone() {
    IntPtr cPtr = libsbmlPINVOKE.SBMLNamespaces_clone(swigCPtr);
    SBMLNamespaces ret = (cPtr == IntPtr.Zero) ? null : new SBMLNamespaces(cPtr, true);
    return ret;
  }

  public static string getSBMLNamespaceURI(long level, long version) {
    string ret = libsbmlPINVOKE.SBMLNamespaces_getSBMLNamespaceURI(level, version);
    return ret;
  }

  public static  SBMLNamespacesList  getSupportedNamespaces() { 
  IntPtr cPtr = libsbmlPINVOKE.SBMLNamespaces_getSupportedNamespaces();
  return (cPtr == IntPtr.Zero) ? null : new SBMLNamespacesList(cPtr, true);
}

  public long getLevel() { return (long)libsbmlPINVOKE.SBMLNamespaces_getLevel__SWIG_0(swigCPtr); }

  public long getVersion() { return (long)libsbmlPINVOKE.SBMLNamespaces_getVersion__SWIG_0(swigCPtr); }

  public XMLNamespaces getNamespaces() {
    IntPtr cPtr = libsbmlPINVOKE.SBMLNamespaces_getNamespaces__SWIG_0(swigCPtr);
    XMLNamespaces ret = (cPtr == IntPtr.Zero) ? null : new XMLNamespaces(cPtr, false);
    return ret;
  }

  public void addNamespaces(XMLNamespaces xmlns) {
    libsbmlPINVOKE.SBMLNamespaces_addNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns));
  }

}

}
