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

  ~Reaction() {
    Dispose();
  }

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

  public Reaction(string sid, string name, KineticLaw kl, bool reversible) : this(libsbmlPINVOKE.new_Reaction__SWIG_0(sid, name, KineticLaw.getCPtr(kl), reversible), true) {
  }

  public Reaction(string sid, string name, KineticLaw kl) : this(libsbmlPINVOKE.new_Reaction__SWIG_1(sid, name, KineticLaw.getCPtr(kl)), true) {
  }

  public Reaction(string sid, string name) : this(libsbmlPINVOKE.new_Reaction__SWIG_2(sid, name), true) {
  }

  public Reaction(string sid) : this(libsbmlPINVOKE.new_Reaction__SWIG_3(sid), true) {
  }

  public Reaction() : this(libsbmlPINVOKE.new_Reaction__SWIG_4(), true) {
  }

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

  public Reaction(long level, long version) : this(libsbmlPINVOKE.new_Reaction__SWIG_6(level, version), true) {
  }

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

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

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

  public KineticLaw getKineticLaw() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getKineticLaw__SWIG_0(swigCPtr);
    KineticLaw ret = (cPtr == IntPtr.Zero) ? null : new KineticLaw(cPtr, false);
    return ret;
  }

  public bool getReversible() {
    bool ret = libsbmlPINVOKE.Reaction_getReversible(swigCPtr);
    return ret;
  }

  public bool getFast() {
    bool ret = libsbmlPINVOKE.Reaction_getFast(swigCPtr);
    return ret;
  }

  public bool isSetKineticLaw() {
    bool ret = libsbmlPINVOKE.Reaction_isSetKineticLaw(swigCPtr);
    return ret;
  }

  public bool isSetFast() {
    bool ret = libsbmlPINVOKE.Reaction_isSetFast(swigCPtr);
    return ret;
  }

  public void setKineticLaw(KineticLaw kl) {
    libsbmlPINVOKE.Reaction_setKineticLaw(swigCPtr, KineticLaw.getCPtr(kl));
  }

  public void setReversible(bool value) {
    libsbmlPINVOKE.Reaction_setReversible(swigCPtr, value);
  }

  public void setFast(bool value) {
    libsbmlPINVOKE.Reaction_setFast(swigCPtr, value);
  }

  public void unsetKineticLaw() {
    libsbmlPINVOKE.Reaction_unsetKineticLaw(swigCPtr);
  }

  public void unsetFast() {
    libsbmlPINVOKE.Reaction_unsetFast(swigCPtr);
  }

  public void addReactant(SpeciesReference sr) {
    libsbmlPINVOKE.Reaction_addReactant(swigCPtr, SpeciesReference.getCPtr(sr));
  }

  public void addProduct(SpeciesReference sr) {
    libsbmlPINVOKE.Reaction_addProduct(swigCPtr, SpeciesReference.getCPtr(sr));
  }

  public void addModifier(ModifierSpeciesReference msr) {
    libsbmlPINVOKE.Reaction_addModifier(swigCPtr, ModifierSpeciesReference.getCPtr(msr));
  }

  public SpeciesReference createReactant() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_createReactant(swigCPtr);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public SpeciesReference createProduct() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_createProduct(swigCPtr);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public ModifierSpeciesReference createModifier() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_createModifier(swigCPtr);
    ModifierSpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false);
    return ret;
  }

  public KineticLaw createKineticLaw() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_createKineticLaw(swigCPtr);
    KineticLaw ret = (cPtr == IntPtr.Zero) ? null : new KineticLaw(cPtr, false);
    return ret;
  }

  public ListOfSpeciesReferences getListOfReactants() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfReactants__SWIG_0(swigCPtr);
    ListOfSpeciesReferences ret = (cPtr == IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false);
    return ret;
  }

  public ListOfSpeciesReferences getListOfProducts() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfProducts__SWIG_0(swigCPtr);
    ListOfSpeciesReferences ret = (cPtr == IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false);
    return ret;
  }

  public ListOfSpeciesReferences getListOfModifiers() {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getListOfModifiers__SWIG_0(swigCPtr);
    ListOfSpeciesReferences ret = (cPtr == IntPtr.Zero) ? null : new ListOfSpeciesReferences(cPtr, false);
    return ret;
  }

  public SpeciesReference getReactant(long n) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getReactant__SWIG_0(swigCPtr, n);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public SpeciesReference getReactant(string species) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getReactant__SWIG_2(swigCPtr, species);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public SpeciesReference getProduct(long n) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getProduct__SWIG_0(swigCPtr, n);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public SpeciesReference getProduct(string species) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getProduct__SWIG_2(swigCPtr, species);
    SpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new SpeciesReference(cPtr, false);
    return ret;
  }

  public ModifierSpeciesReference getModifier(long n) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getModifier__SWIG_0(swigCPtr, n);
    ModifierSpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false);
    return ret;
  }

  public ModifierSpeciesReference getModifier(string species) {
    IntPtr cPtr = libsbmlPINVOKE.Reaction_getModifier__SWIG_2(swigCPtr, species);
    ModifierSpeciesReference ret = (cPtr == IntPtr.Zero) ? null : new ModifierSpeciesReference(cPtr, false);
    return ret;
  }

  public long getNumReactants() { return (long)libsbmlPINVOKE.Reaction_getNumReactants(swigCPtr); }

  public long getNumProducts() { return (long)libsbmlPINVOKE.Reaction_getNumProducts(swigCPtr); }

  public long getNumModifiers() { return (long)libsbmlPINVOKE.Reaction_getNumModifiers(swigCPtr); }

  public override void setSBMLDocument(SBMLDocument d) {
    libsbmlPINVOKE.Reaction_setSBMLDocument(swigCPtr, SBMLDocument.getCPtr(d));
  }

  public override void setParentSBMLObject(SBase sb) {
    libsbmlPINVOKE.Reaction_setParentSBMLObject(swigCPtr, SBase.getCPtr(sb));
  }

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

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

}

}
