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

  ~Parameter() {
    Dispose();
  }

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

  public Parameter(string id, string name) : this(libsbmlPINVOKE.new_Parameter__SWIG_0(id, name), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Parameter(string id) : this(libsbmlPINVOKE.new_Parameter__SWIG_1(id), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Parameter() : this(libsbmlPINVOKE.new_Parameter__SWIG_2(), true) {
  }

  public Parameter(string id, double value, string units, bool constant) : this(libsbmlPINVOKE.new_Parameter__SWIG_3(id, value, units, constant), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Parameter(string id, double value, string units) : this(libsbmlPINVOKE.new_Parameter__SWIG_4(id, value, units), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Parameter(string id, double value) : this(libsbmlPINVOKE.new_Parameter__SWIG_5(id, value), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

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

  public Parameter(long level, long version) : this(libsbmlPINVOKE.new_Parameter__SWIG_7(level, version), true) {
  }

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

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

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

  public double getValue() {
    double ret = libsbmlPINVOKE.Parameter_getValue(swigCPtr);
    return ret;
  }

  public string getUnits() {
    string ret = libsbmlPINVOKE.Parameter_getUnits(swigCPtr);
    return ret;
  }

  public bool getConstant() {
    bool ret = libsbmlPINVOKE.Parameter_getConstant(swigCPtr);
    return ret;
  }

  public bool isSetValue() {
    bool ret = libsbmlPINVOKE.Parameter_isSetValue(swigCPtr);
    return ret;
  }

  public bool isSetUnits() {
    bool ret = libsbmlPINVOKE.Parameter_isSetUnits(swigCPtr);
    return ret;
  }

  public void setValue(double value) {
    libsbmlPINVOKE.Parameter_setValue(swigCPtr, value);
  }

  public void setUnits(string units) {
    libsbmlPINVOKE.Parameter_setUnits(swigCPtr, units);
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public void setConstant(bool flag) {
    libsbmlPINVOKE.Parameter_setConstant(swigCPtr, flag);
  }

  public void unsetValue() {
    libsbmlPINVOKE.Parameter_unsetValue(swigCPtr);
  }

  public void unsetUnits() {
    libsbmlPINVOKE.Parameter_unsetUnits(swigCPtr);
  }

  public UnitDefinition getDerivedUnitDefinition() {
    IntPtr cPtr = libsbmlPINVOKE.Parameter_getDerivedUnitDefinition(swigCPtr);
    UnitDefinition ret = (cPtr == IntPtr.Zero) ? null : new UnitDefinition(cPtr, false);
    return ret;
  }

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

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

}

}
