xapian-core  2.0.0
registry.h
Go to the documentation of this file.
1 
4 /* Copyright 2009 Lemur Consulting Ltd
5  * Copyright 2009,2011,2013,2014,2019,2024 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, see
19  * <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef XAPIAN_INCLUDED_REGISTRY_H
23 #define XAPIAN_INCLUDED_REGISTRY_H
24 
25 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
26 # error Never use <xapian/registry.h> directly; include <xapian.h> instead.
27 #endif
28 
29 #include <xapian/intrusive_ptr.h>
30 #include <xapian/visibility.h>
31 #include <string>
32 
33 namespace Xapian {
34 
35 // Forward declarations.
36 class KeyMaker;
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 
77  Registry(Registry && other);
78 
84 
90  Registry();
91 
92  ~Registry();
93 
98  void register_weighting_scheme(const Xapian::Weight &wt);
99 
108  const Xapian::Weight* get_weighting_scheme(std::string_view name) const;
109 
114  void register_posting_source(const Xapian::PostingSource &source);
115 
124  const Xapian::PostingSource*
125  get_posting_source(std::string_view name) const;
126 
131  void register_match_spy(const Xapian::MatchSpy &spy);
132 
141  const Xapian::MatchSpy* get_match_spy(std::string_view name) const;
142 
144  void register_lat_long_metric(const Xapian::LatLongMetric &metric);
145 
152  const Xapian::LatLongMetric*
153  get_lat_long_metric(std::string_view name) const;
154 
168  void register_key_maker(Xapian::KeyMaker* keymaker);
169 
179  const Xapian::KeyMaker* get_key_maker(std::string_view name) const;
180 };
181 
182 }
183 
184 #endif /* XAPIAN_INCLUDED_REGISTRY_H */
Virtual base class for key making functors.
Definition: keymaker.h:44
Base class for calculating distances between two lat/long coordinates.
Definition: geospatial.h:302
Abstract base class for match spies.
Definition: matchspy.h:50
Base class which provides an "external" source of postings.
Definition: postingsource.h:47
Registry for user subclasses.
Definition: registry.h:47
Registry & operator=(Registry &&other)
Move assignment operator.
Registry(Registry &&other)
Move constructor.
Abstract base class for weighting schemes.
Definition: weight.h:38
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
Definition: header.h:215
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT
Definition: visibility.h:28