File: classXapian_1_1ValueMapPostingSource.html

package info (click to toggle)
xapian-core 1.2.12-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 19,180 kB
  • sloc: cpp: 100,708; sh: 11,201; ansic: 8,177; makefile: 813; perl: 758; python: 40
file content (435 lines) | stat: -rw-r--r-- 30,164 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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Xapian: API Documentation: xapian-core: Xapian::ValueMapPostingSource Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.5.9 -->
<script type="text/javascript">
<!--
function changeDisplayState (e){
  var num=this.id.replace(/[^[0-9]/g,'');
  var button=this.firstChild;
  var sectionDiv=document.getElementById('dynsection'+num);
  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
    sectionDiv.style.display='block';
    button.src='open.gif';
  }else{
    sectionDiv.style.display='none';
    button.src='closed.gif';
  }
}
function initDynSections(){
  var divs=document.getElementsByTagName('div');
  var sectionCounter=1;
  for(var i=0;i<divs.length-1;i++){
    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
      var header=divs[i];
      var section=divs[i+1];
      var button=header.firstChild;
      if (button!='IMG'){
        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
        button=document.createElement('img');
        divs[i].insertBefore(button,divs[i].firstChild);
      }
      header.style.cursor='pointer';
      header.onclick=changeDisplayState;
      header.id='dynheader'+sectionCounter;
      button.src='closed.gif';
      section.id='dynsection'+sectionCounter;
      section.style.display='none';
      section.style.marginLeft='14px';
      sectionCounter++;
    }
  }
}
window.onload = initDynSections;
-->
</script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceXapian.html">Xapian</a>::<a class="el" href="classXapian_1_1ValueMapPostingSource.html">ValueMapPostingSource</a>
  </div>
</div>
<div class="contents">
<h1>Xapian::ValueMapPostingSource Class Reference</h1><!-- doxytag: class="Xapian::ValueMapPostingSource" --><!-- doxytag: inherits="Xapian::ValuePostingSource" -->A posting source which looks up weights in a map using values as the key.  
<a href="#_details">More...</a>
<p>
<div class="dynheader">
Inheritance diagram for Xapian::ValueMapPostingSource:</div>
<div class="dynsection">
<p><center><img src="classXapian_1_1ValueMapPostingSource__inherit__graph.png" border="0" usemap="#Xapian_1_1ValueMapPostingSource__inherit__map" alt="Inheritance graph"></center>
<map name="Xapian_1_1ValueMapPostingSource__inherit__map">
<area shape="rect" href="classXapian_1_1ValuePostingSource.html" title="A posting source which generates weights from a value slot." alt="" coords="19,84,219,111"><area shape="rect" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings." alt="" coords="37,7,200,33"></map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classXapian_1_1ValueMapPostingSource-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#ef9518eab055c5f1d3bea3fb8df4368f">ValueMapPostingSource</a> (<a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a> slot_)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Construct a <a class="el" href="classXapian_1_1ValueWeightPostingSource.html" title="A posting source which reads weights from a value slot.">ValueWeightPostingSource</a>.  <a href="#ef9518eab055c5f1d3bea3fb8df4368f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#126c88575ad8f06c850826ac7cd2a591">add_mapping</a> (const std::string &amp;key, double wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add a mapping.  <a href="#126c88575ad8f06c850826ac7cd2a591"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#4f41218d580d29681e748a7d25aad8aa">clear_mappings</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clear all mappings.  <a href="#4f41218d580d29681e748a7d25aad8aa"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#895c2f710b42bf93f71d0321225dc38f">set_default_weight</a> (double wt)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set a default weight for document values not in the map.  <a href="#895c2f710b42bf93f71d0321225dc38f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#96cea230e42fa66778ac109501413327">get_weight</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the weight contribution for the current document.  <a href="#96cea230e42fa66778ac109501413327"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classXapian_1_1ValueMapPostingSource.html">ValueMapPostingSource</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#75598085ba9e49e1a2fd0e232d191461">clone</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clone the posting source.  <a href="#75598085ba9e49e1a2fd0e232d191461"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#717c8ccd76b95946b07e68e759dcca97">name</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Name of the posting source class.  <a href="#717c8ccd76b95946b07e68e759dcca97"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#534c78ecea04a7a649d8ba27447edee3">serialise</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Serialise object parameters into a string.  <a href="#534c78ecea04a7a649d8ba27447edee3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classXapian_1_1ValueMapPostingSource.html">ValueMapPostingSource</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#b3f716ff004f91e2ecc51548119f3891">unserialise</a> (const std::string &amp;s) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create object given string serialisation returned by <a class="el" href="classXapian_1_1ValueMapPostingSource.html#534c78ecea04a7a649d8ba27447edee3" title="Serialise object parameters into a string.">serialise()</a>.  <a href="#b3f716ff004f91e2ecc51548119f3891"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#e76de9cb534e96b7a0cc827d89eea8fc">init</a> (const <a class="el" href="classXapian_1_1Database.html">Database</a> &amp;db_)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> to the start of the list of postings.  <a href="#e76de9cb534e96b7a0cc827d89eea8fc"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1ValueMapPostingSource.html#e8687a2981841c33bb04f3e28d3d7892">get_description</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return a string describing this object.  <a href="#e8687a2981841c33bb04f3e28d3d7892"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A posting source which looks up weights in a map using values as the key. 
<p>
This allows will return entries for all documents in the given database which have a value in the slot specified. The values will be mapped to the corresponding weight in the weight map. If there is no mapping for a particular value, the default weight will be returned (which itself defaults to 0.0). <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ef9518eab055c5f1d3bea3fb8df4368f"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::ValueMapPostingSource" ref="ef9518eab055c5f1d3bea3fb8df4368f" args="(Xapian::valueno slot_)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Xapian::ValueMapPostingSource::ValueMapPostingSource           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespaceXapian.html#94a899651fa920c72ffa9635bde630ea">Xapian::valueno</a>&nbsp;</td>
          <td class="paramname"> <em>slot_</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Construct a <a class="el" href="classXapian_1_1ValueWeightPostingSource.html" title="A posting source which reads weights from a value slot.">ValueWeightPostingSource</a>. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>slot_</em>&nbsp;</td><td>The value slot to read values from. </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="126c88575ad8f06c850826ac7cd2a591"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::add_mapping" ref="126c88575ad8f06c850826ac7cd2a591" args="(const std::string &amp;key, double wt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::ValueMapPostingSource::add_mapping           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>wt</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Add a mapping. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>key</em>&nbsp;</td><td>The key looked up from the value slot. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>wt</em>&nbsp;</td><td>The weight to give this key. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="4f41218d580d29681e748a7d25aad8aa"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::clear_mappings" ref="4f41218d580d29681e748a7d25aad8aa" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::ValueMapPostingSource::clear_mappings           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Clear all mappings. 
<p>

</div>
</div><p>
<a class="anchor" name="75598085ba9e49e1a2fd0e232d191461"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::clone" ref="75598085ba9e49e1a2fd0e232d191461" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classXapian_1_1ValueMapPostingSource.html">ValueMapPostingSource</a>* Xapian::ValueMapPostingSource::clone           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Clone the posting source. 
<p>
The clone should inherit the configuration of the parent, but need not inherit the state. ie, the clone does not need to be in the same iteration position as the original: the matcher will always call <a class="el" href="classXapian_1_1ValueMapPostingSource.html#e76de9cb534e96b7a0cc827d89eea8fc" title="Set this PostingSource to the start of the list of postings.">init()</a> on the clone before attempting to move the iterator, or read the information about the current position of the iterator.<p>
This may return NULL to indicate that cloning is not supported. In this case, the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> may only be used with a single-database search.<p>
The default implementation returns NULL.<p>
Note that the returned object will be deallocated by <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> after use with "delete". If you want to handle the deletion in a special way (for example when wrapping the <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> API for use from another language) then you can define a static <code>operator delete</code> method in your subclass as shown here: <a href="http://trac.xapian.org/ticket/554#comment:1">http://trac.xapian.org/ticket/554#comment:1</a> 
<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#ecd88a39155ec5e04c752360b657f315">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="e8687a2981841c33bb04f3e28d3d7892"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::get_description" ref="e8687a2981841c33bb04f3e28d3d7892" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::ValueMapPostingSource::get_description           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a string describing this object. 
<p>
This default implementation returns a generic answer. This default it provided to avoid forcing those deriving their own <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass from having to implement this (they may not care what <a class="el" href="classXapian_1_1ValueMapPostingSource.html#e8687a2981841c33bb04f3e28d3d7892" title="Return a string describing this object.">get_description()</a> gives for their subclass). 
<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#47d794241880cc691df1c3a3896d1050">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="96cea230e42fa66778ac109501413327"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::get_weight" ref="96cea230e42fa66778ac109501413327" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespaceXapian.html#cac12803afc9e24ee5141c119acb8884">Xapian::weight</a> Xapian::ValueMapPostingSource::get_weight           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return the weight contribution for the current document. 
<p>
This default implementation always returns 0, for convenience when implementing "weight-less" <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclasses.<p>
This method may assume that it will only be called when there is a "current document". In detail: <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will always call <a class="el" href="classXapian_1_1ValueMapPostingSource.html#e76de9cb534e96b7a0cc827d89eea8fc" title="Set this PostingSource to the start of the list of postings.">init()</a> on a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> before calling this for the first time. It will also only call this if the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> reports that it is pointing to a valid document (ie, it will not call it before calling at least one of <a class="el" href="classXapian_1_1ValuePostingSource.html#87b22aac8422f80124b50a456d1d85b0" title="Advance the current position to the next matching document.">next()</a>, <a class="el" href="classXapian_1_1ValuePostingSource.html#f11095a4355f96d7bc12074a5a91cd93" title="Advance to the specified docid.">skip_to()</a> or <a class="el" href="classXapian_1_1ValuePostingSource.html#71868e54627098425820f7a76e259197" title="Check if the specified docid occurs.">check()</a>, and will ensure that the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> is not at the end by calling <a class="el" href="classXapian_1_1ValuePostingSource.html#4bb7ea314dbd569f90f89731204cdc40" title="Return true if the current position is past the last entry in this list.">at_end()</a>). 
<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#2e7637a323a90bea45f2dc68c916ea00">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="e76de9cb534e96b7a0cc827d89eea8fc"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::init" ref="e76de9cb534e96b7a0cc827d89eea8fc" args="(const Database &amp;db_)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::ValueMapPostingSource::init           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classXapian_1_1Database.html">Database</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>db</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> to the start of the list of postings. 
<p>
This is called automatically by the matcher prior to each query being processed.<p>
If a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> is used for multiple searches, <em><a class="el" href="classXapian_1_1ValueMapPostingSource.html#e76de9cb534e96b7a0cc827d89eea8fc" title="Set this PostingSource to the start of the list of postings.">init()</a></em> will therefore be called multiple times, and must handle this by using the database passed in the most recent call.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>db</em>&nbsp;</td><td>The database which the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> should iterate through.</td></tr>
  </table>
</dl>
Note: the database supplied to this method must not be modified: in particular, the reopen() method should not be called on it.<p>
Note: in the case of a multi-database search, a separate <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> will be used for each database (the separate PostingSources will be obtained using <em><a class="el" href="classXapian_1_1ValueMapPostingSource.html#75598085ba9e49e1a2fd0e232d191461" title="Clone the posting source.">clone()</a></em>), and each <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> will be passed one of the sub-databases as the <em>db</em> parameter here. The <em>db</em> parameter will therefore always refer to a single database. All docids passed to, or returned from, the <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> refer to docids in that single database, rather than in the multi-database. 
<p>Reimplemented from <a class="el" href="classXapian_1_1ValuePostingSource.html#764328b2a7085e24393a94eb1d2b91e0">Xapian::ValuePostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="717c8ccd76b95946b07e68e759dcca97"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::name" ref="717c8ccd76b95946b07e68e759dcca97" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::ValueMapPostingSource::name           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Name of the posting source class. 
<p>
This is used when serialising and unserialising posting sources; for example, for performing remote searches.<p>
If the subclass is in a C++ namespace, the namespace should be included in the name, using "::" as a separator. For example, for a <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass called "FooPostingSource" in the "Xapian" namespace the result of this call should be "Xapian::FooPostingSource".<p>
This should only be implemented if <a class="el" href="classXapian_1_1ValueMapPostingSource.html#534c78ecea04a7a649d8ba27447edee3" title="Serialise object parameters into a string.">serialise()</a> and <a class="el" href="classXapian_1_1ValueMapPostingSource.html#b3f716ff004f91e2ecc51548119f3891" title="Create object given string serialisation returned by serialise().">unserialise()</a> are also implemented. The default implementation returns an empty string.<p>
If this returns an empty string, <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> will assume that <a class="el" href="classXapian_1_1ValueMapPostingSource.html#534c78ecea04a7a649d8ba27447edee3" title="Serialise object parameters into a string.">serialise()</a> and <a class="el" href="classXapian_1_1ValueMapPostingSource.html#b3f716ff004f91e2ecc51548119f3891" title="Create object given string serialisation returned by serialise().">unserialise()</a> are not implemented. 
<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#7b5c506178f996e59ed641ad62520734">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="534c78ecea04a7a649d8ba27447edee3"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::serialise" ref="534c78ecea04a7a649d8ba27447edee3" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string Xapian::ValueMapPostingSource::serialise           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Serialise object parameters into a string. 
<p>
The serialised parameters should represent the configuration of the posting source, but need not (indeed, should not) represent the current iteration state.<p>
If you don't want to support the remote backend, you can use the default implementation which simply throws <a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a>. 
<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#6ad26dc173cf1ab175dea945ba2622e0">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<a class="anchor" name="895c2f710b42bf93f71d0321225dc38f"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::set_default_weight" ref="895c2f710b42bf93f71d0321225dc38f" args="(double wt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Xapian::ValueMapPostingSource::set_default_weight           </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>wt</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Set a default weight for document values not in the map. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>wt</em>&nbsp;</td><td>The weight to set as the default. </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="b3f716ff004f91e2ecc51548119f3891"></a><!-- doxytag: member="Xapian::ValueMapPostingSource::unserialise" ref="b3f716ff004f91e2ecc51548119f3891" args="(const std::string &amp;s) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classXapian_1_1ValueMapPostingSource.html">ValueMapPostingSource</a>* Xapian::ValueMapPostingSource::unserialise           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>s</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create object given string serialisation returned by <a class="el" href="classXapian_1_1ValueMapPostingSource.html#534c78ecea04a7a649d8ba27447edee3" title="Serialise object parameters into a string.">serialise()</a>. 
<p>
Note that the returned object will be deallocated by <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> after use with "delete". If you want to handle the deletion in a special way (for example when wrapping the <a class="el" href="namespaceXapian.html" title="The Xapian namespace contains public interfaces for the Xapian library.">Xapian</a> API for use from another language) then you can define a static <code>operator delete</code> method in your subclass as shown here: <a href="http://trac.xapian.org/ticket/554#comment:1">http://trac.xapian.org/ticket/554#comment:1</a><p>
If you don't want to support the remote backend, you can use the default implementation which simply throws <a class="el" href="classXapian_1_1UnimplementedError.html" title="UnimplementedError indicates an attempt to use an unimplemented feature.">Xapian::UnimplementedError</a>.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>s</em>&nbsp;</td><td>A serialised instance of this <a class="el" href="classXapian_1_1PostingSource.html" title="Base class which provides an &quot;external&quot; source of postings.">PostingSource</a> subclass. </td></tr>
  </table>
</dl>

<p>Reimplemented from <a class="el" href="classXapian_1_1PostingSource.html#b3312a9172b1881c354faf3d2d9b585d">Xapian::PostingSource</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>xapian/<a class="el" href="postingsource_8h.html">postingsource.h</a></ul>
</div>
<hr>
<address><small>
Documentation for Xapian (version 1.2.12).<br>
Generated on 27 Jun 2012 by
<a href="http://www.doxygen.org/">Doxygen 1.5.9</a>.
</small></address>
</body>
</html>