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

  ~SBase() {
    Dispose();
  }

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

  public static bool operator==(SBase lhs, SBase rhs)
  {
    if((Object)lhs == (Object)rhs)
    {
      return true;
    }

    if( ((Object)lhs == null) || ((Object)rhs == null) )
    {
      return false;
    }

    return (getCPtr(lhs).Handle.ToString() == getCPtr(rhs).Handle.ToString());
  }

  public static bool operator!=(SBase lhs, SBase rhs)
  {
    return !(lhs == rhs);
  }

  public override bool Equals(Object sb)
  {
    if ( ! (sb is SBase) )
    {
      return false;
    }

    return this == (SBase)sb;
  }

  public override int GetHashCode()
  {
    return swigCPtr.Handle.ToInt32();
  }

  public virtual SBase clone() {
	return libsbml.DowncastSBase(libsbmlPINVOKE.SBase_clone(swigCPtr), true);
}

  public string getMetaId() {
    string ret = libsbmlPINVOKE.SBase_getMetaId(swigCPtr);
    return ret;
  }

  public string getId() {
    string ret = libsbmlPINVOKE.SBase_getId(swigCPtr);
    return ret;
  }

  public string getName() {
    string ret = libsbmlPINVOKE.SBase_getName(swigCPtr);
    return ret;
  }

  public XMLNode getNotes() {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getNotes(swigCPtr);
    XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, false);
    return ret;
  }

  public string getNotesString() {
    string ret = libsbmlPINVOKE.SBase_getNotesString(swigCPtr);
    return ret;
  }

  public XMLNode getAnnotation() {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getAnnotation(swigCPtr);
    XMLNode ret = (cPtr == IntPtr.Zero) ? null : new XMLNode(cPtr, false);
    return ret;
  }

  public string getAnnotationString() {
    string ret = libsbmlPINVOKE.SBase_getAnnotationString(swigCPtr);
    return ret;
  }

  public virtual XMLNamespaces getNamespaces() {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getNamespaces(swigCPtr);
    XMLNamespaces ret = (cPtr == IntPtr.Zero) ? null : new XMLNamespaces(cPtr, false);
    return ret;
  }

  public SBMLDocument getSBMLDocument() {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getSBMLDocument__SWIG_0(swigCPtr);
    SBMLDocument ret = (cPtr == IntPtr.Zero) ? null : new SBMLDocument(cPtr, false);
    return ret;
  }

  public SBase getParentSBMLObject() {
	return libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getParentSBMLObject(swigCPtr), false);
}

  public SBase getAncestorOfType(int type) {
	return libsbml.DowncastSBase(libsbmlPINVOKE.SBase_getAncestorOfType(swigCPtr, type), false);
}

  public int getSBOTerm() {
    int ret = libsbmlPINVOKE.SBase_getSBOTerm(swigCPtr);
    return ret;
  }

  public string getSBOTermID() {
    string ret = libsbmlPINVOKE.SBase_getSBOTermID(swigCPtr);
    return ret;
  }

  public long getLine() { return (long)libsbmlPINVOKE.SBase_getLine(swigCPtr); }

  public long getColumn() { return (long)libsbmlPINVOKE.SBase_getColumn(swigCPtr); }

  public bool isSetMetaId() {
    bool ret = libsbmlPINVOKE.SBase_isSetMetaId(swigCPtr);
    return ret;
  }

  public bool isSetId() {
    bool ret = libsbmlPINVOKE.SBase_isSetId(swigCPtr);
    return ret;
  }

  public bool isSetName() {
    bool ret = libsbmlPINVOKE.SBase_isSetName(swigCPtr);
    return ret;
  }

  public bool isSetNotes() {
    bool ret = libsbmlPINVOKE.SBase_isSetNotes(swigCPtr);
    return ret;
  }

  public bool isSetAnnotation() {
    bool ret = libsbmlPINVOKE.SBase_isSetAnnotation(swigCPtr);
    return ret;
  }

  public bool isSetSBOTerm() {
    bool ret = libsbmlPINVOKE.SBase_isSetSBOTerm(swigCPtr);
    return ret;
  }

  public void setMetaId(string metaid) {
    libsbmlPINVOKE.SBase_setMetaId(swigCPtr, metaid);
  }

  public void setId(string sid) {
    libsbmlPINVOKE.SBase_setId(swigCPtr, sid);
  }

  public void setName(string name) {
    libsbmlPINVOKE.SBase_setName(swigCPtr, name);
  }

  public virtual void setAnnotation(XMLNode annotation) {
    libsbmlPINVOKE.SBase_setAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
  }

  public virtual void setAnnotation(string annotation) {
    libsbmlPINVOKE.SBase_setAnnotation__SWIG_1(swigCPtr, annotation);
  }

  public virtual void appendAnnotation(XMLNode annotation) {
    libsbmlPINVOKE.SBase_appendAnnotation__SWIG_0(swigCPtr, XMLNode.getCPtr(annotation));
  }

  public virtual void appendAnnotation(string annotation) {
    libsbmlPINVOKE.SBase_appendAnnotation__SWIG_1(swigCPtr, annotation);
  }

  public void setNotes(XMLNode notes) {
    libsbmlPINVOKE.SBase_setNotes__SWIG_0(swigCPtr, XMLNode.getCPtr(notes));
  }

  public void setNotes(string notes) {
    libsbmlPINVOKE.SBase_setNotes__SWIG_1(swigCPtr, notes);
  }

  public void appendNotes(XMLNode notes) {
    libsbmlPINVOKE.SBase_appendNotes__SWIG_0(swigCPtr, XMLNode.getCPtr(notes));
  }

  public void appendNotes(string notes) {
    libsbmlPINVOKE.SBase_appendNotes__SWIG_1(swigCPtr, notes);
  }

  public virtual void setSBMLDocument(SBMLDocument d) {
    libsbmlPINVOKE.SBase_setSBMLDocument(swigCPtr, SBMLDocument.getCPtr(d));
  }

  public virtual void setParentSBMLObject(SBase sb) {
    libsbmlPINVOKE.SBase_setParentSBMLObject(swigCPtr, SBase.getCPtr(sb));
  }

  public void setSBOTerm(int value) {
    libsbmlPINVOKE.SBase_setSBOTerm(swigCPtr, value);
  }

  public void setNamespaces(XMLNamespaces xmlns) {
    libsbmlPINVOKE.SBase_setNamespaces(swigCPtr, XMLNamespaces.getCPtr(xmlns));
  }

  public void unsetMetaId() {
    libsbmlPINVOKE.SBase_unsetMetaId(swigCPtr);
  }

  public void unsetId() {
    libsbmlPINVOKE.SBase_unsetId(swigCPtr);
  }

  public void unsetName() {
    libsbmlPINVOKE.SBase_unsetName(swigCPtr);
  }

  public void unsetNotes() {
    libsbmlPINVOKE.SBase_unsetNotes(swigCPtr);
  }

  public void unsetAnnotation() {
    libsbmlPINVOKE.SBase_unsetAnnotation(swigCPtr);
  }

  public void unsetSBOTerm() {
    libsbmlPINVOKE.SBase_unsetSBOTerm(swigCPtr);
  }

  public void addCVTerm(CVTerm term) {
    libsbmlPINVOKE.SBase_addCVTerm(swigCPtr, CVTerm.getCPtr(term));
  }

  public long getNumCVTerms() { return (long)libsbmlPINVOKE.SBase_getNumCVTerms(swigCPtr); }

  public CVTerm getCVTerm(long n) {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getCVTerm(swigCPtr, n);
    CVTerm ret = (cPtr == IntPtr.Zero) ? null : new CVTerm(cPtr, false);
    return ret;
  }

  public void unsetCVTerms() {
    libsbmlPINVOKE.SBase_unsetCVTerms(swigCPtr);
  }

  public int getResourceBiologicalQualifier(string resource) {
    int ret = libsbmlPINVOKE.SBase_getResourceBiologicalQualifier(swigCPtr, resource);
    return ret;
  }

  public int getResourceModelQualifier(string resource) {
    int ret = libsbmlPINVOKE.SBase_getResourceModelQualifier(swigCPtr, resource);
    return ret;
  }

  public Model getModel() {
    IntPtr cPtr = libsbmlPINVOKE.SBase_getModel(swigCPtr);
    Model ret = (cPtr == IntPtr.Zero) ? null : new Model(cPtr, false);
    return ret;
  }

  public long getLevel() { return (long)libsbmlPINVOKE.SBase_getLevel(swigCPtr); }

  public long getVersion() { return (long)libsbmlPINVOKE.SBase_getVersion(swigCPtr); }

  public virtual int getTypeCode() {
    int ret = libsbmlPINVOKE.SBase_getTypeCode(swigCPtr);
    return ret;
  }

  public virtual string getElementName() {
    string ret = libsbmlPINVOKE.SBase_getElementName(swigCPtr);
    return ret;
  }

  public string toSBML() {
    string ret = libsbmlPINVOKE.SBase_toSBML(swigCPtr);
    return ret;
  }

  public void read(XMLInputStream stream) {
    libsbmlPINVOKE.SBase_read(swigCPtr, XMLInputStream.getCPtr(stream));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

  public void write(XMLOutputStream stream) {
    libsbmlPINVOKE.SBase_write(swigCPtr, XMLOutputStream.getCPtr(stream));
    if (libsbmlPINVOKE.SWIGPendingException.Pending) throw libsbmlPINVOKE.SWIGPendingException.Retrieve();
  }

}

}
