00001 /* Copyright (C) 2010 webis.de 00002 * All rights reserved. 00003 */ 00004 #ifndef AITOOLS_INVERTEDINDEX_SEARCHER_HPP 00005 #define AITOOLS_INVERTEDINDEX_SEARCHER_HPP 00006 00007 #include "Iterator.hpp" 00008 #include "Quantile.hpp" 00009 #include "NonCopyable.hpp" 00010 #include "MPHashFunction.hpp" 00011 #include "IndexMessages.pb.h" 00012 #include <boost/shared_ptr.hpp> 00013 00014 namespace aitools { 00015 namespace invertedindex { 00016 00028 class Searcher : public NonCopyable { 00029 00030 public: // nested types 00031 00032 typedef boost::shared_ptr<Searcher> SharedPointer; 00033 00034 public: // c'tor / d'tor 00035 00039 Searcher() {}; 00040 00044 virtual ~Searcher() {}; 00045 00046 public: // member 00047 00048 virtual void init(const Configuration& config) = 0; 00049 00050 virtual Iterator::SharedPointer 00051 generic_search(const std::string& key) = 0; 00052 00053 virtual Iterator::SharedPointer 00054 generic_search(const std::string& key, Quantile::Order order) = 0; 00055 00056 virtual Iterator::SharedPointer 00057 generic_search(const std::string& key, size_t length) = 0; 00058 00059 virtual const Quantile& quantile(const std::string& key) const = 0; 00060 00061 virtual const Vocabulary& vocabulary() const = 0; 00062 00063 virtual const Header& header() const = 0; 00064 00065 }; 00066 00067 } // namespace invertedindex 00068 } // namespace aitools 00069 00070 #endif // AITOOLS_INVERTEDINDEX_SEARCHER_HPP