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

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