filter_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/filter_handler-fwd.hh>
00025 #include <paludis/name-fwd.hh>
00026 #include <paludis/environment-fwd.hh>
00027 #include <paludis/package_id-fwd.hh>
00028 #include <paludis/util/attributes.hh>
00029 #include <tr1/memory>
00030 
00031 namespace paludis
00032 {
00033     class PALUDIS_VISIBLE FilterHandler
00034     {
00035         public:
00036             virtual ~FilterHandler() = 0;
00037 
00038             virtual std::string as_string() const = 0;
00039 
00040             virtual std::tr1::shared_ptr<const RepositoryNameSet> repositories(
00041                     const Environment * const,
00042                     const std::tr1::shared_ptr<const RepositoryNameSet> &) const = 0;
00043 
00044             virtual std::tr1::shared_ptr<const CategoryNamePartSet> categories(
00045                     const Environment * const,
00046                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00047                     const std::tr1::shared_ptr<const CategoryNamePartSet> &) const = 0;
00048 
00049             virtual std::tr1::shared_ptr<const QualifiedPackageNameSet> packages(
00050                     const Environment * const,
00051                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00052                     const std::tr1::shared_ptr<const QualifiedPackageNameSet> &) const = 0;
00053 
00054             virtual std::tr1::shared_ptr<const PackageIDSet> ids(
00055                     const Environment * const,
00056                     const std::tr1::shared_ptr<const PackageIDSet> &) const = 0;
00057     };
00058 
00059     class PALUDIS_VISIBLE AllFilterHandlerBase :
00060         public FilterHandler
00061     {
00062         public:
00063             virtual std::tr1::shared_ptr<const RepositoryNameSet> repositories(
00064                     const Environment * const,
00065                     const std::tr1::shared_ptr<const RepositoryNameSet> &) const;
00066 
00067             virtual std::tr1::shared_ptr<const CategoryNamePartSet> categories(
00068                     const Environment * const,
00069                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00070                     const std::tr1::shared_ptr<const CategoryNamePartSet> &) const;
00071 
00072             virtual std::tr1::shared_ptr<const QualifiedPackageNameSet> packages(
00073                     const Environment * const,
00074                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00075                     const std::tr1::shared_ptr<const QualifiedPackageNameSet> &) const;
00076 
00077             virtual std::tr1::shared_ptr<const PackageIDSet> ids(
00078                     const Environment * const,
00079                     const std::tr1::shared_ptr<const PackageIDSet> &) const;
00080     };
00081 }
00082 
00083 #endif

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