aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/resolver')
-rw-r--r--paludis/resolver/arrow.cc8
-rw-r--r--paludis/resolver/arrow.hh8
-rw-r--r--paludis/resolver/constraint.cc14
-rw-r--r--paludis/resolver/constraint.hh14
-rw-r--r--paludis/resolver/decider.cc53
-rw-r--r--paludis/resolver/destination.cc6
-rw-r--r--paludis/resolver/destination.hh6
-rw-r--r--paludis/resolver/job.cc12
-rw-r--r--paludis/resolver/job_id.cc2
-rw-r--r--paludis/resolver/job_id.hh2
-rw-r--r--paludis/resolver/orderer.cc30
-rw-r--r--paludis/resolver/resolution.cc8
-rw-r--r--paludis/resolver/resolution.hh8
-rw-r--r--paludis/resolver/resolutions.hh10
-rw-r--r--paludis/resolver/resolvent.cc42
-rw-r--r--paludis/resolver/resolvent.hh12
-rw-r--r--paludis/resolver/resolver.cc14
-rw-r--r--paludis/resolver/resolver_TEST_any.cc1
-rw-r--r--paludis/resolver/resolver_functions.hh26
-rw-r--r--paludis/resolver/resolver_lists.cc14
-rw-r--r--paludis/resolver/resolver_lists.hh14
-rw-r--r--paludis/resolver/resolver_test.cc59
-rw-r--r--paludis/resolver/sanitised_dependencies.cc34
-rw-r--r--paludis/resolver/sanitised_dependencies.hh18
-rw-r--r--paludis/resolver/spec_rewriter.cc6
-rw-r--r--paludis/resolver/spec_rewriter.hh4
-rw-r--r--paludis/resolver/unsuitable_candidates.cc6
-rw-r--r--paludis/resolver/unsuitable_candidates.hh6
28 files changed, 220 insertions, 217 deletions
diff --git a/paludis/resolver/arrow.cc b/paludis/resolver/arrow.cc
index 2b726dc..1390c25 100644
--- a/paludis/resolver/arrow.cc
+++ b/paludis/resolver/arrow.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -42,9 +42,9 @@ Arrow::deserialise(Deserialisation & d)
{
Deserialisator v(d, "Arrow");
return make_named_values<Arrow>(
- value_for<n::comes_after>(v.member<JobID>("comes_after")),
- value_for<n::failure_kinds>(v.member<FailureKinds>("failure_kinds")),
- value_for<n::maybe_reason>(v.member<std::tr1::shared_ptr<const Reason> >("maybe_reason"))
+ n::comes_after() = v.member<JobID>("comes_after"),
+ n::failure_kinds() = v.member<FailureKinds>("failure_kinds"),
+ n::maybe_reason() = v.member<std::tr1::shared_ptr<const Reason> >("maybe_reason")
);
}
diff --git a/paludis/resolver/arrow.hh b/paludis/resolver/arrow.hh
index 99d8b70..256ccb1 100644
--- a/paludis/resolver/arrow.hh
+++ b/paludis/resolver/arrow.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -32,9 +32,9 @@ namespace paludis
{
namespace n
{
- struct comes_after;
- struct failure_kinds;
- struct maybe_reason;
+ typedef Name<struct comes_after_name> comes_after;
+ typedef Name<struct failure_kinds_name> failure_kinds;
+ typedef Name<struct maybe_reason_name> maybe_reason;
}
namespace resolver
diff --git a/paludis/resolver/constraint.cc b/paludis/resolver/constraint.cc
index d838ffa..cb47b9f 100644
--- a/paludis/resolver/constraint.cc
+++ b/paludis/resolver/constraint.cc
@@ -187,13 +187,13 @@ Constraint::deserialise(Deserialisation & d)
IDFinder id_finder;
return make_shared_ptr(new Constraint(make_named_values<Constraint>(
- value_for<n::destination_type>(destringify<DestinationType>(v.member<std::string>("destination_type"))),
- value_for<n::nothing_is_fine_too>(v.member<bool>("nothing_is_fine_too")),
- value_for<n::reason>(reason),
- value_for<n::spec>(PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
- reason->accept_returning<std::tr1::shared_ptr<const PackageID> >(id_finder))),
- value_for<n::untaken>(v.member<bool>("untaken")),
- value_for<n::use_existing>(destringify<UseExisting>(v.member<std::string>("use_existing")))
+ n::destination_type() = destringify<DestinationType>(v.member<std::string>("destination_type")),
+ n::nothing_is_fine_too() = v.member<bool>("nothing_is_fine_too"),
+ n::reason() = reason,
+ n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
+ reason->accept_returning<std::tr1::shared_ptr<const PackageID> >(id_finder)),
+ n::untaken() = v.member<bool>("untaken"),
+ n::use_existing() = destringify<UseExisting>(v.member<std::string>("use_existing"))
)));
}
diff --git a/paludis/resolver/constraint.hh b/paludis/resolver/constraint.hh
index c2ffd63..c6b99cf 100644
--- a/paludis/resolver/constraint.hh
+++ b/paludis/resolver/constraint.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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,12 +35,12 @@ namespace paludis
{
namespace n
{
- struct destination_type;
- struct nothing_is_fine_too;
- struct reason;
- struct spec;
- struct untaken;
- struct use_existing;
+ typedef Name<struct destination_type_name> destination_type;
+ typedef Name<struct nothing_is_fine_too_name> nothing_is_fine_too;
+ typedef Name<struct reason_name> reason;
+ typedef Name<struct spec_name> spec;
+ typedef Name<struct untaken_name> untaken;
+ typedef Name<struct use_existing_name> use_existing;
}
namespace resolver
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index 8c682b0..f591dbb 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -39,6 +39,7 @@
#include <paludis/util/wrapped_output_iterator.hh>
#include <paludis/util/enum_iterator.hh>
#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/util/tribool.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <paludis/repository.hh>
@@ -446,8 +447,8 @@ Decider::_make_destination_for(
+ stringify(*decision.origin_id()));
return make_shared_ptr(new Destination(make_named_values<Destination>(
- value_for<n::replacing>(_find_replacing(decision.origin_id(), repo)),
- value_for<n::repository>(repo->name())
+ n::replacing() = _find_replacing(decision.origin_id(), repo),
+ n::repository() = repo->name()
)));
}
@@ -557,9 +558,9 @@ const std::tr1::shared_ptr<Resolution>
Decider::_create_resolution_for_resolvent(const Resolvent & r) const
{
return make_shared_ptr(new Resolution(make_named_values<Resolution>(
- value_for<n::constraints>(_initial_constraints_for(r)),
- value_for<n::decision>(make_null_shared_ptr()),
- value_for<n::resolvent>(r)
+ n::constraints() = _initial_constraints_for(r),
+ n::decision() = make_null_shared_ptr(),
+ n::resolvent() = r
)));
}
@@ -604,12 +605,12 @@ Decider::_make_constraints_from_target(
{
const std::tr1::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
- value_for<n::destination_type>(resolvent.destination_type()),
- value_for<n::nothing_is_fine_too>(false),
- value_for<n::reason>(reason),
- value_for<n::spec>(spec),
- value_for<n::untaken>(false),
- value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(resolvent, *spec.if_package(), reason))
+ n::destination_type() = resolvent.destination_type(),
+ n::nothing_is_fine_too() = false,
+ n::reason() = reason,
+ n::spec() = spec,
+ n::untaken() = false,
+ n::use_existing() = _imp->fns.get_use_existing_fn()(resolvent, *spec.if_package(), reason)
))));
return result;
}
@@ -628,13 +629,13 @@ Decider::_make_constraints_from_dependency(const Resolvent & resolvent, const Sa
{
const std::tr1::shared_ptr<ConstraintSequence> result(new ConstraintSequence);
result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
- value_for<n::destination_type>(resolvent.destination_type()),
- value_for<n::nothing_is_fine_too>(false),
- value_for<n::reason>(reason),
- value_for<n::spec>(*dep.spec().if_package()),
- value_for<n::untaken>(si_untaken == interest),
- value_for<n::use_existing>(_imp->fns.get_use_existing_fn()(
- resolvent, *dep.spec().if_package(), reason))
+ n::destination_type() = resolvent.destination_type(),
+ n::nothing_is_fine_too() = false,
+ n::reason() = reason,
+ n::spec() = *dep.spec().if_package(),
+ n::untaken() = si_untaken == interest,
+ n::use_existing() = _imp->fns.get_use_existing_fn()(
+ resolvent, *dep.spec().if_package(), reason)
))));
return result;
}
@@ -656,12 +657,12 @@ Decider::_make_constraints_from_blocker(
for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
if (destination_types[*t])
result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
- value_for<n::destination_type>(*t),
- value_for<n::nothing_is_fine_too>(true),
- value_for<n::reason>(reason),
- value_for<n::spec>(spec),
- value_for<n::untaken>(false),
- value_for<n::use_existing>(ue_if_possible)
+ n::destination_type() = *t,
+ n::nothing_is_fine_too() = true,
+ n::reason() = reason,
+ n::spec() = spec,
+ n::untaken() = false,
+ n::use_existing() = ue_if_possible
))));
return result;
@@ -1572,8 +1573,8 @@ Decider::_make_unsuitable_candidate(
const bool existing) const
{
return make_named_values<UnsuitableCandidate>(
- value_for<n::package_id>(id),
- value_for<n::unmet_constraints>(_get_unmatching_constraints(resolvent, id, existing))
+ n::package_id() = id,
+ n::unmet_constraints() = _get_unmatching_constraints(resolvent, id, existing)
);
}
diff --git a/paludis/resolver/destination.cc b/paludis/resolver/destination.cc
index 90b6eae..9d47744 100644
--- a/paludis/resolver/destination.cc
+++ b/paludis/resolver/destination.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -41,8 +41,8 @@ Destination::deserialise(Deserialisation & d)
return make_shared_ptr(new Destination(make_named_values<Destination>(
- value_for<n::replacing>(replacing),
- value_for<n::repository>(RepositoryName(v.member<std::string>("repository")))
+ n::replacing() = replacing,
+ n::repository() = RepositoryName(v.member<std::string>("repository"))
)));
}
diff --git a/paludis/resolver/destination.hh b/paludis/resolver/destination.hh
index de41013..131b9f0 100644
--- a/paludis/resolver/destination.hh
+++ b/paludis/resolver/destination.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -31,8 +31,8 @@ namespace paludis
{
namespace n
{
- struct replacing;
- struct repository;
+ typedef Name<struct replacing_name> replacing;
+ typedef Name<struct repository_name> repository;
}
namespace resolver
diff --git a/paludis/resolver/job.cc b/paludis/resolver/job.cc
index ccadc30..e5facec 100644
--- a/paludis/resolver/job.cc
+++ b/paludis/resolver/job.cc
@@ -318,7 +318,7 @@ const JobID
UsableJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("usable:" + stringify(resolution()->resolvent()))
+ n::string_id() = "usable:" + stringify(resolution()->resolvent())
);
}
@@ -398,7 +398,7 @@ const JobID
UsableGroupJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("usable_group:" + join(_imp->ids->begin(), _imp->ids->end(), "+", &stringify_job_id))
+ n::string_id() = "usable_group:" + join(_imp->ids->begin(), _imp->ids->end(), "+", &stringify_job_id)
);
}
@@ -477,7 +477,7 @@ const JobID
FetchJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("fetch:" + stringify(resolution()->resolvent()))
+ n::string_id() = "fetch:" + stringify(resolution()->resolvent())
);
}
@@ -557,7 +557,7 @@ const JobID
SimpleInstallJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("install:" + stringify(resolution()->resolvent()))
+ n::string_id() = "install:" + stringify(resolution()->resolvent())
);
}
@@ -637,7 +637,7 @@ const JobID
UninstallJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("install:" + stringify(resolution()->resolvent()))
+ n::string_id() = "install:" + stringify(resolution()->resolvent())
);
}
@@ -710,7 +710,7 @@ const JobID
ErrorJob::id() const
{
return make_named_values<JobID>(
- value_for<n::string_id>("error:" + stringify(resolution()->resolvent()))
+ n::string_id() = "error:" + stringify(resolution()->resolvent())
);
}
diff --git a/paludis/resolver/job_id.cc b/paludis/resolver/job_id.cc
index a8d5774..718854c 100644
--- a/paludis/resolver/job_id.cc
+++ b/paludis/resolver/job_id.cc
@@ -58,7 +58,7 @@ JobID::deserialise(Deserialisation & d)
{
Deserialisator v(d, "JobID");
return make_named_values<JobID>(
- value_for<n::string_id>(v.member<std::string>("string_id"))
+ n::string_id() = v.member<std::string>("string_id")
);
}
diff --git a/paludis/resolver/job_id.hh b/paludis/resolver/job_id.hh
index fc63947..919d479 100644
--- a/paludis/resolver/job_id.hh
+++ b/paludis/resolver/job_id.hh
@@ -29,7 +29,7 @@ namespace paludis
{
namespace n
{
- struct string_id;
+ typedef Name<struct string_id_name> string_id;
}
namespace resolver
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 999b85e..4af4da9 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -200,16 +200,16 @@ namespace
/* we can't install until we've fetched */
install_job->arrows()->push_back(make_named_values<Arrow>(
- value_for<n::comes_after>(fetch_job->id()),
- value_for<n::failure_kinds>(FailureKinds()),
- value_for<n::maybe_reason>(make_null_shared_ptr())
+ n::comes_after() = fetch_job->id(),
+ n::failure_kinds() = FailureKinds(),
+ n::maybe_reason() = make_null_shared_ptr()
));
/* we aren't usable until we've been installed */
usable_job->arrows()->push_back(make_named_values<Arrow>(
- value_for<n::comes_after>(install_job->id()),
- value_for<n::failure_kinds>(FailureKinds()),
- value_for<n::maybe_reason>(make_null_shared_ptr())
+ n::comes_after() = install_job->id(),
+ n::failure_kinds() = FailureKinds(),
+ n::maybe_reason() = make_null_shared_ptr()
));
/* do we need confirmation of this? */
@@ -430,9 +430,9 @@ namespace
* blocker is currently met */
jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
- value_for<n::comes_after>(our_identifier),
- value_for<n::failure_kinds>(failure_kinds),
- value_for<n::maybe_reason>(reason)
+ n::comes_after() = our_identifier,
+ n::failure_kinds() = failure_kinds,
+ n::maybe_reason() = reason
));
}
}
@@ -462,9 +462,9 @@ namespace
if (is_usable)
jobs->fetch(jobs->find_id_for_installed(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
- value_for<n::comes_after>(our_identifier),
- value_for<n::failure_kinds>(failure_kinds),
- value_for<n::maybe_reason>(reason)
+ n::comes_after() = our_identifier,
+ n::failure_kinds() = failure_kinds,
+ n::maybe_reason() = reason
));
}
@@ -474,9 +474,9 @@ namespace
if (is_usable)
jobs->fetch(jobs->find_id_for_usable(r.from_resolvent()))->arrows()->push_back(
make_named_values<Arrow>(
- value_for<n::comes_after>(our_identifier),
- value_for<n::failure_kinds>(failure_kinds),
- value_for<n::maybe_reason>(reason)
+ n::comes_after() = our_identifier,
+ n::failure_kinds() = failure_kinds,
+ n::maybe_reason() = reason
));
}
}
diff --git a/paludis/resolver/resolution.cc b/paludis/resolver/resolution.cc
index 22afd05..6287c6b 100644
--- a/paludis/resolver/resolution.cc
+++ b/paludis/resolver/resolution.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -49,9 +49,9 @@ Resolution::deserialise(Deserialisation & d)
Deserialisator v(d, "Resolution");
return make_shared_ptr(new Resolution(make_named_values<Resolution>(
- value_for<n::constraints>(v.member<std::tr1::shared_ptr<Constraints> >("constraints")),
- value_for<n::decision>(v.member<std::tr1::shared_ptr<Decision> >("decision")),
- value_for<n::resolvent>(v.member<Resolvent>("resolvent"))
+ n::constraints() = v.member<std::tr1::shared_ptr<Constraints> >("constraints"),
+ n::decision() = v.member<std::tr1::shared_ptr<Decision> >("decision"),
+ n::resolvent() = v.member<Resolvent>("resolvent")
)));
}
diff --git a/paludis/resolver/resolution.hh b/paludis/resolver/resolution.hh
index 9ca9b69..82e2777 100644
--- a/paludis/resolver/resolution.hh
+++ b/paludis/resolver/resolution.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -31,9 +31,9 @@ namespace paludis
{
namespace n
{
- struct constraints;
- struct decision;
- struct resolvent;
+ typedef Name<struct constraints_name> constraints;
+ typedef Name<struct decision_name> decision;
+ typedef Name<struct resolvent_name> resolvent;
}
namespace resolver
diff --git a/paludis/resolver/resolutions.hh b/paludis/resolver/resolutions.hh
index 37f5f91..119557c 100644
--- a/paludis/resolver/resolutions.hh
+++ b/paludis/resolver/resolutions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -32,10 +32,10 @@ namespace paludis
{
namespace n
{
- struct all;
- struct errors;
- struct ordered;
- struct untaken;
+ typedef Name<struct all_name> all;
+ typedef Name<struct errors_name> errors;
+ typedef Name<struct ordered_name> ordered;
+ typedef Name<struct untaken_name> untaken;
}
namespace resolver
diff --git a/paludis/resolver/resolvent.cc b/paludis/resolver/resolvent.cc
index 166ffe6..1190e0a 100644
--- a/paludis/resolver/resolvent.cc
+++ b/paludis/resolver/resolvent.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -109,11 +109,11 @@ Resolvent::Resolvent(
const PackageDepSpec & spec,
const SlotName & s,
const DestinationType t) :
- destination_type(value_for<n::destination_type>(t)),
- package(value_for<n::package>(*spec.package_ptr())),
+ destination_type(n::destination_type() = t),
+ package(n::package() = *spec.package_ptr()),
slot(make_named_values<SlotNameOrNull>(
- value_for<n::name_or_null>(make_shared_ptr(new SlotName(s))),
- value_for<n::null_means_unknown>(false)
+ n::name_or_null() = make_shared_ptr(new SlotName(s)),
+ n::null_means_unknown() = false
))
{
}
@@ -122,11 +122,11 @@ Resolvent::Resolvent(
const PackageDepSpec & spec,
const bool b,
const DestinationType t) :
- destination_type(value_for<n::destination_type>(t)),
- package(value_for<n::package>(*spec.package_ptr())),
+ destination_type(n::destination_type() = t),
+ package(n::package() = *spec.package_ptr()),
slot(make_named_values<SlotNameOrNull>(
- value_for<n::name_or_null>(make_null_shared_ptr()),
- value_for<n::null_means_unknown>(b)
+ n::name_or_null() = make_null_shared_ptr(),
+ n::null_means_unknown() = b
))
{
}
@@ -135,11 +135,11 @@ Resolvent::Resolvent(
const QualifiedPackageName & n,
const SlotName & s,
const DestinationType t) :
- destination_type(value_for<n::destination_type>(t)),
- package(value_for<n::package>(n)),
+ destination_type(n::destination_type() = t),
+ package(n::package() = n),
slot(make_named_values<SlotNameOrNull>(
- value_for<n::name_or_null>(make_shared_ptr(new SlotName(s))),
- value_for<n::null_means_unknown>(false)
+ n::name_or_null() = make_shared_ptr(new SlotName(s)),
+ n::null_means_unknown() = false
))
{
}
@@ -148,8 +148,8 @@ Resolvent::Resolvent(
const QualifiedPackageName & n,
const SlotNameOrNull & s,
const DestinationType t) :
- destination_type(value_for<n::destination_type>(t)),
- package(value_for<n::package>(n)),
+ destination_type(n::destination_type() = t),
+ package(n::package() = n),
slot(s)
{
}
@@ -157,13 +157,13 @@ Resolvent::Resolvent(
Resolvent::Resolvent(
const std::tr1::shared_ptr<const PackageID> & id,
const DestinationType t) :
- destination_type(value_for<n::destination_type>(t)),
+ destination_type(n::destination_type() = t),
package(id->name()),
slot(make_named_values<SlotNameOrNull>(
- value_for<n::name_or_null>(id->slot_key() ?
+ n::name_or_null() = id->slot_key() ?
make_shared_ptr(new SlotName(id->slot_key()->value())) :
- make_null_shared_ptr()),
- value_for<n::null_means_unknown>(false)
+ make_null_shared_ptr(),
+ n::null_means_unknown() = false
))
{
}
@@ -247,8 +247,8 @@ SlotNameOrNull::deserialise(Deserialisation & d)
std::string s(v.member<std::string>("name_or_null"));
return make_named_values<SlotNameOrNull>(
- value_for<n::name_or_null>(s.empty() ? make_null_shared_ptr() : make_shared_ptr(new SlotName(s))),
- value_for<n::null_means_unknown>(v.member<bool>("null_means_unknown"))
+ n::name_or_null() = s.empty() ? make_null_shared_ptr() : make_shared_ptr(new SlotName(s)),
+ n::null_means_unknown() = v.member<bool>("null_means_unknown")
);
}
diff --git a/paludis/resolver/resolvent.hh b/paludis/resolver/resolvent.hh
index 4648e91..fc9e9c4 100644
--- a/paludis/resolver/resolvent.hh
+++ b/paludis/resolver/resolvent.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -33,11 +33,11 @@ namespace paludis
{
namespace n
{
- struct destination_type;
- struct name_or_null;
- struct null_means_unknown;
- struct package;
- struct slot;
+ typedef Name<struct destination_type_name> destination_type;
+ typedef Name<struct name_or_null_name> name_or_null;
+ typedef Name<struct null_means_unknown_name> null_means_unknown;
+ typedef Name<struct package_name> package;
+ typedef Name<struct slot_name> slot;
}
namespace resolver
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 9de4f1e..65cbad9 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -63,13 +63,13 @@ namespace paludis
env(e),
fns(f),
lists(new ResolverLists(make_named_values<ResolverLists>(
- value_for<n::all_resolutions>(make_shared_ptr(new Resolutions)),
- value_for<n::job_ids_needing_confirmation>(make_shared_ptr(new JobIDSequence)),
- value_for<n::jobs>(make_shared_ptr(new Jobs)),
- value_for<n::taken_error_job_ids>(make_shared_ptr(new JobIDSequence)),
- value_for<n::taken_job_ids>(make_shared_ptr(new JobIDSequence)),
- value_for<n::untaken_error_job_ids>(make_shared_ptr(new JobIDSequence)),
- value_for<n::untaken_job_ids>(make_shared_ptr(new JobIDSequence))
+ n::all_resolutions() = make_shared_ptr(new Resolutions),
+ n::job_ids_needing_confirmation() = make_shared_ptr(new JobIDSequence),
+ n::jobs() = make_shared_ptr(new Jobs),
+ n::taken_error_job_ids() = make_shared_ptr(new JobIDSequence),
+ n::taken_job_ids() = make_shared_ptr(new JobIDSequence),
+ n::untaken_error_job_ids() = make_shared_ptr(new JobIDSequence),
+ n::untaken_job_ids() = make_shared_ptr(new JobIDSequence)
))),
decider(new Decider(e, f, lists)),
orderer(new Orderer(e, f, decider, lists))
diff --git a/paludis/resolver/resolver_TEST_any.cc b/paludis/resolver/resolver_TEST_any.cc
index a300ae2..e0c5f31 100644
--- a/paludis/resolver/resolver_TEST_any.cc
+++ b/paludis/resolver/resolver_TEST_any.cc
@@ -36,6 +36,7 @@
#include <paludis/util/map-impl.hh>
#include <paludis/util/indirect_iterator-impl.hh>
#include <paludis/util/accept_visitor.hh>
+#include <paludis/util/tribool.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/repository_factory.hh>
#include <paludis/package_database.hh>
diff --git a/paludis/resolver/resolver_functions.hh b/paludis/resolver/resolver_functions.hh
index a9442dc..08c8661 100644
--- a/paludis/resolver/resolver_functions.hh
+++ b/paludis/resolver/resolver_functions.hh
@@ -45,19 +45,19 @@ namespace paludis
{
namespace n
{
- struct allowed_to_break_fn;
- struct allowed_to_remove_fn;
- struct confirm_fn;
- struct find_repository_for_fn;
- struct get_constraints_for_dependent_fn;
- struct get_destination_types_for_fn;
- struct get_initial_constraints_for_fn;
- struct get_resolvents_for_fn;
- struct get_use_existing_fn;
- struct interest_in_spec_fn;
- struct make_destination_filtered_generator_fn;
- struct prefer_or_avoid_fn;
- struct remove_if_dependent_fn;
+ typedef Name<struct allowed_to_break_fn_name> allowed_to_break_fn;
+ typedef Name<struct allowed_to_remove_fn_name> allowed_to_remove_fn;
+ typedef Name<struct confirm_fn_name> confirm_fn;
+ typedef Name<struct find_repository_for_fn_name> find_repository_for_fn;
+ typedef Name<struct get_constraints_for_dependent_fn_name> get_constraints_for_dependent_fn;
+ typedef Name<struct get_destination_types_for_fn_name> get_destination_types_for_fn;
+ typedef Name<struct get_initial_constraints_for_fn_name> get_initial_constraints_for_fn;
+ typedef Name<struct get_resolvents_for_fn_name> get_resolvents_for_fn;
+ typedef Name<struct get_use_existing_fn_name> get_use_existing_fn;
+ typedef Name<struct interest_in_spec_fn_name> interest_in_spec_fn;
+ typedef Name<struct make_destination_filtered_generator_fn_name> make_destination_filtered_generator_fn;
+ typedef Name<struct prefer_or_avoid_fn_name> prefer_or_avoid_fn;
+ typedef Name<struct remove_if_dependent_fn_name> remove_if_dependent_fn;
}
namespace resolver
diff --git a/paludis/resolver/resolver_lists.cc b/paludis/resolver/resolver_lists.cc
index c2bbdbd..e5752b3 100644
--- a/paludis/resolver/resolver_lists.cc
+++ b/paludis/resolver/resolver_lists.cc
@@ -84,13 +84,13 @@ ResolverLists::deserialise(Deserialisation & d)
}
return make_named_values<ResolverLists>(
- value_for<n::all_resolutions>(v.member<std::tr1::shared_ptr<Resolutions> >("all_resolutions")),
- value_for<n::job_ids_needing_confirmation>(job_ids_needing_confirmation),
- value_for<n::jobs>(v.member<std::tr1::shared_ptr<Jobs> >("jobs")),
- value_for<n::taken_error_job_ids>(taken_error_job_ids),
- value_for<n::taken_job_ids>(taken_job_ids),
- value_for<n::untaken_error_job_ids>(untaken_error_job_ids),
- value_for<n::untaken_job_ids>(untaken_job_ids)
+ n::all_resolutions() = v.member<std::tr1::shared_ptr<Resolutions> >("all_resolutions"),
+ n::job_ids_needing_confirmation() = job_ids_needing_confirmation,
+ n::jobs() = v.member<std::tr1::shared_ptr<Jobs> >("jobs"),
+ n::taken_error_job_ids() = taken_error_job_ids,
+ n::taken_job_ids() = taken_job_ids,
+ n::untaken_error_job_ids() = untaken_error_job_ids,
+ n::untaken_job_ids() = untaken_job_ids
);
}
diff --git a/paludis/resolver/resolver_lists.hh b/paludis/resolver/resolver_lists.hh
index a69769e..75b913e 100644
--- a/paludis/resolver/resolver_lists.hh
+++ b/paludis/resolver/resolver_lists.hh
@@ -32,13 +32,13 @@ namespace paludis
{
namespace n
{
- struct all_resolutions;
- struct job_ids_needing_confirmation;
- struct jobs;
- struct taken_error_job_ids;
- struct taken_job_ids;
- struct untaken_error_job_ids;
- struct untaken_job_ids;
+ typedef Name<struct all_resolutions_name> all_resolutions;
+ typedef Name<struct job_ids_needing_confirmation_name> job_ids_needing_confirmation;
+ typedef Name<struct jobs_name> jobs;
+ typedef Name<struct taken_error_job_ids_name> taken_error_job_ids;
+ typedef Name<struct taken_job_ids_name> taken_job_ids;
+ typedef Name<struct untaken_error_job_ids_name> untaken_error_job_ids;
+ typedef Name<struct untaken_job_ids_name> untaken_job_ids;
}
namespace resolver
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index c86b3f9..b12b251 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -40,6 +40,7 @@
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/set-impl.hh>
+#include <paludis/util/tribool.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repository_factory.hh>
#include <paludis/package_database.hh>
@@ -309,12 +310,12 @@ paludis::resolver::resolver_test::get_constraints_for_dependent_fn(
const std::tr1::shared_ptr<DependentReason> reason(new DependentReason(*i));
result->push_back(make_shared_ptr(new Constraint(make_named_values<Constraint>(
- value_for<n::destination_type>(dt_install_to_slash),
- value_for<n::nothing_is_fine_too>(true),
- value_for<n::reason>(reason),
- value_for<n::spec>(BlockDepSpec("!" + stringify(spec), spec, false)),
- value_for<n::untaken>(false),
- value_for<n::use_existing>(ue_if_possible)
+ n::destination_type() = dt_install_to_slash,
+ n::nothing_is_fine_too() = true,
+ n::reason() = reason,
+ n::spec() = BlockDepSpec("!" + stringify(spec), spec, false),
+ n::untaken() = false,
+ n::use_existing() = ue_if_possible
))));
}
@@ -356,10 +357,10 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
fake_inst_repo.reset(new FakeInstalledRepository(
make_named_values<FakeInstalledRepositoryParams>(
- value_for<n::environment>(&env),
- value_for<n::name>(RepositoryName("fake-inst")),
- value_for<n::suitable_destination>(true),
- value_for<n::supports_uninstall>(true)
+ n::environment() = &env,
+ n::name() = RepositoryName("fake-inst"),
+ n::suitable_destination() = true,
+ n::supports_uninstall() = true
)));
env.package_database()->add_repository(1, fake_inst_repo);
@@ -373,27 +374,27 @@ ResolverFunctions
ResolverTestCase::get_resolver_functions(InitialConstraints & initial_constraints)
{
return make_named_values<ResolverFunctions>(
- value_for<n::allowed_to_break_fn>(std::tr1::bind(&allowed_to_break_fn,
- allowed_to_break_names, std::tr1::placeholders::_1)),
- value_for<n::allowed_to_remove_fn>(std::tr1::bind(&allowed_to_remove_fn,
- allowed_to_remove_names, std::tr1::placeholders::_1)),
- value_for<n::confirm_fn>(&confirm_fn),
- value_for<n::find_repository_for_fn>(std::tr1::bind(&find_repository_for_fn,
+ n::allowed_to_break_fn() = std::tr1::bind(&allowed_to_break_fn,
+ allowed_to_break_names, std::tr1::placeholders::_1),
+ n::allowed_to_remove_fn() = std::tr1::bind(&allowed_to_remove_fn,
+ allowed_to_remove_names, std::tr1::placeholders::_1),
+ n::confirm_fn() = &confirm_fn,
+ n::find_repository_for_fn() = std::tr1::bind(&find_repository_for_fn,
&env, std::tr1::placeholders::_1, std::tr1::placeholders::_2,
- std::tr1::placeholders::_3)),
- value_for<n::get_constraints_for_dependent_fn>(&get_constraints_for_dependent_fn),
- value_for<n::get_destination_types_for_fn>(&get_destination_types_for_fn),
- value_for<n::get_initial_constraints_for_fn>(
+ std::tr1::placeholders::_3),
+ n::get_constraints_for_dependent_fn() = &get_constraints_for_dependent_fn,
+ n::get_destination_types_for_fn() = &get_destination_types_for_fn,
+ n::get_initial_constraints_for_fn() =
std::tr1::bind(&initial_constraints_for_fn, std::tr1::ref(initial_constraints),
- std::tr1::placeholders::_1)),
- value_for<n::get_resolvents_for_fn>(&get_resolvents_for_fn),
- value_for<n::get_use_existing_fn>(&get_use_existing_fn),
- value_for<n::interest_in_spec_fn>(&interest_in_spec_fn),
- value_for<n::make_destination_filtered_generator_fn>(&make_destination_filtered_generator_fn),
- value_for<n::prefer_or_avoid_fn>(std::tr1::bind(&prefer_or_avoid_fn,
- prefer_or_avoid_names, std::tr1::placeholders::_1)),
- value_for<n::remove_if_dependent_fn>(std::tr1::bind(&remove_if_dependent_fn,
- remove_if_dependent_names, std::tr1::placeholders::_1))
+ std::tr1::placeholders::_1),
+ n::get_resolvents_for_fn() = &get_resolvents_for_fn,
+ n::get_use_existing_fn() = &get_use_existing_fn,
+ n::interest_in_spec_fn() = &interest_in_spec_fn,
+ n::make_destination_filtered_generator_fn() = &make_destination_filtered_generator_fn,
+ n::prefer_or_avoid_fn() = std::tr1::bind(&prefer_or_avoid_fn,
+ prefer_or_avoid_names, std::tr1::placeholders::_1),
+ n::remove_if_dependent_fn() = std::tr1::bind(&remove_if_dependent_fn,
+ remove_if_dependent_names, std::tr1::placeholders::_1)
);
}
diff --git a/paludis/resolver/sanitised_dependencies.cc b/paludis/resolver/sanitised_dependencies.cc
index 80d01be..c46a2a3 100644
--- a/paludis/resolver/sanitised_dependencies.cc
+++ b/paludis/resolver/sanitised_dependencies.cc
@@ -340,12 +340,12 @@ namespace
adl << (adl.str().empty() ? "" : ", ") << stringify(**i);
return make_named_values<SanitisedDependency>(
- value_for<n::active_dependency_labels>(*labels_stack.begin()),
- value_for<n::active_dependency_labels_as_string>(adl.str()),
- value_for<n::metadata_key_human_name>(human_name),
- value_for<n::metadata_key_raw_name>(raw_name),
- value_for<n::original_specs_as_string>(original_specs_as_string),
- value_for<n::spec>(spec)
+ n::active_dependency_labels() = *labels_stack.begin(),
+ n::active_dependency_labels_as_string() = adl.str(),
+ n::metadata_key_human_name() = human_name,
+ n::metadata_key_raw_name() = raw_name,
+ n::original_specs_as_string() = original_specs_as_string,
+ n::spec() = spec
);
}
@@ -498,14 +498,14 @@ paludis::resolver::operator<< (std::ostream & s, const PackageOrBlockDepSpec & d
}
PackageOrBlockDepSpec::PackageOrBlockDepSpec(const BlockDepSpec & s) :
- if_block(value_for<n::if_block>(make_shared_ptr(new BlockDepSpec(s)))),
- if_package(value_for<n::if_package>(make_null_shared_ptr()))
+ if_block(n::if_block() = make_shared_ptr(new BlockDepSpec(s))),
+ if_package(n::if_package() = make_null_shared_ptr())
{
}
PackageOrBlockDepSpec::PackageOrBlockDepSpec(const PackageDepSpec & s) :
- if_block(value_for<n::if_block>(make_null_shared_ptr())),
- if_package(value_for<n::if_package>(make_shared_ptr(new PackageDepSpec(s))))
+ if_block(n::if_block() = make_null_shared_ptr()),
+ if_package(n::if_package() = make_shared_ptr(new PackageDepSpec(s)))
{
}
@@ -630,13 +630,13 @@ SanitisedDependency::deserialise(Deserialisation & d, const std::tr1::shared_ptr
Deserialisator v(d, "SanitisedDependency");
return make_named_values<SanitisedDependency>(
- value_for<n::active_dependency_labels>(make_null_shared_ptr()),
- value_for<n::active_dependency_labels_as_string>(v.member<std::string>("active_dependency_labels_as_string")),
- value_for<n::metadata_key_human_name>(v.member<std::string>("metadata_key_human_name")),
- value_for<n::metadata_key_raw_name>(v.member<std::string>("metadata_key_raw_name")),
- value_for<n::original_specs_as_string>(v.member<std::string>("original_specs_as_string")),
- value_for<n::spec>(PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
- from_id))
+ n::active_dependency_labels() = make_null_shared_ptr(),
+ n::active_dependency_labels_as_string() = v.member<std::string>("active_dependency_labels_as_string"),
+ n::metadata_key_human_name() = v.member<std::string>("metadata_key_human_name"),
+ n::metadata_key_raw_name() = v.member<std::string>("metadata_key_raw_name"),
+ n::original_specs_as_string() = v.member<std::string>("original_specs_as_string"),
+ n::spec() = PackageOrBlockDepSpec::deserialise(*v.find_remove_member("spec"),
+ from_id)
);
}
diff --git a/paludis/resolver/sanitised_dependencies.hh b/paludis/resolver/sanitised_dependencies.hh
index 830b607..5f09815 100644
--- a/paludis/resolver/sanitised_dependencies.hh
+++ b/paludis/resolver/sanitised_dependencies.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -34,14 +34,14 @@ namespace paludis
{
namespace n
{
- struct active_dependency_labels;
- struct active_dependency_labels_as_string;
- struct if_package;
- struct if_block;
- struct metadata_key_human_name;
- struct metadata_key_raw_name;
- struct original_specs_as_string;
- struct spec;
+ typedef Name<struct active_dependency_labels_name> active_dependency_labels;
+ typedef Name<struct active_dependency_labels_as_string_name> active_dependency_labels_as_string;
+ typedef Name<struct if_package_name> if_package;
+ typedef Name<struct if_block_name> if_block;
+ typedef Name<struct metadata_key_human_name_name> metadata_key_human_name;
+ typedef Name<struct metadata_key_raw_name_name> metadata_key_raw_name;
+ typedef Name<struct original_specs_as_string_name> original_specs_as_string;
+ typedef Name<struct spec_name> spec;
}
namespace resolver
diff --git a/paludis/resolver/spec_rewriter.cc b/paludis/resolver/spec_rewriter.cc
index 775c5c7..56be505 100644
--- a/paludis/resolver/spec_rewriter.cc
+++ b/paludis/resolver/spec_rewriter.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -110,7 +110,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::tr1
return make_null_shared_ptr();
const std::tr1::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
- value_for<n::specs>(make_shared_ptr(new Sequence<PackageOrBlockDepSpec>))
+ n::specs() = make_shared_ptr(new Sequence<PackageOrBlockDepSpec>)
)));
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
@@ -130,7 +130,7 @@ SpecRewriter::rewrite_if_special(const PackageOrBlockDepSpec & s, const std::tr1
return make_null_shared_ptr();
const std::tr1::shared_ptr<RewrittenSpec> result(new RewrittenSpec(make_named_values<RewrittenSpec>(
- value_for<n::specs>(make_shared_ptr(new Sequence<PackageOrBlockDepSpec>))
+ n::specs() = make_shared_ptr(new Sequence<PackageOrBlockDepSpec>)
)));
for (std::set<QualifiedPackageName>::const_iterator n(r->second.begin()), n_end(r->second.end()) ;
diff --git a/paludis/resolver/spec_rewriter.hh b/paludis/resolver/spec_rewriter.hh
index 7f5fdab..49ef77f 100644
--- a/paludis/resolver/spec_rewriter.hh
+++ b/paludis/resolver/spec_rewriter.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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,7 +35,7 @@ namespace paludis
{
namespace n
{
- struct specs;
+ typedef Name<struct specs_name> specs;
}
namespace resolver
diff --git a/paludis/resolver/unsuitable_candidates.cc b/paludis/resolver/unsuitable_candidates.cc
index b8ed9d3..6dc4b9e 100644
--- a/paludis/resolver/unsuitable_candidates.cc
+++ b/paludis/resolver/unsuitable_candidates.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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,8 +35,8 @@ UnsuitableCandidate::deserialise(Deserialisation & d)
{
Deserialisator v(d, "UnsuitableCandidate");
return make_named_values<UnsuitableCandidate>(
- value_for<n::package_id>(v.member<std::tr1::shared_ptr<const PackageID> >("package_id")),
- value_for<n::unmet_constraints>(v.member<std::tr1::shared_ptr<Constraints> >("unmet_constraints"))
+ n::package_id() = v.member<std::tr1::shared_ptr<const PackageID> >("package_id"),
+ n::unmet_constraints() = v.member<std::tr1::shared_ptr<Constraints> >("unmet_constraints")
);
}
diff --git a/paludis/resolver/unsuitable_candidates.hh b/paludis/resolver/unsuitable_candidates.hh
index 4384506..038ad76 100644
--- a/paludis/resolver/unsuitable_candidates.hh
+++ b/paludis/resolver/unsuitable_candidates.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -30,8 +30,8 @@ namespace paludis
{
namespace n
{
- struct package_id;
- struct unmet_constraints;
+ typedef Name<struct package_id_name> package_id;
+ typedef Name<struct unmet_constraints_name> unmet_constraints;
}
namespace resolver