selection_handler.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2008 Ciaran McCreesh
00005  * Copyright (c) 2008 David Leverton
00006  *
00007  * This file is part of the Paludis package manager. Paludis is free software;
00008  * you can redistribute it and/or modify it under the terms of the GNU General
00009  * Public License version 2, as published by the Free Software Foundation.
00010  *
00011  * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
00012  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00014  * details.
00015  *
00016  * You should have received a copy of the GNU General Public License along with
00017  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00018  * Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 #ifndef PALUDIS_GUARD_PALUDIS_FILTER_HANDLER_HH
00022 #define PALUDIS_GUARD_PALUDIS_FILTER_HANDLER_HH 1
00023 
00024 #include <paludis/selection_handler-fwd.hh>
00025 #include <paludis/filtered_generator.hh>
00026 #include <paludis/environment-fwd.hh>
00027 #include <paludis/package_id-fwd.hh>
00028 #include <paludis/util/attributes.hh>
00029 #include <paludis/util/instantiation_policy.hh>
00030 #include <tr1/memory>
00031 
00032 namespace paludis
00033 {
00034     class SelectionHandler :
00035         private InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>
00036     {
00037         protected:
00038             const FilteredGenerator _fg;
00039 
00040             SelectionHandler(const FilteredGenerator & g) :
00041                 _fg(g)
00042             {
00043             }
00044 
00045         public:
00046             virtual ~SelectionHandler() = 0;
00047 
00048             virtual std::string as_string() const = 0;
00049 
00050             virtual std::tr1::shared_ptr<PackageIDSequence> perform_select(const Environment * const) const
00051                 PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
00052     };
00053 
00054 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
00055     extern template class InstantiationPolicy<SelectionHandler, instantiation_method::NonCopyableTag>;
00056 #endif
00057 }
00058 
00059 #endif

Generated on Mon Sep 21 10:36:08 2009 for paludis by  doxygen 1.5.4