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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>LCOV - lcov.info - /usr/include/xapian/expanddecider.h</title>
<link rel="stylesheet" type="text/css" href="../../../gcov.css">
</head>
<body>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
<tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
<tr>
<td width="100%">
<table cellpadding=1 border=0 width="100%">
<tr>
<td class="headerItem" width="20%">Current view:</td>
<td class="headerValue" width="80%" colspan=4><a href="../../../index.html">directory</a> - <a href="index.html">usr/include/xapian</a> - expanddecider.h</td>
</tr>
<tr>
<td class="headerItem" width="20%">Test:</td>
<td class="headerValue" width="80%" colspan=4>lcov.info</td>
</tr>
<tr>
<td class="headerItem" width="20%">Date:</td>
<td class="headerValue" width="20%">2008-08-14</td>
<td width="20%"></td>
<td class="headerItem" width="20%">Instrumented lines:</td>
<td class="headerValue" width="20%">1</td>
</tr>
<tr>
<td class="headerItem" width="20%">Code covered:</td>
<td class="headerValue" width="20%">100.0 %</td>
<td width="20%"></td>
<td class="headerItem" width="20%">Executed lines:</td>
<td class="headerValue" width="20%">1</td>
</tr>
</table>
</td>
</tr>
<tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
</table>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td><br></td>
</tr>
<tr>
<td><pre class="source">
<span class="lineNum"> 1 </span> : /** @file expanddecider.h
<span class="lineNum"> 2 </span> : * @brief Allow rejection of terms during ESet generation.
<span class="lineNum"> 3 </span> : */
<span class="lineNum"> 4 </span> : /* Copyright (C) 2007 Olly Betts
<span class="lineNum"> 5 </span> : *
<span class="lineNum"> 6 </span> : * This program is free software; you can redistribute it and/or
<span class="lineNum"> 7 </span> : * modify it under the terms of the GNU General Public License as
<span class="lineNum"> 8 </span> : * published by the Free Software Foundation; either version 2 of the
<span class="lineNum"> 9 </span> : * License, or (at your option) any later version.
<span class="lineNum"> 10 </span> : *
<span class="lineNum"> 11 </span> : * This program is distributed in the hope that it will be useful,
<span class="lineNum"> 12 </span> : * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum"> 13 </span> : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<span class="lineNum"> 14 </span> : * GNU General Public License for more details.
<span class="lineNum"> 15 </span> : *
<span class="lineNum"> 16 </span> : * You should have received a copy of the GNU General Public License
<span class="lineNum"> 17 </span> : * along with this program; if not, write to the Free Software
<span class="lineNum"> 18 </span> : * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<span class="lineNum"> 19 </span> : */
<span class="lineNum"> 20 </span> :
<span class="lineNum"> 21 </span> : #ifndef XAPIAN_INCLUDED_EXPANDDECIDER_H
<span class="lineNum"> 22 </span> : #define XAPIAN_INCLUDED_EXPANDDECIDER_H
<span class="lineNum"> 23 </span> :
<span class="lineNum"> 24 </span> : #include <set>
<span class="lineNum"> 25 </span> : #include <string>
<span class="lineNum"> 26 </span> :
<span class="lineNum"> 27 </span> : #include <xapian/visibility.h>
<span class="lineNum"> 28 </span> :
<span class="lineNum"> 29 </span> : namespace Xapian {
<span class="lineNum"> 30 </span> :
<span class="lineNum"> 31 </span> : /** Virtual base class for expand decider functor. */
<span class="lineNum"> 32 </span><span class="lineCov"> 5 : class XAPIAN_VISIBILITY_DEFAULT ExpandDecider {</span>
<span class="lineNum"> 33 </span> : public:
<span class="lineNum"> 34 </span> : /** Do we want this term in the ESet? */
<span class="lineNum"> 35 </span> : virtual bool operator()(const std::string &term) const = 0;
<span class="lineNum"> 36 </span> :
<span class="lineNum"> 37 </span> : /** Virtual destructor, because we have virtual methods. */
<span class="lineNum"> 38 </span> : virtual ~ExpandDecider();
<span class="lineNum"> 39 </span> : };
<span class="lineNum"> 40 </span> :
<span class="lineNum"> 41 </span> : /** ExpandDecider subclass which rejects terms using two ExpandDeciders.
<span class="lineNum"> 42 </span> : *
<span class="lineNum"> 43 </span> : * Terms are only accepted if they are accepted by both of the specified
<span class="lineNum"> 44 </span> : * ExpandDecider objects.
<span class="lineNum"> 45 </span> : */
<span class="lineNum"> 46 </span> : class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderAnd : public ExpandDecider {
<span class="lineNum"> 47 </span> : const ExpandDecider &first, &second;
<span class="lineNum"> 48 </span> :
<span class="lineNum"> 49 </span> : public:
<span class="lineNum"> 50 </span> : /** Terms will be checked with @a first, and if accepted, then checked
<span class="lineNum"> 51 </span> : * with @a second.
<span class="lineNum"> 52 </span> : */
<span class="lineNum"> 53 </span> : ExpandDeciderAnd(const ExpandDecider &first_,
<span class="lineNum"> 54 </span> : const ExpandDecider &second_)
<span class="lineNum"> 55 </span> : : first(first_), second(second_) { }
<span class="lineNum"> 56 </span> :
<span class="lineNum"> 57 </span> : /** Compatibility method. */
<span class="lineNum"> 58 </span> : ExpandDeciderAnd(const ExpandDecider *first_,
<span class="lineNum"> 59 </span> : const ExpandDecider *second_)
<span class="lineNum"> 60 </span> : : first(*first_), second(*second_) { }
<span class="lineNum"> 61 </span> :
<span class="lineNum"> 62 </span> : virtual bool operator()(const std::string &term) const;
<span class="lineNum"> 63 </span> : };
<span class="lineNum"> 64 </span> :
<span class="lineNum"> 65 </span> : /** ExpandDecider subclass which rejects terms in a specified list.
<span class="lineNum"> 66 </span> : *
<span class="lineNum"> 67 </span> : * ExpandDeciderFilterTerms provides an easy way to filter out terms from
<span class="lineNum"> 68 </span> : * a fixed list when generating an ESet.
<span class="lineNum"> 69 </span> : */
<span class="lineNum"> 70 </span> : class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderFilterTerms : public ExpandDecider {
<span class="lineNum"> 71 </span> : std::set<std::string> rejects;
<span class="lineNum"> 72 </span> :
<span class="lineNum"> 73 </span> : public:
<span class="lineNum"> 74 </span> : /** The two iterators specify a list of terms to be rejected.
<span class="lineNum"> 75 </span> : *
<span class="lineNum"> 76 </span> : * @a reject_begin and @a reject_end can be any input_iterator type
<span class="lineNum"> 77 </span> : * which returns std::string or char * (e.g. TermIterator or char **).
<span class="lineNum"> 78 </span> : */
<span class="lineNum"> 79 </span> : template <class Iterator>
<span class="lineNum"> 80 </span> : ExpandDeciderFilterTerms(Iterator reject_begin, Iterator reject_end)
<span class="lineNum"> 81 </span> : : rejects(reject_begin, reject_end) { }
<span class="lineNum"> 82 </span> :
<span class="lineNum"> 83 </span> : virtual bool operator()(const std::string &term) const;
<span class="lineNum"> 84 </span> : };
<span class="lineNum"> 85 </span> :
<span class="lineNum"> 86 </span> : }
<span class="lineNum"> 87 </span> :
<span class="lineNum"> 88 </span> : #endif // XAPIAN_INCLUDED_EXPANDDECIDER_H
</pre>
</td>
</tr>
</table>
<br>
<table width="100%" border=0 cellspacing=0 cellpadding=0>
<tr><td class="ruler"><img src="../../../glass.png" width=3 height=3 alt=""></td></tr>
<tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
</table>
<br>
</body>
</html>
|