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

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

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

  ~FptIndex() {
    Dispose();
  }

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

  public FptIndexHeader header {
    set {
      openbabelPINVOKE.FptIndex_header_set(swigCPtr, FptIndexHeader.getCPtr(value));
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    } 
    get {
      FptIndexHeader ret = new FptIndexHeader(openbabelPINVOKE.FptIndex_header_get(swigCPtr), false);
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public vectorUnsignedInt fptdata {
    set {
      openbabelPINVOKE.FptIndex_fptdata_set(swigCPtr, vectorUnsignedInt.getCPtr(value));
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    } 
    get {
      vectorUnsignedInt ret = new vectorUnsignedInt(openbabelPINVOKE.FptIndex_fptdata_get(swigCPtr), false);
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public vectorUnsignedInt seekdata {
    set {
      openbabelPINVOKE.FptIndex_seekdata_set(swigCPtr, vectorUnsignedInt.getCPtr(value));
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
    } 
    get {
      vectorUnsignedInt ret = new vectorUnsignedInt(openbabelPINVOKE.FptIndex_seekdata_get(swigCPtr), false);
      if (openbabelPINVOKE.SWIGPendingException.Pending) throw openbabelPINVOKE.SWIGPendingException.Retrieve();
      return ret;
    } 
  }

  public bool Read(SWIGTYPE_p_std__istream pIndexstream) {
    bool ret = openbabelPINVOKE.FptIndex_Read(swigCPtr, SWIGTYPE_p_std__istream.getCPtr(pIndexstream));
    return ret;
  }

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

  public FptIndex() : this(openbabelPINVOKE.new_FptIndex(), true) {
  }

}
