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

namespace Xapian {

public class DecreasingValueWeightPostingSource : ValueWeightPostingSource {
  private global::System.Runtime.InteropServices.HandleRef swigCPtr;

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

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

  internal static global::System.Runtime.InteropServices.HandleRef swigRelease(DecreasingValueWeightPostingSource obj) {
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
      global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.Dispose();
      return ptr;
    } else {
      return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
    }
  }

  protected override void Dispose(bool disposing) {
    lock(this) {
      if (swigCPtr.Handle != global::System.IntPtr.Zero) {
        if (swigCMemOwn) {
          swigCMemOwn = false;
          XapianPINVOKE.delete_DecreasingValueWeightPostingSource(swigCPtr);
        }
        swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
      }
      base.Dispose(disposing);
    }
  }

  public DecreasingValueWeightPostingSource(uint slot_, uint range_start_, uint range_end_) : this(XapianPINVOKE.new_DecreasingValueWeightPostingSource__SWIG_0(slot_, range_start_, range_end_), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public DecreasingValueWeightPostingSource(uint slot_, uint range_start_) : this(XapianPINVOKE.new_DecreasingValueWeightPostingSource__SWIG_1(slot_, range_start_), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public DecreasingValueWeightPostingSource(uint slot_) : this(XapianPINVOKE.new_DecreasingValueWeightPostingSource__SWIG_2(slot_), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override double GetWeight() {
    double ret = XapianPINVOKE.DecreasingValueWeightPostingSource_GetWeight(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override string Name() {
    string ret = XapianPINVOKE.DecreasingValueWeightPostingSource_Name(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override void Init(Database db_) {
    XapianPINVOKE.DecreasingValueWeightPostingSource_Init(swigCPtr, Database.getCPtr(db_));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override void Next(double min_wt) {
    XapianPINVOKE.DecreasingValueWeightPostingSource_Next(swigCPtr, min_wt);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override void SkipTo(uint min_docid, double min_wt) {
    XapianPINVOKE.DecreasingValueWeightPostingSource_SkipTo(swigCPtr, min_docid, min_wt);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public override bool Check(uint min_docid, double min_wt) {
    bool ret = XapianPINVOKE.DecreasingValueWeightPostingSource_Check(swigCPtr, min_docid, min_wt);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public override string GetDescription() {
    string ret = XapianPINVOKE.DecreasingValueWeightPostingSource_GetDescription(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

}

}
