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

namespace Xapian {

using System;
using System.Runtime.InteropServices;

public class DecreasingValueWeightPostingSource : ValueWeightPostingSource {
  private HandleRef swigCPtr;

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

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

  ~DecreasingValueWeightPostingSource() {
    Dispose();
  }

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

  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;
  }

}

}
