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

  ~Trigger() {
    Dispose();
  }

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

  public Trigger(long level, long version) : this(libsbmlPINVOKE.new_Trigger__SWIG_0(level, version), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public Trigger(SBMLNamespaces sbmlns) : this(libsbmlPINVOKE.new_Trigger__SWIG_1(SBMLNamespaces.getCPtr(sbmlns)), true) {
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

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

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

  public ASTNode getMath() {
    IntPtr cPtr = libsbmlPINVOKE.Trigger_getMath(swigCPtr);
    ASTNode ret = (cPtr == IntPtr.Zero) ? null : new ASTNode(cPtr, false);
    return ret;
  }

  public bool getInitialValue() {
    bool ret = libsbmlPINVOKE.Trigger_getInitialValue(swigCPtr);
    return ret;
  }

  public bool getPersistent() {
    bool ret = libsbmlPINVOKE.Trigger_getPersistent(swigCPtr);
    return ret;
  }

  public bool isSetMath() {
    bool ret = libsbmlPINVOKE.Trigger_isSetMath(swigCPtr);
    return ret;
  }

  public bool isSetInitialValue() {
    bool ret = libsbmlPINVOKE.Trigger_isSetInitialValue(swigCPtr);
    return ret;
  }

  public bool isSetPersistent() {
    bool ret = libsbmlPINVOKE.Trigger_isSetPersistent(swigCPtr);
    return ret;
  }

  public int setMath(ASTNode math) {
    int ret = libsbmlPINVOKE.Trigger_setMath(swigCPtr, ASTNode.getCPtr(math));
    return ret;
  }

  public int setInitialValue(bool initialValue) {
    int ret = libsbmlPINVOKE.Trigger_setInitialValue(swigCPtr, initialValue);
    return ret;
  }

  public int setPersistent(bool persistent) {
    int ret = libsbmlPINVOKE.Trigger_setPersistent(swigCPtr, persistent);
    return ret;
  }

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

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

  public override bool hasRequiredElements() {
    bool ret = libsbmlPINVOKE.Trigger_hasRequiredElements(swigCPtr);
    return ret;
  }

  public override bool hasRequiredAttributes() {
    bool ret = libsbmlPINVOKE.Trigger_hasRequiredAttributes(swigCPtr);
    return ret;
  }

}

}
