/* ----------------------------------------------------------------------------
 * 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 SpeciesReference : SimpleSpeciesReference {
	private HandleRef swigCPtr;
	
	internal SpeciesReference(IntPtr cPtr, bool cMemoryOwn) : base(libsbmlPINVOKE.SpeciesReferenceUpcast(cPtr), cMemoryOwn)
	{
		//super(libsbmlPINVOKE.SpeciesReferenceUpcast(cPtr), cMemoryOwn);
		swigCPtr = new HandleRef(this, cPtr);
	}
	
	internal static HandleRef getCPtr(SpeciesReference obj)
	{
		return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
	}
	
	internal static HandleRef getCPtrAndDisown (SpeciesReference obj)
	{
		HandleRef ptr = new HandleRef(null, IntPtr.Zero);
		
		if (obj != null)
		{
			ptr             = obj.swigCPtr;
			obj.swigCMemOwn = false;
		}
		
		return ptr;
	}

  ~SpeciesReference() {
    Dispose();
  }

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

  public SpeciesReference(string species, double stoichiometry, int denominator) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_0(species, stoichiometry, denominator), true) {
  }

  public SpeciesReference(string species, double stoichiometry) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_1(species, stoichiometry), true) {
  }

  public SpeciesReference(string species) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_2(species), true) {
  }

  public SpeciesReference() : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_3(), true) {
  }

  public SpeciesReference(long level, long version, XMLNamespaces xmlns) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_4(level, version, XMLNamespaces.getCPtr(xmlns)), true) {
  }

  public SpeciesReference(long level, long version) : this(libsbmlPINVOKE.new_SpeciesReference__SWIG_5(level, version), true) {
  }

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

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

  public void initDefaults() {
    libsbmlPINVOKE.SpeciesReference_initDefaults(swigCPtr);
  }

  public double getStoichiometry() {
    double ret = libsbmlPINVOKE.SpeciesReference_getStoichiometry(swigCPtr);
    return ret;
  }

  public StoichiometryMath getStoichiometryMath() {
    IntPtr cPtr = libsbmlPINVOKE.SpeciesReference_getStoichiometryMath__SWIG_0(swigCPtr);
    StoichiometryMath ret = (cPtr == IntPtr.Zero) ? null : new StoichiometryMath(cPtr, false);
    return ret;
  }

  public int getDenominator() {
    int ret = libsbmlPINVOKE.SpeciesReference_getDenominator(swigCPtr);
    return ret;
  }

  public bool isSetStoichiometryMath() {
    bool ret = libsbmlPINVOKE.SpeciesReference_isSetStoichiometryMath(swigCPtr);
    return ret;
  }

  public void setStoichiometry(double value) {
    libsbmlPINVOKE.SpeciesReference_setStoichiometry(swigCPtr, value);
  }

  public void setStoichiometryMath(StoichiometryMath math) {
    libsbmlPINVOKE.SpeciesReference_setStoichiometryMath(swigCPtr, StoichiometryMath.getCPtr(math));
  }

  public void setDenominator(int value) {
    libsbmlPINVOKE.SpeciesReference_setDenominator(swigCPtr, value);
  }

  public void unsetStoichiometryMath() {
    libsbmlPINVOKE.SpeciesReference_unsetStoichiometryMath(swigCPtr);
  }

  public override void setAnnotation(XMLNode annotation) {
    libsbmlPINVOKE.SpeciesReference_setAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
  }

  public override void setAnnotation(string annotation) {
    libsbmlPINVOKE.SpeciesReference_setAnnotation__SWIG_1(swigCPtr, annotation);
  }

  public override void appendAnnotation(XMLNode annotation) {
    libsbmlPINVOKE.SpeciesReference_appendAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
  }

  public override void appendAnnotation(string annotation) {
    libsbmlPINVOKE.SpeciesReference_appendAnnotation__SWIG_1(swigCPtr, annotation);
  }

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

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

  public void sortMath() {
    libsbmlPINVOKE.SpeciesReference_sortMath(swigCPtr);
  }

}

}
