selection.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2008 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_SELECTION_HH
00021 #define PALUDIS_GUARD_PALUDIS_SELECTION_HH 1
00022 
00023 #include <paludis/selection-fwd.hh>
00024 #include <paludis/selection_handler-fwd.hh>
00025 #include <paludis/filtered_generator-fwd.hh>
00026 #include <paludis/filter-fwd.hh>
00027 #include <paludis/generator-fwd.hh>
00028 #include <paludis/dep_spec-fwd.hh>
00029 #include <paludis/util/fs_entry-fwd.hh>
00030 #include <paludis/util/private_implementation_pattern.hh>
00031 #include <paludis/util/exception.hh>
00032 #include <paludis/name-fwd.hh>
00033 #include <paludis/package_id-fwd.hh>
00034 #include <paludis/environment-fwd.hh>
00035 
00036 namespace paludis
00037 {
00038     class DidNotGetExactlyOneError :
00039         public Exception
00040     {
00041         public:
00042             DidNotGetExactlyOneError(const std::string &,
00043                     const std::tr1::shared_ptr<const PackageIDSet> &) throw ();
00044     };
00045 
00046     class PALUDIS_VISIBLE Selection :
00047         private PrivateImplementationPattern<Selection>
00048     {
00049         protected:
00050             Selection(const std::tr1::shared_ptr<const SelectionHandler> &);
00051 
00052         public:
00053             Selection(const Selection &);
00054             ~Selection();
00055             Selection & operator= (const Selection &);
00056 
00057             std::string as_string() const PALUDIS_ATTRIBUTE((warn_unused_result));
00058 
00059             std::tr1::shared_ptr<PackageIDSequence> perform_select(const Environment * const) const
00060                 PALUDIS_ATTRIBUTE((warn_unused_result));
00061     };
00062 
00063     namespace selection
00064     {
00065         class PALUDIS_VISIBLE SomeArbitraryVersion :
00066             public Selection
00067         {
00068             public:
00069                 SomeArbitraryVersion(const FilteredGenerator &);
00070         };
00071 
00072         class PALUDIS_VISIBLE BestVersionOnly :
00073             public Selection
00074         {
00075             public:
00076                 BestVersionOnly(const FilteredGenerator &);
00077         };
00078 
00079         class PALUDIS_VISIBLE BestVersionInEachSlot :
00080             public Selection
00081         {
00082             public:
00083                 BestVersionInEachSlot(const FilteredGenerator &);
00084         };
00085 
00086         class PALUDIS_VISIBLE AllVersionsSorted :
00087             public Selection
00088         {
00089             public:
00090                 AllVersionsSorted(const FilteredGenerator &);
00091         };
00092 
00093         class PALUDIS_VISIBLE AllVersionsGroupedBySlot :
00094             public Selection
00095         {
00096             public:
00097                 AllVersionsGroupedBySlot(const FilteredGenerator &);
00098         };
00099 
00100         class PALUDIS_VISIBLE AllVersionsUnsorted :
00101             public Selection
00102         {
00103             public:
00104                 AllVersionsUnsorted(const FilteredGenerator &);
00105         };
00106 
00107         class PALUDIS_VISIBLE RequireExactlyOne :
00108             public Selection
00109         {
00110             public:
00111                 RequireExactlyOne(const FilteredGenerator &);
00112         };
00113     }
00114 
00115 #ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
00116     extern template class PrivateImplementationPattern<Selection>;
00117 #endif
00118 }
00119 
00120 #endif

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