no_config_environment.hh

00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 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_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH
00021 #define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH 1
00022 
00023 #include <paludis/environment_implementation.hh>
00024 #include <paludis/util/fs_entry.hh>
00025 #include <paludis/util/private_implementation_pattern.hh>
00026 #include <paludis/util/sr.hh>
00027 #include <paludis/util/map-fwd.hh>
00028 
00029 namespace paludis
00030 {
00031     namespace no_config_environment
00032     {
00033 #include <paludis/environments/no_config/no_config_environment-se.hh>
00034 #include <paludis/environments/no_config/no_config_environment-sr.hh>
00035     }
00036 
00037     /**
00038      * An environment that uses a single repository, with no user configuration.
00039      *
00040      * \ingroup grpnoconfigenvironment
00041      * \nosubgrouping
00042      */
00043     class PALUDIS_VISIBLE NoConfigEnvironment :
00044         public EnvironmentImplementation,
00045         private PrivateImplementationPattern<NoConfigEnvironment>,
00046         private InstantiationPolicy<NoConfigEnvironment, instantiation_method::NonCopyableTag>
00047     {
00048         private:
00049             PrivateImplementationPattern<NoConfigEnvironment>::ImpPtr & _imp;
00050 
00051         protected:
00052             virtual std::tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
00053                 PALUDIS_ATTRIBUTE((warn_unused_result));
00054 
00055             virtual std::tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
00056                 PALUDIS_ATTRIBUTE((warn_unused_result));
00057 
00058             virtual void need_keys_added() const;
00059 
00060         public:
00061             ///\name Basic operations
00062             ///\{
00063 
00064             NoConfigEnvironment(const no_config_environment::Params & params);
00065 
00066             virtual ~NoConfigEnvironment();
00067 
00068             ///\}
00069 
00070             ///\name NoConfigEnvironment-specific configuration options
00071             ///\{
00072 
00073             /**
00074              * What is our top level directory for our main repository?
00075              */
00076             FSEntry main_repository_dir() const;
00077 
00078             /**
00079              * Should we accept unstable keywords?
00080              */
00081             void set_accept_unstable(const bool value);
00082 
00083             ///\}
00084 
00085             ///\name NoConfigEnvironment-specific repository information
00086             ///\{
00087 
00088             /**
00089              * Fetch our 'main' repository.
00090              */
00091             std::tr1::shared_ptr<Repository> main_repository();
00092 
00093             /**
00094              * Fetch our 'main' repository.
00095              */
00096             std::tr1::shared_ptr<const Repository> main_repository() const;
00097 
00098             /**
00099              * Fetch our 'master' repository (may be zero).
00100              */
00101             std::tr1::shared_ptr<Repository> master_repository();
00102 
00103             /**
00104              * Fetch our 'master' repository (may be zero).
00105              */
00106             std::tr1::shared_ptr<const Repository> master_repository() const;
00107 
00108             ///\}
00109 
00110             virtual const Tribool want_choice_enabled(
00111                     const std::tr1::shared_ptr<const PackageID> &,
00112                     const std::tr1::shared_ptr<const Choice> &,
00113                     const UnprefixedChoiceName &
00114                     ) const
00115                 PALUDIS_ATTRIBUTE((warn_unused_result));
00116 
00117             virtual std::tr1::shared_ptr<const Set<UnprefixedChoiceName> > known_choice_value_names(
00118                     const std::tr1::shared_ptr<const PackageID> &,
00119                     const std::tr1::shared_ptr<const Choice> &
00120                     ) const
00121                 PALUDIS_ATTRIBUTE((warn_unused_result));
00122 
00123             virtual std::tr1::shared_ptr<PackageDatabase> package_database()
00124                 PALUDIS_ATTRIBUTE((warn_unused_result));
00125 
00126             virtual std::tr1::shared_ptr<const PackageDatabase> package_database() const
00127                 PALUDIS_ATTRIBUTE((warn_unused_result));
00128 
00129             virtual std::string paludis_command() const
00130                 PALUDIS_ATTRIBUTE((warn_unused_result));
00131 
00132             virtual void set_paludis_command(const std::string &);
00133 
00134             virtual bool accept_license(const std::string &, const PackageID &) const
00135                 PALUDIS_ATTRIBUTE((warn_unused_result));
00136 
00137             virtual bool accept_keywords(const std::tr1::shared_ptr<const KeywordNameSet> &, const PackageID &) const
00138                 PALUDIS_ATTRIBUTE((warn_unused_result));
00139 
00140             virtual const std::tr1::shared_ptr<const Mask> mask_for_breakage(const PackageID &) const
00141                 PALUDIS_ATTRIBUTE((warn_unused_result));
00142 
00143             virtual const std::tr1::shared_ptr<const Mask> mask_for_user(const PackageID &) const
00144                 PALUDIS_ATTRIBUTE((warn_unused_result));
00145 
00146             virtual bool unmasked_by_user(const PackageID &) const
00147                 PALUDIS_ATTRIBUTE((warn_unused_result));
00148 
00149             virtual std::tr1::shared_ptr<const FSEntrySequence> hook_dirs() const
00150                 PALUDIS_ATTRIBUTE((warn_unused_result));
00151 
00152             virtual const FSEntry root() const;
00153 
00154             virtual uid_t reduced_uid() const;
00155 
00156             virtual gid_t reduced_gid() const;
00157 
00158             virtual std::tr1::shared_ptr<const MirrorsSequence> mirrors(const std::string &) const
00159                 PALUDIS_ATTRIBUTE((warn_unused_result));
00160 
00161             virtual HookResult perform_hook(const Hook &) const
00162                 PALUDIS_ATTRIBUTE((warn_unused_result));
00163 
00164             virtual void add_to_world(const QualifiedPackageName &) const;
00165 
00166             virtual void add_to_world(const SetName &) const;
00167 
00168             virtual void remove_from_world(const QualifiedPackageName &) const;
00169 
00170             virtual void remove_from_world(const SetName &) const;
00171 
00172             virtual const std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
00173             virtual const std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > config_location_key() const;
00174     };
00175 }
00176 
00177 #endif

Generated on Mon Dec 22 19:43:50 2008 for paludis by  doxygen 1.5.7.1