paludis Version 3.0.2
The one true package mangler
environment_implementation.hh
Go to the documentation of this file.
1/* vim: set sw=4 sts=4 et foldmethod=syntax : */
2
3/*
4 * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
5 *
6 * This file is part of the Paludis package manager. Paludis is free software;
7 * you can redistribute it and/or modify it under the terms of the GNU General
8 * Public License version 2, as published by the Free Software Foundation.
9 *
10 * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
17 * Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENT_IMPLEMENTATION_HH
21#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_IMPLEMENTATION_HH 1
22
25
26/** \file
27 * Declarations for the Environment class.
28 *
29 * \ingroup g_environment
30 *
31 * \section Examples
32 *
33 * - None at this time. The EnvironmentImplementation class is of no relevance
34 * to clients.
35 */
36
37namespace paludis
38{
39 /**
40 * Simplifies implementing the Environment interface.
41 *
42 * Most Environment subclasses derive from this class, rather than directly
43 * from the abstract base. It provides default implementations for many
44 * methods.
45 *
46 * \ingroup g_environment
47 * \see Environment
48 */
49 class PALUDIS_VISIBLE EnvironmentImplementation :
50 public Environment
51 {
52 private:
54
55 void _need_sets() const;
56
57 protected:
58 virtual void populate_sets() const = 0;
59
60 virtual void populate_standard_sets() const;
61 void set_always_exists(const SetName &) const;
62
63 public:
64 ///\name Basic operations
65 ///\{
66
67 EnvironmentImplementation();
68 ~EnvironmentImplementation() override = 0;
69
70 ///\}
71
72 std::shared_ptr<const FSPathSequence> bashrc_files() const
73 override PALUDIS_ATTRIBUTE((warn_unused_result));
74
75 std::shared_ptr<const FSPathSequence> syncers_dirs() const
76 override PALUDIS_ATTRIBUTE((warn_unused_result));
77
78 std::shared_ptr<const FSPathSequence> fetchers_dirs() const
79 override PALUDIS_ATTRIBUTE((warn_unused_result));
80
81 std::string distribution() const
82 override PALUDIS_ATTRIBUTE((warn_unused_result));
83
85 override PALUDIS_ATTRIBUTE((warn_unused_result));
86
87 std::shared_ptr<PackageIDSequence> operator[] (const Selection &) const
88 override PALUDIS_ATTRIBUTE((warn_unused_result));
89
90 NotifierCallbackID add_notifier_callback(const NotifierCallbackFunction &) override;
91
92 void remove_notifier_callback(const NotifierCallbackID) override;
93
95
96 void add_set(
97 const SetName &,
98 const SetName &,
99 const std::function<std::shared_ptr<const SetSpecTree> ()> &,
100 const bool combine) const override;
101
102 std::shared_ptr<const SetNameSet> set_names() const
103 override PALUDIS_ATTRIBUTE((warn_unused_result));
104
105 const std::shared_ptr<const SetSpecTree> set(const SetName &) const
106 override PALUDIS_ATTRIBUTE((warn_unused_result));
107
108 void add_repository(int importance, const std::shared_ptr<Repository> &) override;
109
110 const std::shared_ptr<const Repository> fetch_repository(const RepositoryName &) const
111 override PALUDIS_ATTRIBUTE((warn_unused_result));
112
113 const std::shared_ptr<Repository> fetch_repository(const RepositoryName &)
114 override PALUDIS_ATTRIBUTE((warn_unused_result));
115
117 override PALUDIS_ATTRIBUTE((warn_unused_result));
118
120 const PackageNamePart &, const Filter & = all_filter(), const bool disambiguate = true) const
121 override PALUDIS_ATTRIBUTE((warn_unused_result));
122
124 override PALUDIS_ATTRIBUTE((warn_unused_result));
125
126 RepositoryConstIterator begin_repositories() const
127 override PALUDIS_ATTRIBUTE((warn_unused_result));
128
129 RepositoryConstIterator end_repositories() const
130 override PALUDIS_ATTRIBUTE((warn_unused_result));
131
132 const std::shared_ptr<const Set<std::string> > expand_licence(
133 const std::string &) const override;
134 };
135
136 class PALUDIS_VISIBLE DuplicateSetError :
137 public Exception
138 {
139 public:
140 DuplicateSetError(const SetName & s) noexcept;
141 };
142}
143
144#endif
std::shared_ptr< const FSPathSequence > bashrc_files() const override PALUDIS_ATTRIBUTE((warn_unused_result))
void add_repository(int importance, const std::shared_ptr< Repository > &) override
NotifierCallbackID add_notifier_callback(const NotifierCallbackFunction &) override
std::shared_ptr< const FSPathSequence > fetchers_dirs() const override PALUDIS_ATTRIBUTE((warn_unused_result))
const std::shared_ptr< const Repository > fetch_repository(const RepositoryName &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
std::shared_ptr< const FSPathSequence > syncers_dirs() const override PALUDIS_ATTRIBUTE((warn_unused_result))
std::shared_ptr< const SetNameSet > set_names() const override PALUDIS_ATTRIBUTE((warn_unused_result))
void remove_notifier_callback(const NotifierCallbackID) override
void trigger_notifier_callback(const NotifierCallbackEvent &) const override
const std::shared_ptr< const SetSpecTree > set(const SetName &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
void add_set(const SetName &, const SetName &, const std::function< std::shared_ptr< const SetSpecTree >()> &, const bool combine) const override
QualifiedPackageName fetch_unique_qualified_package_name(const PackageNamePart &, const Filter &=all_filter(), const bool disambiguate=true) const override PALUDIS_ATTRIBUTE((warn_unused_result))
const std::shared_ptr< const Set< std::string > > expand_licence(const std::string &) const override
bool has_repository_named(const RepositoryName &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
bool is_paludis_package(const QualifiedPackageName &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
bool more_important_than(const RepositoryName &, const RepositoryName &) const override PALUDIS_ATTRIBUTE((warn_unused_result))
Definition filter.hh:59
Definition notifier_callback.hh:39
Definition pimp.hh:52
Definition name.hh:112
Definition repository.hh:249
Definition selection.hh:71
Definition set.hh:51
WrappedValue< SetNameTag > SetName
Definition name-fwd.hh:131
WrappedValue< PackageNamePartTag > PackageNamePart
Definition name-fwd.hh:47
WrappedValue< RepositoryNameTag > RepositoryName
Definition name-fwd.hh:105
Sequence< std::shared_ptr< const PackageID > > PackageIDSequence
Definition package_id-fwd.hh:48
#define PALUDIS_ATTRIBUTE(x)
Definition attributes.hh:53
#define PALUDIS_VISIBLE
Definition attributes.hh:59
Definition about_metadata-fwd.hh:24