xapian-core  1.4.27
boolweight.cc
Go to the documentation of this file.
1 
4 /* Copyright (C) 2009,2011,2016 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <config.h>
22 
23 #include "xapian/weight.h"
24 
25 #include "xapian/error.h"
26 
27 using namespace std;
28 
29 namespace Xapian {
30 
31 BoolWeight *
32 BoolWeight::clone() const
33 {
34  return new BoolWeight;
35 }
36 
37 void
38 BoolWeight::init(double)
39 {
40  // Nothing to do here.
41 }
42 
43 string
45 {
46  return "Xapian::BoolWeight";
47 }
48 
49 string
50 BoolWeight::serialise() const
51 {
52  // No parameters to serialise.
53  return string();
54 }
55 
56 BoolWeight *
57 BoolWeight::unserialise(const string& s) const
58 {
59  if (rare(!s.empty()))
60  throw Xapian::SerialisationError("Extra data in BoolWeight::unserialise()");
61  return new BoolWeight;
62 }
63 
64 double
65 BoolWeight::get_sumpart(Xapian::termcount, Xapian::termcount,
66  Xapian::termcount) const
67 {
68  return 0;
69 }
70 
71 double
72 BoolWeight::get_maxpart() const
73 {
74  return 0;
75 }
76 
77 double
78 BoolWeight::get_sumextra(Xapian::termcount, Xapian::termcount) const
79 {
80  return 0;
81 }
82 
83 double
84 BoolWeight::get_maxextra() const
85 {
86  return 0;
87 }
88 
89 }
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
STL namespace.
#define rare(COND)
Definition: config.h:575
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
Class implementing a "boolean" weighting scheme.
Definition: weight.h:433
Indicates an error in the std::string serialisation of an object.
Definition: error.h:929
Weighting scheme API.
char name[9]
Definition: dbcheck.cc:55