00001 00004 /* Copyright 2009 Lemur Consulting Ltd 00005 * Copyright 2009,2011 Olly Betts 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #ifndef XAPIAN_INCLUDED_REGISTRY_H 00024 #define XAPIAN_INCLUDED_REGISTRY_H 00025 00026 #include <xapian/base.h> 00027 #include <xapian/visibility.h> 00028 #include <string> 00029 00030 namespace Xapian { 00031 00032 // Forward declarations. 00033 class MatchSpy; 00034 class PostingSource; 00035 class Weight; 00036 00042 class XAPIAN_VISIBILITY_DEFAULT Registry { 00043 public: 00045 class Internal; 00046 00047 private: 00049 Xapian::Internal::RefCntPtr<Internal> internal; 00050 00051 public: 00058 Registry(const Registry & other); 00059 00066 Registry & operator=(const Registry & other); 00067 00073 Registry(); 00074 00075 ~Registry(); 00076 00081 void register_weighting_scheme(const Xapian::Weight &wt); 00082 00091 const Xapian::Weight * 00092 get_weighting_scheme(const std::string & name) const; 00093 00098 void register_posting_source(const Xapian::PostingSource &source); 00099 00108 const Xapian::PostingSource * 00109 get_posting_source(const std::string & name) const; 00110 00115 void register_match_spy(const Xapian::MatchSpy &spy); 00116 00125 const Xapian::MatchSpy * 00126 get_match_spy(const std::string & name) const; 00127 }; 00128 00129 } 00130 00131 #endif /* XAPIAN_INCLUDED_REGISTRY_H */