paludis  Version 2.6.0
dep_spec_data.hh
1 /* vim: set sw=4 sts=4 et foldmethod=syntax : */
2 
3 /*
4  * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 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_DEP_SPEC_DATA_HH
21 #define PALUDIS_GUARD_PALUDIS_DEP_SPEC_DATA_HH 1
22 
23 #include <paludis/dep_spec_data-fwd.hh>
25 #include <paludis/util/fs_path-fwd.hh>
26 #include <paludis/changed_choices-fwd.hh>
27 #include <paludis/name-fwd.hh>
30 #include <paludis/slot_requirement-fwd.hh>
31 #include <paludis/additional_package_dep_spec_requirement-fwd.hh>
32 #include <paludis/dep_spec-fwd.hh>
33 #include <paludis/partially_made_package_dep_spec-fwd.hh>
36 #include <string>
37 #include <memory>
38 
39 namespace paludis
40 {
41  /**
42  * Data for a ConditionalDepSpec.
43  *
44  * \since 0.26
45  * \ingroup g_dep_spec
46  */
48  {
49  public:
50  ///\name Basic operations
51  ///\{
52 
53  virtual ~ConditionalDepSpecData();
54 
55  ///\}
56 
57  /**
58  * Fetch ourself as a string.
59  */
60  virtual std::string as_string() const = 0;
61 
62  /**
63  * Fetch the result for condition_met.
64  *
65  * \since 0.58 takes env, package_id
66  */
67  virtual bool condition_met(
68  const Environment * const,
69  const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
70 
71  /**
72  * Fetch the result for condition_would_be_met_when.
73  *
74  * \since 0.58 takes env, package_id
75  */
76  virtual bool condition_would_be_met_when(
77  const Environment * const,
78  const std::shared_ptr<const PackageID> &,
79  const ChangedChoices &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
80 
81  /**
82  * Fetch the result for condition_meetable.
83  *
84  * \since 0.58 takes env, package_id
85  */
86  virtual bool condition_meetable(
87  const Environment * const,
88  const std::shared_ptr<const PackageID> &) const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
89  };
90 
91  /**
92  * Data for a PackageDepSpec.
93  *
94  * \since 0.26
95  * \ingroup g_dep_spec
96  */
98  {
99  public:
100  ///\name Basic operations
101  ///\{
102 
103  virtual ~PackageDepSpecData();
104 
105  ///\}
106 
107  /**
108  * Fetch ourself as a string.
109  */
110  virtual std::string as_string() const = 0;
111 
112  /**
113  * Fetch the package name (may be a zero pointer).
114  */
115  virtual std::shared_ptr<const QualifiedPackageName> package_ptr() const = 0;
116 
117  /**
118  * Fetch the package name part, if wildcarded, or a zero pointer otherwise.
119  */
120  virtual std::shared_ptr<const PackageNamePart> package_name_part_ptr() const = 0;
121 
122  /**
123  * Fetch the category name part, if wildcarded, or a zero pointer otherwise.
124  */
125  virtual std::shared_ptr<const CategoryNamePart> category_name_part_ptr() const = 0;
126 
127  /**
128  * Fetch the version requirements (may be a zero pointer).
129  */
130  virtual std::shared_ptr<const VersionRequirements> version_requirements_ptr() const = 0;
131 
132  /**
133  * Fetch the version requirements mode.
134  */
135  virtual VersionRequirementsMode version_requirements_mode() const = 0;
136 
137  /**
138  * Fetch the slot name (may be a zero pointer).
139  */
140  virtual std::shared_ptr<const SlotRequirement> slot_requirement_ptr() const = 0;
141 
142  /**
143  * Fetch the from-repository requirement (may be a zero pointer).
144  */
145  virtual std::shared_ptr<const RepositoryName> in_repository_ptr() const = 0;
146 
147  /**
148  * Fetch the installable-to-repository requirement (may be a zero pointer).
149  *
150  * \since 0.32
151  */
152  virtual std::shared_ptr<const InstallableToRepository> installable_to_repository_ptr() const = 0;
153 
154  /**
155  * Fetch the from-repository requirement (may be a zero pointer).
156  */
157  virtual std::shared_ptr<const RepositoryName> from_repository_ptr() const = 0;
158 
159  /**
160  * Fetch the installed-at-path requirement (may be a zero pointer).
161  *
162  * \since 0.32
163  */
164  virtual std::shared_ptr<const FSPath> installed_at_path_ptr() const = 0;
165 
166  /**
167  * Fetch the installable-to-path requirement (may be a zero pointer).
168  *
169  * \since 0.32
170  */
171  virtual std::shared_ptr<const InstallableToPath> installable_to_path_ptr() const = 0;
172 
173  /**
174  * Fetch the additional requirements (may be a zero pointer).
175  */
176  virtual std::shared_ptr<const AdditionalPackageDepSpecRequirements> additional_requirements_ptr() const = 0;
177 
178  /**
179  * Fetch options if we're being used to construct a new PartiallyMadePackageDepSpec.
180  *
181  * \since 0.38
182  */
183  virtual const PartiallyMadePackageDepSpecOptions options_for_partially_made_package_dep_spec() const = 0;
184  };
185 }
186 
187 #endif
Definition: about_metadata-fwd.hh:23
Definition: dep_spec_data.hh:97
Definition: changed_choices.hh:35
Definition: dep_spec_data.hh:47
Definition: environment.hh:200
VersionRequirementsMode
Definition: version_requirements-fwd.hh:54
Definition: options-fwd.hh:34
#define PALUDIS_ATTRIBUTE(x)
Definition: attributes.hh:53
#define PALUDIS_VISIBLE
Definition: attributes.hh:59