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

namespace Xapian {

public class LatLongDistanceKeyMaker : KeyMaker {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;

  internal LatLongDistanceKeyMaker(global::System.IntPtr cPtr, bool cMemoryOwn) : base(XapianPINVOKE.LatLongDistanceKeyMaker_SWIGUpcast(cPtr), cMemoryOwn) {
    swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
  }

  internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LatLongDistanceKeyMaker obj) {
    return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
  }

  ~LatLongDistanceKeyMaker() {
    Dispose();
  }

  public override void Dispose() {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          XapianPINVOKE.delete_LatLongDistanceKeyMaker(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      global::System.GC.SuppressFinalize(this);
      base.Dispose();
    }
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoords centre_, LatLongMetric metric_, double defdistance) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_0(slot_, LatLongCoords.getCPtr(centre_), LatLongMetric.getCPtr(metric_), defdistance), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoords centre_, LatLongMetric metric_) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_1(slot_, LatLongCoords.getCPtr(centre_), LatLongMetric.getCPtr(metric_)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoords centre_) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_2(slot_, LatLongCoords.getCPtr(centre_)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoord centre_, LatLongMetric metric_, double defdistance) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_3(slot_, LatLongCoord.getCPtr(centre_), LatLongMetric.getCPtr(metric_), defdistance), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoord centre_, LatLongMetric metric_) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_4(slot_, LatLongCoord.getCPtr(centre_), LatLongMetric.getCPtr(metric_)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public LatLongDistanceKeyMaker(uint slot_, LatLongCoord centre_) : this(XapianPINVOKE.new_LatLongDistanceKeyMaker__SWIG_5(slot_, LatLongCoord.getCPtr(centre_)), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override string Apply(Document doc) {
    string ret = XapianPINVOKE.LatLongDistanceKeyMaker_Apply(swigCPtr, Document.getCPtr(doc));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
