xapian-core  1.4.27
registry.h
Go to the documentation of this file.
1 
4 /* Copyright 2009 Lemur Consulting Ltd
5  * Copyright 2009,2011,2013,2014 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef XAPIAN_INCLUDED_REGISTRY_H
24 #define XAPIAN_INCLUDED_REGISTRY_H
25 
26 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
27 # error Never use <xapian/registry.h> directly; include <xapian.h> instead.
28 #endif
29 
30 #include <xapian/intrusive_ptr.h>
31 #include <xapian/visibility.h>
32 #include <string>
33 
34 namespace Xapian {
35 
36 // Forward declarations.
37 class LatLongMetric;
38 class MatchSpy;
39 class PostingSource;
40 class Weight;
41 
48  public:
50  class Internal;
51 
52  private:
55 
56  public:
63  Registry(const Registry & other);
64 
71  Registry & operator=(const Registry & other);
72 
73 #ifdef XAPIAN_MOVE_SEMANTICS
74 
78  Registry(Registry && other);
79 
84  Registry & operator=(Registry && other);
85 #endif
86 
92  Registry();
93 
94  ~Registry();
95 
100  void register_weighting_scheme(const Xapian::Weight &wt);
101 
110  const Xapian::Weight *
111  get_weighting_scheme(const std::string & name) const;
112 
117  void register_posting_source(const Xapian::PostingSource &source);
118 
127  const Xapian::PostingSource *
128  get_posting_source(const std::string & name) const;
129 
134  void register_match_spy(const Xapian::MatchSpy &spy);
135 
144  const Xapian::MatchSpy *
145  get_match_spy(const std::string & name) const;
146 
148  void register_lat_long_metric(const Xapian::LatLongMetric &metric);
149 
156  const Xapian::LatLongMetric *
157  get_lat_long_metric(const std::string & name) const;
158 
159 };
160 
161 }
162 
163 #endif /* XAPIAN_INCLUDED_REGISTRY_H */
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
Abstract base class for match spies.
Definition: matchspy.h:49
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28
Define XAPIAN_VISIBILITY_* macros.
Registry for user subclasses.
Definition: registry.h:47
Base class for calculating distances between two lat/long coordinates.
Definition: geospatial.h:303
Base class which provides an "external" source of postings.
Definition: postingsource.h:47
Definition: header.h:151
A smart pointer that uses intrusive reference counting.
Definition: intrusive_ptr.h:81
Abstract base class for weighting schemes.
Definition: weight.h:35