File: PostingSource.cs

package info (click to toggle)
xapian-bindings 1.2.3-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,144 kB
  • ctags: 13,789
  • sloc: cpp: 139,078; sh: 10,401; python: 5,530; cs: 5,394; java: 5,243; php: 2,029; makefile: 783; ruby: 452; tcl: 250
file content (246 lines) | stat: -rw-r--r-- 10,566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.40
 *
 * 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 PostingSource : IDisposable {
  private HandleRef swigCPtr;
  protected bool swigCMemOwn;

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

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

  ~PostingSource() {
    Dispose();
  }

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

  protected PostingSource() : this(XapianPINVOKE.new_PostingSource(), true) {
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    SwigDirectorConnect();
  }

  public virtual uint GetTermfreqMin() {
    uint ret = XapianPINVOKE.PostingSource_GetTermfreqMin(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual uint GetTermfreqEst() {
    uint ret = XapianPINVOKE.PostingSource_GetTermfreqEst(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual uint GetTermfreqMax() {
    uint ret = XapianPINVOKE.PostingSource_GetTermfreqMax(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public double GetMaxweight() {
    double ret = XapianPINVOKE.PostingSource_GetMaxweight(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual double GetWeight() {
    double ret = ((this.GetType() == typeof(PostingSource)) ? XapianPINVOKE.PostingSource_GetWeight(swigCPtr) : XapianPINVOKE.PostingSource_GetWeightSwigExplicitPostingSource(swigCPtr));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual uint GetDocId() {
    uint ret = XapianPINVOKE.PostingSource_GetDocId(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

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

  public virtual void SkipTo(uint did, double min_wt) {
    if (this.GetType() == typeof(PostingSource)) XapianPINVOKE.PostingSource_SkipTo(swigCPtr, did, min_wt); else XapianPINVOKE.PostingSource_SkipToSwigExplicitPostingSource(swigCPtr, did, min_wt);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual bool Check(uint did, double min_wt) {
    bool ret = ((this.GetType() == typeof(PostingSource)) ? XapianPINVOKE.PostingSource_Check(swigCPtr, did, min_wt) : XapianPINVOKE.PostingSource_CheckSwigExplicitPostingSource(swigCPtr, did, min_wt));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual bool AtEnd() {
    bool ret = XapianPINVOKE.PostingSource_AtEnd(swigCPtr);
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual string Name() {
    string ret = ((this.GetType() == typeof(PostingSource)) ? XapianPINVOKE.PostingSource_Name(swigCPtr) : XapianPINVOKE.PostingSource_NameSwigExplicitPostingSource(swigCPtr));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  public virtual void Init(Database db) {
    XapianPINVOKE.PostingSource_Init(swigCPtr, Database.getCPtr(db));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
  }

  public virtual string GetDescription() {
    string ret = ((this.GetType() == typeof(PostingSource)) ? XapianPINVOKE.PostingSource_GetDescription(swigCPtr) : XapianPINVOKE.PostingSource_GetDescriptionSwigExplicitPostingSource(swigCPtr));
    if (XapianPINVOKE.SWIGPendingException.Pending) throw XapianPINVOKE.SWIGPendingException.Retrieve();
    return ret;
  }

  private void SwigDirectorConnect() {
    if (SwigDerivedClassHasMethod("GetTermfreqMin", swigMethodTypes0))
      swigDelegate0 = new SwigDelegatePostingSource_0(SwigDirectorGetTermfreqMin);
    if (SwigDerivedClassHasMethod("GetTermfreqEst", swigMethodTypes1))
      swigDelegate1 = new SwigDelegatePostingSource_1(SwigDirectorGetTermfreqEst);
    if (SwigDerivedClassHasMethod("GetTermfreqMax", swigMethodTypes2))
      swigDelegate2 = new SwigDelegatePostingSource_2(SwigDirectorGetTermfreqMax);
    if (SwigDerivedClassHasMethod("GetWeight", swigMethodTypes3))
      swigDelegate3 = new SwigDelegatePostingSource_3(SwigDirectorGetWeight);
    if (SwigDerivedClassHasMethod("GetDocId", swigMethodTypes4))
      swigDelegate4 = new SwigDelegatePostingSource_4(SwigDirectorGetDocId);
    if (SwigDerivedClassHasMethod("Next", swigMethodTypes5))
      swigDelegate5 = new SwigDelegatePostingSource_5(SwigDirectorNext);
    if (SwigDerivedClassHasMethod("SkipTo", swigMethodTypes6))
      swigDelegate6 = new SwigDelegatePostingSource_6(SwigDirectorSkipTo);
    if (SwigDerivedClassHasMethod("Check", swigMethodTypes7))
      swigDelegate7 = new SwigDelegatePostingSource_7(SwigDirectorCheck);
    if (SwigDerivedClassHasMethod("AtEnd", swigMethodTypes8))
      swigDelegate8 = new SwigDelegatePostingSource_8(SwigDirectorAtEnd);
    if (SwigDerivedClassHasMethod("Name", swigMethodTypes9))
      swigDelegate9 = new SwigDelegatePostingSource_9(SwigDirectorName);
    if (SwigDerivedClassHasMethod("Init", swigMethodTypes10))
      swigDelegate10 = new SwigDelegatePostingSource_10(SwigDirectorInit);
    if (SwigDerivedClassHasMethod("GetDescription", swigMethodTypes11))
      swigDelegate11 = new SwigDelegatePostingSource_11(SwigDirectorGetDescription);
    XapianPINVOKE.PostingSource_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10, swigDelegate11);
  }

  private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
    System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
    bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(PostingSource));
    return hasDerivedMethod;
  }

  private uint SwigDirectorGetTermfreqMin() {
    return GetTermfreqMin();
  }

  private uint SwigDirectorGetTermfreqEst() {
    return GetTermfreqEst();
  }

  private uint SwigDirectorGetTermfreqMax() {
    return GetTermfreqMax();
  }

  private double SwigDirectorGetWeight() {
    return GetWeight();
  }

  private uint SwigDirectorGetDocId() {
    return GetDocId();
  }

  private void SwigDirectorNext(double min_wt) {
    Next(min_wt);
  }

  private void SwigDirectorSkipTo(uint did, double min_wt) {
    SkipTo(did, min_wt);
  }

  private bool SwigDirectorCheck(uint did, double min_wt) {
    return Check(did, min_wt);
  }

  private bool SwigDirectorAtEnd() {
    return AtEnd();
  }

  private string SwigDirectorName() {
    return Name();
  }

  private void SwigDirectorInit(IntPtr db) {
    Init(new Database(db, false));
  }

  private string SwigDirectorGetDescription() {
    return GetDescription();
  }

  public delegate uint SwigDelegatePostingSource_0();
  public delegate uint SwigDelegatePostingSource_1();
  public delegate uint SwigDelegatePostingSource_2();
  public delegate double SwigDelegatePostingSource_3();
  public delegate uint SwigDelegatePostingSource_4();
  public delegate void SwigDelegatePostingSource_5(double min_wt);
  public delegate void SwigDelegatePostingSource_6(uint did, double min_wt);
  public delegate bool SwigDelegatePostingSource_7(uint did, double min_wt);
  public delegate bool SwigDelegatePostingSource_8();
  public delegate string SwigDelegatePostingSource_9();
  public delegate void SwigDelegatePostingSource_10(IntPtr db);
  public delegate string SwigDelegatePostingSource_11();

  private SwigDelegatePostingSource_0 swigDelegate0;
  private SwigDelegatePostingSource_1 swigDelegate1;
  private SwigDelegatePostingSource_2 swigDelegate2;
  private SwigDelegatePostingSource_3 swigDelegate3;
  private SwigDelegatePostingSource_4 swigDelegate4;
  private SwigDelegatePostingSource_5 swigDelegate5;
  private SwigDelegatePostingSource_6 swigDelegate6;
  private SwigDelegatePostingSource_7 swigDelegate7;
  private SwigDelegatePostingSource_8 swigDelegate8;
  private SwigDelegatePostingSource_9 swigDelegate9;
  private SwigDelegatePostingSource_10 swigDelegate10;
  private SwigDelegatePostingSource_11 swigDelegate11;

  private static Type[] swigMethodTypes0 = new Type[] {  };
  private static Type[] swigMethodTypes1 = new Type[] {  };
  private static Type[] swigMethodTypes2 = new Type[] {  };
  private static Type[] swigMethodTypes3 = new Type[] {  };
  private static Type[] swigMethodTypes4 = new Type[] {  };
  private static Type[] swigMethodTypes5 = new Type[] { typeof(double) };
  private static Type[] swigMethodTypes6 = new Type[] { typeof(uint), typeof(double) };
  private static Type[] swigMethodTypes7 = new Type[] { typeof(uint), typeof(double) };
  private static Type[] swigMethodTypes8 = new Type[] {  };
  private static Type[] swigMethodTypes9 = new Type[] {  };
  private static Type[] swigMethodTypes10 = new Type[] { typeof(Database) };
  private static Type[] swigMethodTypes11 = new Type[] {  };
}

}