filter.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2008, 2009 Ciaran McCreesh
00005  *
00006  * This file is part of the Paludis package manager. Paludis is free software;
00007  * you can redistribute it and/or modify it under the terms of the GNU General
00008  * Public License version 2, as published by the Free Software Foundation.
00009  *
00010  * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
00011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
00013  * details.
00014  *
00015  * You should have received a copy of the GNU General Public License along with
00016  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00017  * Place, Suite 330, Boston, MA  02111-1307  USA
00018  */
00019 
00020 #ifndef PALUDIS_GUARD_PALUDIS_FILTER_HH
00021 #define PALUDIS_GUARD_PALUDIS_FILTER_HH 1
00022 
00023 #include <paludis/filter-fwd.hh>
00024 #include <paludis/filter_handler-fwd.hh>
00025 #include <paludis/util/attributes.hh>
00026 #include <paludis/util/private_implementation_pattern.hh>
00027 #include <paludis/util/set-fwd.hh>
00028 #include <paludis/util/fs_entry-fwd.hh>
00029 #include <paludis/name-fwd.hh>
00030 #include <paludis/environment-fwd.hh>
00031 #include <paludis/package_id-fwd.hh>
00032 #include <paludis/action-fwd.hh>
00033 #include <tr1/memory>
00034 
00035 namespace paludis
00036 {
00037     class PALUDIS_VISIBLE Filter :
00038         private PrivateImplementationPattern<Filter>
00039     {
00040         protected:
00041             Filter(const std::tr1::shared_ptr<const FilterHandler> &);
00042 
00043         public:
00044             Filter(const Filter &);
00045             Filter & operator= (const Filter &);
00046             ~Filter();
00047 
00048             std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
00049 
00050             std::tr1::shared_ptr<const RepositoryNameSet> repositories(
00051                     const Environment * const,
00052                     const std::tr1::shared_ptr<const RepositoryNameSet> &) const
00053                 PALUDIS_ATTRIBUTE((warn_unused_result));
00054 
00055             std::tr1::shared_ptr<const CategoryNamePartSet> categories(
00056                     const Environment * const,
00057                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00058                     const std::tr1::shared_ptr<const CategoryNamePartSet> &) const
00059                 PALUDIS_ATTRIBUTE((warn_unused_result));
00060 
00061             std::tr1::shared_ptr<const QualifiedPackageNameSet> packages(
00062                     const Environment * const,
00063                     const std::tr1::shared_ptr<const RepositoryNameSet> &,
00064                     const std::tr1::shared_ptr<const QualifiedPackageNameSet> &) const
00065                 PALUDIS_ATTRIBUTE((warn_unused_result));
00066 
00067             std::tr1::shared_ptr<const PackageIDSet> ids(
00068                     const Environment * const,
00069                     const std::tr1::shared_ptr<const PackageIDSet> &) const
00070                 PALUDIS_ATTRIBUTE((warn_unused_result));
00071     };
00072 
00073     namespace filter
00074     {
00075         class PALUDIS_VISIBLE All :
00076             public Filter
00077         {
00078             public:
00079                 All();
00080         };
00081 
00082         template <typename>
00083         class PALUDIS_VISIBLE SupportsAction :
00084             public Filter
00085         {
00086             public:
00087                 SupportsAction();
00088         };
00089 
00090         class PALUDIS_VISIBLE NotMasked :
00091             public Filter
00092         {
00093             public:
00094                 NotMasked();
00095         };
00096 
00097         class PALUDIS_VISIBLE InstalledAtRoot :
00098             public Filter
00099         {
00100             public:
00101                 InstalledAtRoot(const FSEntry &);
00102         };
00103 
00104         class PALUDIS_VISIBLE And :
00105             public Filter
00106         {
00107             public:
00108                 And(const Filter &, const Filter &);
00109         };
00110 
00111         class PALUDIS_VISIBLE SameSlot :
00112             public Filter
00113         {
00114             public:
00115                 SameSlot(const std::tr1::shared_ptr<const PackageID> &);
00116         };
00117 
00118         class PALUDIS_VISIBLE Slot :
00119             public Filter
00120         {
00121             public:
00122                 Slot(const SlotName &);
00123         };
00124 
00125         class PALUDIS_VISIBLE NoSlot :
00126             public Filter
00127         {
00128             public:
00129                 NoSlot();
00130         };
00131     }
00132 
00133 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
00134     extern template class PrivateImplementationPattern<Filter>;
00135     extern template class filter::SupportsAction<InstallAction>;
00136     extern template class filter::SupportsAction<InstalledAction>;
00137     extern template class filter::SupportsAction<UninstallAction>;
00138     extern template class filter::SupportsAction<PretendAction>;
00139     extern template class filter::SupportsAction<ConfigAction>;
00140     extern template class filter::SupportsAction<FetchAction>;
00141     extern template class filter::SupportsAction<InfoAction>;
00142     extern template class filter::SupportsAction<PretendFetchAction>;
00143 #endif
00144 }
00145 
00146 #endif

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