aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-04 21:30:35 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-12-04 21:30:35 +0000
commitf2476fe77fe49511a4c22544bf2cbccbc5cfd6cb (patch)
treeeb0cc7ea333c4d2185963e642b7cbf56ee4a90d7
parent821693b16c1f997ff5567c1bbf3966244bb835fa (diff)
downloadpaludis-f2476fe77fe49511a4c22544bf2cbccbc5cfd6cb.tar.gz
paludis-f2476fe77fe49511a4c22544bf2cbccbc5cfd6cb.tar.xz
Add ExactlyOneDepSpec
-rw-r--r--paludis/dep_spec-fwd.hh1
-rw-r--r--paludis/dep_spec.cc17
-rw-r--r--paludis/dep_spec.hh24
3 files changed, 42 insertions, 0 deletions
diff --git a/paludis/dep_spec-fwd.hh b/paludis/dep_spec-fwd.hh
index fb96841..f8f152b 100644
--- a/paludis/dep_spec-fwd.hh
+++ b/paludis/dep_spec-fwd.hh
@@ -42,6 +42,7 @@ namespace paludis
class FetchableURIDepSpec;
class SimpleURIDepSpec;
class AllDepSpec;
+ class ExactlyOneDepSpec;
class AnyDepSpec;
class ConditionalDepSpec;
class BlockDepSpec;
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 84a2fb7..6026469 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -125,6 +125,23 @@ AllDepSpec::clone() const
return result;
}
+ExactlyOneDepSpec::ExactlyOneDepSpec()
+{
+}
+
+void
+ExactlyOneDepSpec::need_keys_added() const
+{
+}
+
+std::shared_ptr<DepSpec>
+ExactlyOneDepSpec::clone() const
+{
+ std::shared_ptr<ExactlyOneDepSpec> result(std::make_shared<ExactlyOneDepSpec>());
+ result->set_annotations_key(annotations_key());
+ return result;
+}
+
namespace paludis
{
template <>
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index 0b99291..fc3584c 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -152,6 +152,30 @@ namespace paludis
};
/**
+ * Represents a ^^ ( first second third ) group of requirements.
+ *
+ * \ingroup g_dep_spec
+ * \nosubgrouping
+ * \since 0.56
+ */
+ class PALUDIS_VISIBLE ExactlyOneDepSpec :
+ public DepSpec
+ {
+ protected:
+ virtual void need_keys_added() const;
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ ExactlyOneDepSpec();
+
+ ///\}
+
+ virtual std::shared_ptr<DepSpec> clone() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+
+ /**
* Represents a dependency spec whose children should only be considered
* upon a certain condition (for example, a use dependency block).
*