fake_installed_repository.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2005, 2006, 2007, 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_REPOSITORIES_FAKE_FAKE_INSTALLED_REPOSITORY_HH
00021 #define PALUDIS_GUARD_PALUDIS_REPOSITORIES_FAKE_FAKE_INSTALLED_REPOSITORY_HH 1
00022 
00023 #include <paludis/repositories/fake/fake_repository_base.hh>
00024 
00025 namespace paludis
00026 {
00027     /**
00028      * A fake repository for test cases, for installed packages.
00029      *
00030      * \ingroup grpfakerepository
00031      */
00032     class PALUDIS_VISIBLE FakeInstalledRepository :
00033         public FakeRepositoryBase,
00034         public RepositoryDestinationInterface,
00035         public RepositoryProvidesInterface,
00036         private PrivateImplementationPattern<FakeInstalledRepository>
00037     {
00038         private:
00039             PrivateImplementationPattern<FakeInstalledRepository>::ImpPtr & _imp;
00040 
00041         protected:
00042             /* RepositoryDestinationInterface */
00043 
00044             virtual bool is_suitable_destination_for(const PackageID &) const
00045                 PALUDIS_ATTRIBUTE((warn_unused_result));
00046 
00047             virtual bool is_default_destination() const
00048                 PALUDIS_ATTRIBUTE((warn_unused_result));
00049 
00050             virtual bool want_pre_post_phases() const
00051                 PALUDIS_ATTRIBUTE((warn_unused_result));
00052 
00053             virtual void merge(const MergeParams &);
00054 
00055             /* RepositoryProvidesInterface */
00056 
00057             virtual std::tr1::shared_ptr<const ProvidesSequence> provided_packages() const
00058                 PALUDIS_ATTRIBUTE((warn_unused_result));
00059 
00060         public:
00061             ///\name Basic operations
00062             ///\{
00063 
00064             FakeInstalledRepository(const Environment * const, const RepositoryName &, const bool supports_uninstall = true);
00065             ~FakeInstalledRepository();
00066 
00067             ///\}
00068 
00069             virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
00070 
00071             /* Keys */
00072             virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
00073             virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key() const;
00074             virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > installed_root_key() const;
00075 
00076             ///\name RepositoryFactory functions
00077             ///\{
00078 
00079             static RepositoryName repository_factory_name(
00080                     const Environment * const env,
00081                     const std::tr1::function<std::string (const std::string &)> &);
00082 
00083             static std::tr1::shared_ptr<Repository> repository_factory_create(
00084                     Environment * const env,
00085                     const std::tr1::function<std::string (const std::string &)> &);
00086 
00087             static std::tr1::shared_ptr<const RepositoryNameSet> repository_factory_dependencies(
00088                     const Environment * const env,
00089                     const std::tr1::function<std::string (const std::string &)> &);
00090 
00091             ///\}
00092     };
00093 }
00094 
00095 #endif

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