1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 3.0.13 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace Xapian { 12 13 public class LatLongMetric : global::System.IDisposable { 14 private global::System.Runtime.InteropServices.HandleRef swigCPtr; 15 protected bool swigCMemOwn; 16 LatLongMetric(global::System.IntPtr cPtr, bool cMemoryOwn)17 internal LatLongMetric(global::System.IntPtr cPtr, bool cMemoryOwn) { 18 swigCMemOwn = cMemoryOwn; 19 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); 20 } 21 getCPtr(LatLongMetric obj)22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LatLongMetric obj) { 23 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; 24 } 25 ~LatLongMetric()26 ~LatLongMetric() { 27 Dispose(); 28 } 29 Dispose()30 public virtual void Dispose() { 31 lock(this) { 32 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 33 if (swigCMemOwn) { 34 swigCMemOwn = false; 35 XapianPINVOKE.delete_LatLongMetric(swigCPtr); 36 } 37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 38 } 39 global::System.GC.SuppressFinalize(this); 40 } 41 } 42 PointwiseDistance(LatLongCoord a, LatLongCoord b)43 public virtual double PointwiseDistance(LatLongCoord a, LatLongCoord b) { 44 double ret = XapianPINVOKE.LatLongMetric_PointwiseDistance(swigCPtr, LatLongCoord.getCPtr(a), LatLongCoord.getCPtr(b)); 45 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 46 return ret; 47 } 48 Apply(LatLongCoords a, LatLongCoords b)49 public double Apply(LatLongCoords a, LatLongCoords b) { 50 double ret = XapianPINVOKE.LatLongMetric_Apply__SWIG_0(swigCPtr, LatLongCoords.getCPtr(a), LatLongCoords.getCPtr(b)); 51 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 52 return ret; 53 } 54 Apply(LatLongCoords a, string b)55 public double Apply(LatLongCoords a, string b) { 56 double ret = XapianPINVOKE.LatLongMetric_Apply__SWIG_1(swigCPtr, LatLongCoords.getCPtr(a), b); 57 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 58 return ret; 59 } 60 Apply(LatLongCoords a, string b_ptr, uint b_len)61 public double Apply(LatLongCoords a, string b_ptr, uint b_len) { 62 double ret = XapianPINVOKE.LatLongMetric_Apply__SWIG_2(swigCPtr, LatLongCoords.getCPtr(a), b_ptr, b_len); 63 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 64 return ret; 65 } 66 Name()67 public virtual string Name() { 68 string ret = XapianPINVOKE.LatLongMetric_Name(swigCPtr); 69 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 70 return ret; 71 } 72 LatLongMetric()73 public LatLongMetric() : this(XapianPINVOKE.new_LatLongMetric(), true) { 74 if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve(); 75 SwigDirectorConnect(); 76 } 77 SwigDirectorConnect()78 private void SwigDirectorConnect() { 79 if (SwigDerivedClassHasMethod("PointwiseDistance", swigMethodTypes0)) 80 swigDelegate0 = new SwigDelegateLatLongMetric_0(SwigDirectorPointwiseDistance); 81 if (SwigDerivedClassHasMethod("Name", swigMethodTypes1)) 82 swigDelegate1 = new SwigDelegateLatLongMetric_1(SwigDirectorName); 83 XapianPINVOKE.LatLongMetric_director_connect(swigCPtr, swigDelegate0, swigDelegate1); 84 } 85 SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes)86 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) { 87 global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null); 88 bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(LatLongMetric)); 89 return hasDerivedMethod; 90 } 91 SwigDirectorPointwiseDistance(global::System.IntPtr a, global::System.IntPtr b)92 private double SwigDirectorPointwiseDistance(global::System.IntPtr a, global::System.IntPtr b) { 93 return PointwiseDistance(new LatLongCoord(a, false), new LatLongCoord(b, false)); 94 } 95 SwigDirectorName()96 private string SwigDirectorName() { 97 return Name(); 98 } 99 SwigDelegateLatLongMetric_0(global::System.IntPtr a, global::System.IntPtr b)100 public delegate double SwigDelegateLatLongMetric_0(global::System.IntPtr a, global::System.IntPtr b); SwigDelegateLatLongMetric_1()101 public delegate string SwigDelegateLatLongMetric_1(); 102 103 private SwigDelegateLatLongMetric_0 swigDelegate0; 104 private SwigDelegateLatLongMetric_1 swigDelegate1; 105 106 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { typeof(LatLongCoord), typeof(LatLongCoord) }; 107 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { }; 108 } 109 110 } 111