aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-14 10:02:03 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-14 20:42:42 +0000
commit0d6e4d15661335ae026a3c7ef58db0f0c61e3884 (patch)
tree3cbab0e7a9464961874f17698ca779a5ff891329
parent701cf1a31f7bbef530f08757db32f4d4ca33ddc2 (diff)
downloadpaludis-0d6e4d15661335ae026a3c7ef58db0f0c61e3884.tar.gz
paludis-0d6e4d15661335ae026a3c7ef58db0f0c61e3884.tar.xz
Kill PackageDepSpec::as_*
-rw-r--r--paludis/dep_spec.cc24
-rw-r--r--paludis/dep_spec.hh18
-rw-r--r--paludis/dep_spec_TEST.cc13
-rw-r--r--python/dep_spec.cc35
-rw-r--r--python/dep_spec.hh10
5 files changed, 1 insertions, 99 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 7eed373..9702a1a 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -89,18 +89,6 @@ DepSpec::set_annotations_key(const std::tr1::shared_ptr<const MetadataSectionKey
add_metadata_key(_imp->annotations_key);
}
-const ConditionalDepSpec *
-DepSpec::as_conditional_dep_spec() const
-{
- return 0;
-}
-
-const PackageDepSpec *
-DepSpec::as_package_dep_spec() const
-{
- return 0;
-}
-
AnyDepSpec::AnyDepSpec()
{
}
@@ -222,12 +210,6 @@ ConditionalDepSpec::data() const
return _imp->data;
}
-const ConditionalDepSpec *
-ConditionalDepSpec::as_conditional_dep_spec() const
-{
- return this;
-}
-
std::string
ConditionalDepSpec::_as_string() const
{
@@ -269,12 +251,6 @@ NamedSetDepSpec::need_keys_added() const
{
}
-const PackageDepSpec *
-PackageDepSpec::as_package_dep_spec() const
-{
- return this;
-}
-
BlockDepSpec::BlockDepSpec(const std::string & s, const PackageDepSpec & p, const bool t) :
StringDepSpec(s),
_spec(p),
diff --git a/paludis/dep_spec.hh b/paludis/dep_spec.hh
index b06c50d..1a35dcf 100644
--- a/paludis/dep_spec.hh
+++ b/paludis/dep_spec.hh
@@ -87,20 +87,6 @@ namespace paludis
///\{
/**
- * Return us as a ConditionalDepSpec, or 0 if we are not a
- * ConditionalDepSpec.
- */
- virtual const ConditionalDepSpec * as_conditional_dep_spec() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /**
- * Return us as a PackageDepSpec, or 0 if we are not a
- * ConditionalDepSpec.
- */
- virtual const PackageDepSpec * as_package_dep_spec() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /**
* The annotations_key, if non-zero, contains any annotations.
*/
const std::tr1::shared_ptr<const MetadataSectionKey> annotations_key() const
@@ -195,8 +181,6 @@ namespace paludis
///\}
- virtual const ConditionalDepSpec * as_conditional_dep_spec() const;
-
/**
* Is our condition met?
*
@@ -602,8 +586,6 @@ namespace paludis
* Access to our data.
*/
std::tr1::shared_ptr<const PackageDepSpecData> data() const;
-
- virtual const PackageDepSpec * as_package_dep_spec() const;
};
/**
diff --git a/paludis/dep_spec_TEST.cc b/paludis/dep_spec_TEST.cc
index 1d6b930..091eb00 100644
--- a/paludis/dep_spec_TEST.cc
+++ b/paludis/dep_spec_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -35,17 +35,6 @@ using namespace test;
namespace test_cases
{
- struct DepSpecAsTest : TestCase
- {
- DepSpecAsTest() : TestCase("dep spec as") { }
-
- void run()
- {
- std::tr1::shared_ptr<PackageDepSpec> x(new PackageDepSpec(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())));
- TEST_CHECK(0 == x->as_conditional_dep_spec());
- }
- } test_dep_spec_as;
-
struct FetchableURIDepSpecTest : TestCase
{
FetchableURIDepSpecTest() : TestCase("fetchable uri dep spec") { }
diff --git a/python/dep_spec.cc b/python/dep_spec.cc
index ea6f4f8..dcd92b6 100644
--- a/python/dep_spec.cc
+++ b/python/dep_spec.cc
@@ -54,18 +54,6 @@ PythonDepSpec::~PythonDepSpec()
{
}
-const PythonConditionalDepSpec *
-PythonDepSpec::as_conditional_dep_spec() const
-{
- return 0;
-}
-
-const PythonPackageDepSpec *
-PythonDepSpec::as_package_dep_spec() const
-{
- return 0;
-}
-
namespace paludis
{
template<>
@@ -171,12 +159,6 @@ PythonConditionalDepSpec::PythonConditionalDepSpec(const ConditionalDepSpec & d)
{
}
-const PythonConditionalDepSpec *
-PythonConditionalDepSpec::as_conditional_dep_spec() const
-{
- return this;
-}
-
bool
PythonConditionalDepSpec::condition_met() const
{
@@ -323,12 +305,6 @@ PythonPackageDepSpec::operator std::tr1::shared_ptr<PackageDepSpec>() const
return make_shared_ptr(new PackageDepSpec(*this));
}
-const PythonPackageDepSpec *
-PythonPackageDepSpec::as_package_dep_spec() const
-{
- return this;
-}
-
std::tr1::shared_ptr<const QualifiedPackageName>
PythonPackageDepSpec::package_ptr() const
{
@@ -1099,17 +1075,6 @@ void expose_dep_spec()
"Base class for a dependency spec.",
bp::no_init
)
- .def("as_conditional_dep_spec", &PythonDepSpec::as_conditional_dep_spec,
- bp::return_value_policy<bp::reference_existing_object>(),
- "as_conditional_dep_spec() -> ConditionalDepSpec\n"
- "Return us as a ConditionalDepSpec, or None if we are not a ConditionalDepSpec."
- )
-
- .def("as_package_dep_spec", &PythonDepSpec::as_package_dep_spec,
- bp::return_value_policy<bp::reference_existing_object>(),
- "as_package_dep_spec() -> PackageDepSpec\n"
- "Return us as a PackageDepSpec, or None if we are not a PackageDepSpec."
- )
;
/**
diff --git a/python/dep_spec.hh b/python/dep_spec.hh
index f726a02..c99f047 100644
--- a/python/dep_spec.hh
+++ b/python/dep_spec.hh
@@ -68,12 +68,6 @@ namespace paludis
public:
virtual ~PythonDepSpec();
-
- virtual const PythonConditionalDepSpec * as_conditional_dep_spec() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const PythonPackageDepSpec * as_package_dep_spec() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE PythonCompositeDepSpec :
@@ -125,8 +119,6 @@ namespace paludis
public:
PythonConditionalDepSpec(const ConditionalDepSpec &);
- virtual const PythonConditionalDepSpec * as_conditional_dep_spec() const;
-
bool condition_met() const PALUDIS_ATTRIBUTE((warn_unused_result));
bool condition_meetable() const PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -177,8 +169,6 @@ namespace paludis
void set_tag(const std::tr1::shared_ptr<const DepTag> & s);
std::string py_str() const;
-
- virtual const PythonPackageDepSpec * as_package_dep_spec() const;
};
class PALUDIS_VISIBLE PythonPlainTextDepSpec :