xapian-core  2.0.0
matchdecider.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2017 Olly Betts
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (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, see
18  * <https://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef XAPIAN_INCLUDED_MATCHDECIDER_H
22 #define XAPIAN_INCLUDED_MATCHDECIDER_H
23 
24 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
25 # error Never use <xapian/matchdecider.h> directly; include <xapian.h> instead.
26 #endif
27 
28 #include <xapian/attributes.h>
29 #include <xapian/types.h>
30 #include <xapian/visibility.h>
31 
32 namespace Xapian {
33 
34 class Document;
35 
38  private:
40  void operator=(const MatchDecider &) = delete;
41 
43  MatchDecider(const MatchDecider &) = delete;
44 
45  public:
47  MatchDecider() noexcept {}
48 
50  virtual ~MatchDecider() { }
51 
62  virtual bool operator()(const Xapian::Document &doc) const = 0;
63 };
64 
65 }
66 
67 #endif // XAPIAN_INCLUDED_MATCHDECIDER_H
Compiler attribute macros.
Class representing a document.
Definition: document.h:64
Abstract base class for match deciders.
Definition: matchdecider.h:37
virtual bool operator()(const Xapian::Document &doc) const =0
Decide whether to accept a document.
MatchDecider() noexcept
Default constructor, needed by subclass constructors.
Definition: matchdecider.h:47
MatchDecider(const MatchDecider &)=delete
Don't allow copying.
virtual ~MatchDecider()
Virtual destructor, because we have virtual methods.
Definition: matchdecider.h:50
void operator=(const MatchDecider &)=delete
Don't allow assignment.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
typedefs for Xapian
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28