/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.36
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */


using System;
using System.Runtime.InteropServices;

public class OBSmartsPattern : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

  internal OBSmartsPattern(IntPtr cPtr, bool cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = new HandleRef(this, cPtr);
  }

  internal static HandleRef getCPtr(OBSmartsPattern obj) {
    return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  }

  ~OBSmartsPattern() {
    Dispose();
  }

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

  public OBSmartsPattern() : this(openbabelPINVOKE.new_OBSmartsPattern__SWIG_0(), true) {
  }

  public OBSmartsPattern(OBSmartsPattern cp) : this(openbabelPINVOKE.new_OBSmartsPattern__SWIG_1(OBSmartsPattern.getCPtr(cp)), true) {
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public bool Init(string pattern) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_Init__SWIG_0(swigCPtr, pattern);
    return ret;
  }

  public string GetSMARTS() {
    string ret = openbabelPINVOKE.OBSmartsPattern_GetSMARTS__SWIG_0(swigCPtr);
    return ret;
  }

  public bool Empty() {
    bool ret = openbabelPINVOKE.OBSmartsPattern_Empty(swigCPtr);
    return ret;
  }

  public bool IsValid() {
    bool ret = openbabelPINVOKE.OBSmartsPattern_IsValid(swigCPtr);
    return ret;
  }

  public uint NumAtoms() {
    uint ret = openbabelPINVOKE.OBSmartsPattern_NumAtoms(swigCPtr);
    return ret;
  }

  public uint NumBonds() {
    uint ret = openbabelPINVOKE.OBSmartsPattern_NumBonds(swigCPtr);
    return ret;
  }

  public void GetBond(SWIGTYPE_p_int src, SWIGTYPE_p_int dst, SWIGTYPE_p_int ord, int idx) {
    openbabelPINVOKE.OBSmartsPattern_GetBond(swigCPtr, SWIGTYPE_p_int.getCPtr(src), SWIGTYPE_p_int.getCPtr(dst), SWIGTYPE_p_int.getCPtr(ord), idx);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

  public int GetAtomicNum(int idx) {
    int ret = openbabelPINVOKE.OBSmartsPattern_GetAtomicNum(swigCPtr, idx);
    return ret;
  }

  public int GetCharge(int idx) {
    int ret = openbabelPINVOKE.OBSmartsPattern_GetCharge(swigCPtr, idx);
    return ret;
  }

  public int GetVectorBinding(int idx) {
    int ret = openbabelPINVOKE.OBSmartsPattern_GetVectorBinding(swigCPtr, idx);
    return ret;
  }

  public bool Match(OBMol mol, bool single) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_Match__SWIG_0(swigCPtr, OBMol.getCPtr(mol), single);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool Match(OBMol mol) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_Match__SWIG_1(swigCPtr, OBMol.getCPtr(mol));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool RestrictedMatch(OBMol mol, SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t pairs, bool single) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_RestrictedMatch__SWIG_0(swigCPtr, OBMol.getCPtr(mol), SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t.getCPtr(pairs), single);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool RestrictedMatch(OBMol mol, SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t pairs) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_RestrictedMatch__SWIG_1(swigCPtr, OBMol.getCPtr(mol), SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t.getCPtr(pairs));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool RestrictedMatch(OBMol mol, OBBitVec bv, bool single) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_RestrictedMatch__SWIG_2(swigCPtr, OBMol.getCPtr(mol), OBBitVec.getCPtr(bv), single);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool RestrictedMatch(OBMol mol, OBBitVec bv) {
    bool ret = openbabelPINVOKE.OBSmartsPattern_RestrictedMatch__SWIG_3(swigCPtr, OBMol.getCPtr(mol), OBBitVec.getCPtr(bv));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public uint NumMatches() {
    uint ret = openbabelPINVOKE.OBSmartsPattern_NumMatches(swigCPtr);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t GetMapList() {
    SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t ret = new SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t(openbabelPINVOKE.OBSmartsPattern_GetMapList(swigCPtr), false);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator BeginMList() {
    SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator ret = new SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator(openbabelPINVOKE.OBSmartsPattern_BeginMList(swigCPtr), true);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator EndMList() {
    SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator ret = new SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t__iterator(openbabelPINVOKE.OBSmartsPattern_EndMList(swigCPtr), true);
    return ret;
  }

  public SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t GetUMapList() {
    SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t ret = new SWIGTYPE_p_std__vectorT_std__vectorT_int_t_t(openbabelPINVOKE.OBSmartsPattern_GetUMapList(swigCPtr), false);
    return ret;
  }

  public void WriteMapList(SWIGTYPE_p_std__ostream arg0) {
    openbabelPINVOKE.OBSmartsPattern_WriteMapList(swigCPtr, SWIGTYPE_p_std__ostream.getCPtr(arg0));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
  }

}
