environment_implementation.hh

Go to the documentation of this file.
00001 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
00002 
00003 /*
00004  * Copyright (c) 2005, 2006, 2007, 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_ENVIRONMENT_IMPLEMENTATION_HH
00021 #define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_IMPLEMENTATION_HH 1
00022 
00023 #include <paludis/environment.hh>
00024 #include <paludis/package_id-fwd.hh>
00025 
00026 /** \file
00027  * Declarations for the Environment class.
00028  *
00029  * \ingroup g_environment
00030  *
00031  * \section Examples
00032  *
00033  * - None at this time. The EnvironmentImplementation class is of no relevance
00034  *   to clients.
00035  */
00036 
00037 namespace paludis
00038 {
00039     /**
00040      * Simplifies implementing the Environment interface.
00041      *
00042      * Most Environment subclasses derive from this class, rather than directly
00043      * from the abstract base. It provides default implementations for many
00044      * methods.
00045      *
00046      * \ingroup g_environment
00047      * \see Environment
00048      */
00049     class PALUDIS_VISIBLE EnvironmentImplementation :
00050         private PrivateImplementationPattern<EnvironmentImplementation>,
00051         public Environment
00052     {
00053         private:
00054             PrivateImplementationPattern<EnvironmentImplementation>::ImpPtr & _imp;
00055 
00056             void _need_sets() const;
00057 
00058         protected:
00059             virtual void populate_sets() const = 0;
00060 
00061             virtual void populate_standard_sets() const;
00062             void set_always_exists(const SetName &) const;
00063 
00064         public:
00065             ///\name Basic operations
00066             ///\{
00067 
00068             EnvironmentImplementation();
00069             virtual ~EnvironmentImplementation() = 0;
00070 
00071             ///\}
00072 
00073             virtual std::tr1::shared_ptr<const FSEntrySequence> bashrc_files() const
00074                 PALUDIS_ATTRIBUTE((warn_unused_result));
00075 
00076             virtual std::tr1::shared_ptr<const FSEntrySequence> syncers_dirs() const
00077                 PALUDIS_ATTRIBUTE((warn_unused_result));
00078 
00079             virtual std::tr1::shared_ptr<const FSEntrySequence> fetchers_dirs() const
00080                 PALUDIS_ATTRIBUTE((warn_unused_result));
00081 
00082             virtual std::tr1::shared_ptr<const DestinationsSet> default_destinations() const
00083                 PALUDIS_ATTRIBUTE((warn_unused_result));
00084 
00085             virtual std::string distribution() const
00086                 PALUDIS_ATTRIBUTE((warn_unused_result));
00087 
00088             virtual bool is_paludis_package(const QualifiedPackageName &) const
00089                 PALUDIS_ATTRIBUTE((warn_unused_result));
00090 
00091             virtual std::tr1::shared_ptr<PackageIDSequence> operator[] (const Selection &) const
00092                 PALUDIS_ATTRIBUTE((warn_unused_result));
00093 
00094             virtual NotifierCallbackID add_notifier_callback(const NotifierCallbackFunction &);
00095 
00096             virtual void remove_notifier_callback(const NotifierCallbackID);
00097 
00098             virtual void trigger_notifier_callback(const NotifierCallbackEvent &) const;
00099 
00100             virtual void add_set(
00101                     const SetName &,
00102                     const SetName &,
00103                     const std::tr1::function<std::tr1::shared_ptr<const SetSpecTree> ()> &,
00104                     const bool combine) const;
00105 
00106             virtual std::tr1::shared_ptr<const SetNameSet> set_names() const
00107                 PALUDIS_ATTRIBUTE((warn_unused_result));
00108 
00109             virtual const std::tr1::shared_ptr<const SetSpecTree> set(const SetName &) const
00110                 PALUDIS_ATTRIBUTE((warn_unused_result));
00111     };
00112 
00113     class PALUDIS_VISIBLE DuplicateSetError :
00114         public Exception
00115     {
00116         public:
00117             DuplicateSetError(const SetName & s) throw ();
00118     };
00119 }
00120 
00121 #endif

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