/* ----------------------------------------------------------------------------
 * 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 FastSearch : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~FastSearch() {
    Dispose();
  }

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

  public string ReadIndexFile(string IndexFilename) {
    string ret = openbabelPINVOKE.FastSearch_ReadIndexFile(swigCPtr, IndexFilename);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public string ReadIndex(SWIGTYPE_p_std__istream pIndexstream) {
    string ret = openbabelPINVOKE.FastSearch_ReadIndex(swigCPtr, SWIGTYPE_p_std__istream.getCPtr(pIndexstream));
    return ret;
  }

  public bool Find(OBBase pOb, vectorUnsignedInt SeekPositions, uint MaxCandidates) {
    bool ret = openbabelPINVOKE.FastSearch_Find(swigCPtr, OBBase.getCPtr(pOb), vectorUnsignedInt.getCPtr(SeekPositions), MaxCandidates);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool FindMatch(OBBase pOb, vectorUnsignedInt SeekPositions, uint MaxCandidates) {
    bool ret = openbabelPINVOKE.FastSearch_FindMatch(swigCPtr, OBBase.getCPtr(pOb), vectorUnsignedInt.getCPtr(SeekPositions), MaxCandidates);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool FindSimilar(OBBase pOb, SWIGTYPE_p_std__multimapT_double_unsigned_int_t SeekposMap, double MinTani) {
    bool ret = openbabelPINVOKE.FastSearch_FindSimilar__SWIG_0(swigCPtr, OBBase.getCPtr(pOb), SWIGTYPE_p_std__multimapT_double_unsigned_int_t.getCPtr(SeekposMap), MinTani);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool FindSimilar(OBBase pOb, SWIGTYPE_p_std__multimapT_double_unsigned_int_t SeekposMap, int nCandidates) {
    bool ret = openbabelPINVOKE.FastSearch_FindSimilar__SWIG_1(swigCPtr, OBBase.getCPtr(pOb), SWIGTYPE_p_std__multimapT_double_unsigned_int_t.getCPtr(SeekposMap), nCandidates);
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public bool FindSimilar(OBBase pOb, SWIGTYPE_p_std__multimapT_double_unsigned_int_t SeekposMap) {
    bool ret = openbabelPINVOKE.FastSearch_FindSimilar__SWIG_2(swigCPtr, OBBase.getCPtr(pOb), SWIGTYPE_p_std__multimapT_double_unsigned_int_t.getCPtr(SeekposMap));
    if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public OBFingerprint GetFingerprint() {
    IntPtr cPtr = openbabelPINVOKE.FastSearch_GetFingerprint(swigCPtr);
    OBFingerprint ret = (cPtr == IntPtr.Zero) ? null : new OBFingerprint(cPtr, false);
    return ret;
  }

  public FptIndexHeader GetIndexHeader() {
    FptIndexHeader ret = new FptIndexHeader(openbabelPINVOKE.FastSearch_GetIndexHeader(swigCPtr), false);
    return ret;
  }

  public FastSearch() : this(openbabelPINVOKE.new_FastSearch(), true) {
  }

}
