/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.38
 *
 * 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 ListOfCompartmentTypes : ListOf {
	private HandleRef swigCPtr;
	
	internal ListOfCompartmentTypes(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.ListOfCompartmentTypesUpcast(cPtr), cMemoryOwn)
	{
		//super(libsbmlPINVOKE.ListOfCompartmentTypesUpcast(cPtr), cMemoryOwn);
		swigCPtr = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(ListOfCompartmentTypes obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (ListOfCompartmentTypes obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~ListOfCompartmentTypes() {
    Dispose();
  }

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

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

  public override int getTypeCode() {
    int ret = libsbmlPINVOKE.ListOfCompartmentTypes_getTypeCode(swigCPtr);
    return ret;
  }

  public override int getItemTypeCode() {
    int ret = libsbmlPINVOKE.ListOfCompartmentTypes_getItemTypeCode(swigCPtr);
    return ret;
  }

  public override string getElementName() {
    string ret = libsbmlPINVOKE.ListOfCompartmentTypes_getElementName(swigCPtr);
    return ret;
  }

  public new CompartmentType get(long n) {
    IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_get__SWIG_0(swigCPtr, n);
    CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, false);
    return ret;
  }

  public new CompartmentType get(string sid) {
    IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_get__SWIG_2(swigCPtr, sid);
    CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, false);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public new CompartmentType remove(long n) {
    IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_remove__SWIG_0(swigCPtr, n);
    CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true);
    return ret;
  }

  public new CompartmentType remove(string sid) {
    IntPtr cPtr = libsbmlPINVOKE.ListOfCompartmentTypes_remove__SWIG_1(swigCPtr, sid);
    CompartmentType ret = (cPtr == IntPtr.Zero) ? null : new CompartmentType(cPtr, true);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public ListOfCompartmentTypes() : this(libsbmlPINVOKE.new_ListOfCompartmentTypes(), true) {
  }

}

}
