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

  ~ListOfSpeciesReferences() {
    Dispose();
  }

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

  public ListOfSpeciesReferences() : this(libsbmlPINVOKE.new_ListOfSpeciesReferences(), true) {
  }

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

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

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

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

  public new SimpleSpeciesReference get(long n) {
	SimpleSpeciesReference ret
	    = (SimpleSpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.ListOfSpeciesReferences_get__SWIG_0(swigCPtr, n), false);
	return ret;
}

  public virtual SimpleSpeciesReference get(string sid) {
	SimpleSpeciesReference ret
	    = (SimpleSpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.ListOfSpeciesReferences_get__SWIG_2(swigCPtr, sid), false);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
	return ret;
}

  public new SimpleSpeciesReference remove(long n) {
	SimpleSpeciesReference ret
	    = (SimpleSpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.ListOfSpeciesReferences_remove__SWIG_0(swigCPtr, n), true);
	return ret;
}

  public virtual SimpleSpeciesReference remove(string sid) {
	SimpleSpeciesReference ret
	    = (SimpleSpeciesReference) libsbml.DowncastSBase(libsbmlPINVOKE.ListOfSpeciesReferences_remove__SWIG_1(swigCPtr, sid), true);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
	return ret;
}

}

}
