aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-16 12:59:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-16 12:59:03 +0100
commite02d79752c97694a220ce8015fca574330bb2dc1 (patch)
tree38c0d47d471a66ecbef94254cfaeee9efc33d700
parent61ba7f67627e5803cd12551f02709f1cf59f9cdc (diff)
downloadpaludis-e02d79752c97694a220ce8015fca574330bb2dc1.tar.gz
paludis-e02d79752c97694a220ce8015fca574330bb2dc1.tar.xz
Back to using old names
-rw-r--r--paludis/resolver/Makefile.am24
-rw-r--r--paludis/resolver/decisions-fwd.hh4
-rw-r--r--paludis/resolver/decisions.cc8
-rw-r--r--paludis/resolver/decisions.hh8
-rw-r--r--paludis/resolver/job-fwd.hh36
-rw-r--r--paludis/resolver/job.cc (renamed from paludis/resolver/work_item.cc)114
-rw-r--r--paludis/resolver/job.hh (renamed from paludis/resolver/work_item.hh)68
-rw-r--r--paludis/resolver/job_list-fwd.hh (renamed from paludis/resolver/work_list-fwd.hh)10
-rw-r--r--paludis/resolver/job_list.cc117
-rw-r--r--paludis/resolver/job_list.hh (renamed from paludis/resolver/work_list.hh)44
-rw-r--r--paludis/resolver/job_lists-fwd.hh (renamed from paludis/resolver/work_lists-fwd.hh)6
-rw-r--r--paludis/resolver/job_lists.cc (renamed from paludis/resolver/work_lists.cc)25
-rw-r--r--paludis/resolver/job_lists.hh (renamed from paludis/resolver/work_lists.hh)22
-rw-r--r--paludis/resolver/orderer-fwd.hh (renamed from paludis/resolver/lineariser-fwd.hh)2
-rw-r--r--paludis/resolver/orderer.cc (renamed from paludis/resolver/lineariser.cc)52
-rw-r--r--paludis/resolver/orderer.hh (renamed from paludis/resolver/lineariser.hh)22
-rw-r--r--paludis/resolver/orderer_notes-fwd.hh (renamed from paludis/resolver/lineariser_notes-fwd.hh)6
-rw-r--r--paludis/resolver/orderer_notes.cc (renamed from paludis/resolver/lineariser_notes.cc)14
-rw-r--r--paludis/resolver/orderer_notes.hh (renamed from paludis/resolver/lineariser_notes.hh)10
-rw-r--r--paludis/resolver/resolved.cc12
-rw-r--r--paludis/resolver/resolved.hh8
-rw-r--r--paludis/resolver/resolver.cc24
-rw-r--r--paludis/resolver/work_item-fwd.hh36
-rw-r--r--paludis/resolver/work_list.cc117
-rw-r--r--src/clients/cave/cmd_display_resolution.cc10
-rw-r--r--src/clients/cave/cmd_execute_resolution.cc42
-rw-r--r--src/clients/cave/cmd_execute_resolution.hh4
-rw-r--r--src/clients/cave/resolve_common.cc10
28 files changed, 428 insertions, 427 deletions
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index 5a5f00b..34d556d 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -30,9 +30,12 @@ noinst_HEADERS = \
decisions.hh decisions-fwd.hh \
destination.hh destination-fwd.hh \
destination_types.hh destination_types-fwd.hh destination_types-se.hh \
- lineariser.hh lineariser-fwd.hh \
- lineariser_notes.hh lineariser_notes-fwd.hh \
+ job.hh job-fwd.hh \
+ job_list.hh job_list-fwd.hh \
+ job_lists.hh job_lists-fwd.hh \
nag.hh nag-fwd.hh \
+ orderer.hh orderer-fwd.hh \
+ orderer_notes.hh orderer_notes-fwd.hh \
package_or_block_dep_spec.hh package_or_block_dep_spec-fwd.hh \
reason.hh reason-fwd.hh \
required_confirmations.hh required_confirmations-fwd.hh \
@@ -48,10 +51,7 @@ noinst_HEADERS = \
strongly_connected_component.hh strongly_connected_component-fwd.hh \
suggest_restart.hh suggest_restart-fwd.hh \
unsuitable_candidates.hh unsuitable_candidates-fwd.hh \
- use_existing.hh use_existing-fwd.hh use_existing-se.hh \
- work_item.hh work_item-fwd.hh \
- work_list.hh work_list-fwd.hh \
- work_lists.hh work_lists-fwd.hh
+ use_existing.hh use_existing-fwd.hh use_existing-se.hh
libpaludisresolver_a_SOURCES = \
any_child_score.cc \
@@ -62,9 +62,12 @@ libpaludisresolver_a_SOURCES = \
decisions.cc \
destination.cc \
destination_types.cc \
- lineariser.cc \
- lineariser_notes.cc \
+ job.cc \
+ job_list.cc \
+ job_lists.cc \
nag.cc \
+ orderer.cc \
+ orderer_notes.cc \
package_or_block_dep_spec.cc \
reason.cc \
required_confirmations.cc \
@@ -80,10 +83,7 @@ libpaludisresolver_a_SOURCES = \
strongly_connected_component.cc \
suggest_restart.cc \
unsuitable_candidates.cc \
- use_existing.cc \
- work_item.cc \
- work_list.cc \
- work_lists.cc
+ use_existing.cc
if ENABLE_VIRTUALS_REPOSITORY
virtuals_tests = resolver_TEST_virtuals
diff --git a/paludis/resolver/decisions-fwd.hh b/paludis/resolver/decisions-fwd.hh
index 3268d32..ec52a35 100644
--- a/paludis/resolver/decisions-fwd.hh
+++ b/paludis/resolver/decisions-fwd.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_RESOLVER_DECISIONS_FWD_HH 1
#include <paludis/util/no_type.hh>
-#include <paludis/resolver/lineariser_notes-fwd.hh>
+#include <paludis/resolver/orderer_notes-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
#include <tr1/memory>
@@ -32,7 +32,7 @@ namespace paludis
template <typename Decision_, typename Notes_ = NoType<0u> *>
struct Decisions;
- typedef Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const LineariserNotes> > ChangeOrRemoveDecisionsWithNotes;
+ typedef Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const OrdererNotes> > OrderedChangeOrRemoveDecisions;
}
}
diff --git a/paludis/resolver/decisions.cc b/paludis/resolver/decisions.cc
index 4f005dd..c247ce9 100644
--- a/paludis/resolver/decisions.cc
+++ b/paludis/resolver/decisions.cc
@@ -19,7 +19,7 @@
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/lineariser_notes.hh>
+#include <paludis/resolver/orderer_notes.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/exception.hh>
@@ -196,7 +196,7 @@ Decisions<Decision_, Notes_>::deserialise(Deserialisation & d)
template class Decisions<UnableToMakeDecision>;
template class Decisions<ChangesToMakeDecision>;
template class Decisions<ChangeOrRemoveDecision>;
-template class Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const LineariserNotes> >;
+template class Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const OrdererNotes> >;
template class WrappedForwardIterator<Decisions<UnableToMakeDecision>::ConstIteratorTag,
const std::tr1::shared_ptr<const UnableToMakeDecision> >;
@@ -204,8 +204,8 @@ template class WrappedForwardIterator<Decisions<ChangesToMakeDecision>::ConstIte
const std::tr1::shared_ptr<const ChangesToMakeDecision> >;
template class WrappedForwardIterator<Decisions<ChangeOrRemoveDecision>::ConstIteratorTag,
const std::tr1::shared_ptr<const ChangeOrRemoveDecision> >;
-template class WrappedForwardIterator<Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const LineariserNotes> >::ConstIteratorTag,
+template class WrappedForwardIterator<Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const OrdererNotes> >::ConstIteratorTag,
const std::pair<
std::tr1::shared_ptr<const ChangeOrRemoveDecision>,
- std::tr1::shared_ptr<const LineariserNotes> > >;
+ std::tr1::shared_ptr<const OrdererNotes> > >;
diff --git a/paludis/resolver/decisions.hh b/paludis/resolver/decisions.hh
index a9c7de2..432bcbe 100644
--- a/paludis/resolver/decisions.hh
+++ b/paludis/resolver/decisions.hh
@@ -22,7 +22,7 @@
#include <paludis/resolver/decisions-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
-#include <paludis/resolver/lineariser_notes-fwd.hh>
+#include <paludis/resolver/orderer_notes-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/util/no_type.hh>
@@ -82,7 +82,7 @@ namespace paludis
extern template class Decisions<UnableToMakeDecision>;
extern template class Decisions<ChangesToMakeDecision>;
extern template class Decisions<ChangeOrRemoveDecision>;
- extern template class Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const LineariserNotes> >;
+ extern template class Decisions<ChangeOrRemoveDecision, std::tr1::shared_ptr<const OrdererNotes> >;
#endif
}
@@ -94,10 +94,10 @@ namespace paludis
extern template class WrappedForwardIterator<resolver::Decisions<resolver::ChangeOrRemoveDecision>::ConstIteratorTag,
const std::tr1::shared_ptr<const resolver::ChangeOrRemoveDecision> >;
extern template class WrappedForwardIterator<resolver::Decisions<resolver::ChangeOrRemoveDecision,
- std::tr1::shared_ptr<const resolver::LineariserNotes> >::ConstIteratorTag,
+ std::tr1::shared_ptr<const resolver::OrdererNotes> >::ConstIteratorTag,
const std::pair<
std::tr1::shared_ptr<const resolver::ChangeOrRemoveDecision>,
- std::tr1::shared_ptr<const resolver::LineariserNotes> > >;
+ std::tr1::shared_ptr<const resolver::OrdererNotes> > >;
#endif
}
diff --git a/paludis/resolver/job-fwd.hh b/paludis/resolver/job-fwd.hh
new file mode 100644
index 0000000..0d74f6a
--- /dev/null
+++ b/paludis/resolver/job-fwd.hh
@@ -0,0 +1,36 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_FWD_HH 1
+
+namespace paludis
+{
+ namespace resolver
+ {
+ class PretendJob;
+
+ class ExecuteJob;
+ class FetchJob;
+ class InstallJob;
+ class UninstallJob;
+ }
+}
+
+#endif
diff --git a/paludis/resolver/work_item.cc b/paludis/resolver/job.cc
index 67e20cc..2afe034 100644
--- a/paludis/resolver/work_item.cc
+++ b/paludis/resolver/job.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/resolver/work_item.hh>
+#include <paludis/resolver/job.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
@@ -31,7 +31,7 @@ using namespace paludis::resolver;
namespace paludis
{
template <>
- struct Implementation<PretendWorkItem>
+ struct Implementation<PretendJob>
{
const std::tr1::shared_ptr<const PackageID> origin_id;
@@ -42,51 +42,51 @@ namespace paludis
};
}
-PretendWorkItem::PretendWorkItem(const std::tr1::shared_ptr<const PackageID> & o) :
- PrivateImplementationPattern<PretendWorkItem>(new Implementation<PretendWorkItem>(o))
+PretendJob::PretendJob(const std::tr1::shared_ptr<const PackageID> & o) :
+ PrivateImplementationPattern<PretendJob>(new Implementation<PretendJob>(o))
{
}
-PretendWorkItem::~PretendWorkItem()
+PretendJob::~PretendJob()
{
}
const std::tr1::shared_ptr<const PackageID>
-PretendWorkItem::origin_id() const
+PretendJob::origin_id() const
{
return _imp->origin_id;
}
-const std::tr1::shared_ptr<PretendWorkItem>
-PretendWorkItem::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<PretendJob>
+PretendJob::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "PretendWorkItem");
- return make_shared_ptr(new PretendWorkItem(
+ Deserialisator v(d, "PretendJob");
+ return make_shared_ptr(new PretendJob(
v.member<std::tr1::shared_ptr<const PackageID> >("origin_id")
));
}
void
-PretendWorkItem::serialise(Serialiser & s) const
+PretendJob::serialise(Serialiser & s) const
{
- s.object("PretendWorkItem")
+ s.object("PretendJob")
.member(SerialiserFlags<serialise::might_be_null>(), "origin_id", origin_id())
;
}
-ExecuteWorkItem::~ExecuteWorkItem()
+ExecuteJob::~ExecuteJob()
{
}
-const std::tr1::shared_ptr<ExecuteWorkItem>
-ExecuteWorkItem::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<ExecuteJob>
+ExecuteJob::deserialise(Deserialisation & d)
{
- if (d.class_name() == "FetchWorkItem")
- return FetchWorkItem::deserialise(d);
- else if (d.class_name() == "InstallWorkItem")
- return InstallWorkItem::deserialise(d);
- else if (d.class_name() == "UninstallWorkItem")
- return UninstallWorkItem::deserialise(d);
+ if (d.class_name() == "FetchJob")
+ return FetchJob::deserialise(d);
+ else if (d.class_name() == "InstallJob")
+ return InstallJob::deserialise(d);
+ else if (d.class_name() == "UninstallJob")
+ return UninstallJob::deserialise(d);
else
throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
}
@@ -94,7 +94,7 @@ ExecuteWorkItem::deserialise(Deserialisation & d)
namespace paludis
{
template <>
- struct Implementation<FetchWorkItem>
+ struct Implementation<FetchJob>
{
const std::tr1::shared_ptr<const PackageID> origin_id;
@@ -105,34 +105,34 @@ namespace paludis
};
}
-FetchWorkItem::FetchWorkItem(const std::tr1::shared_ptr<const PackageID> & o) :
- PrivateImplementationPattern<FetchWorkItem>(new Implementation<FetchWorkItem>(o))
+FetchJob::FetchJob(const std::tr1::shared_ptr<const PackageID> & o) :
+ PrivateImplementationPattern<FetchJob>(new Implementation<FetchJob>(o))
{
}
-FetchWorkItem::~FetchWorkItem()
+FetchJob::~FetchJob()
{
}
const std::tr1::shared_ptr<const PackageID>
-FetchWorkItem::origin_id() const
+FetchJob::origin_id() const
{
return _imp->origin_id;
}
-const std::tr1::shared_ptr<FetchWorkItem>
-FetchWorkItem::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<FetchJob>
+FetchJob::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "FetchWorkItem");
- return make_shared_ptr(new FetchWorkItem(
+ Deserialisator v(d, "FetchJob");
+ return make_shared_ptr(new FetchJob(
v.member<std::tr1::shared_ptr<const PackageID> >("origin_id")
));
}
void
-FetchWorkItem::serialise(Serialiser & s) const
+FetchJob::serialise(Serialiser & s) const
{
- s.object("FetchWorkItem")
+ s.object("FetchJob")
.member(SerialiserFlags<serialise::might_be_null>(), "origin_id", origin_id())
;
}
@@ -140,7 +140,7 @@ FetchWorkItem::serialise(Serialiser & s) const
namespace paludis
{
template <>
- struct Implementation<InstallWorkItem>
+ struct Implementation<InstallJob>
{
const std::tr1::shared_ptr<const PackageID> origin_id;
const RepositoryName destination_repository_name;
@@ -162,48 +162,48 @@ namespace paludis
};
}
-InstallWorkItem::InstallWorkItem(
+InstallJob::InstallJob(
const std::tr1::shared_ptr<const PackageID> & o,
const RepositoryName & d,
const DestinationType t,
const std::tr1::shared_ptr<const PackageIDSequence> & r
) :
- PrivateImplementationPattern<InstallWorkItem>(new Implementation<InstallWorkItem>(o, d, t, r))
+ PrivateImplementationPattern<InstallJob>(new Implementation<InstallJob>(o, d, t, r))
{
}
-InstallWorkItem::~InstallWorkItem()
+InstallJob::~InstallJob()
{
}
const std::tr1::shared_ptr<const PackageID>
-InstallWorkItem::origin_id() const
+InstallJob::origin_id() const
{
return _imp->origin_id;
}
const RepositoryName
-InstallWorkItem::destination_repository_name() const
+InstallJob::destination_repository_name() const
{
return _imp->destination_repository_name;
}
DestinationType
-InstallWorkItem::destination_type() const
+InstallJob::destination_type() const
{
return _imp->destination_type;
}
const std::tr1::shared_ptr<const PackageIDSequence>
-InstallWorkItem::replacing() const
+InstallJob::replacing() const
{
return _imp->replacing;
}
-const std::tr1::shared_ptr<InstallWorkItem>
-InstallWorkItem::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<InstallJob>
+InstallJob::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "InstallWorkItem");
+ Deserialisator v(d, "InstallJob");
std::tr1::shared_ptr<PackageIDSequence> replacing(new PackageIDSequence);
{
@@ -212,7 +212,7 @@ InstallWorkItem::deserialise(Deserialisation & d)
replacing->push_back(vv.member<std::tr1::shared_ptr<const PackageID> >(stringify(n)));
}
- return make_shared_ptr(new InstallWorkItem(
+ return make_shared_ptr(new InstallJob(
v.member<std::tr1::shared_ptr<const PackageID> >("origin_id"),
RepositoryName(v.member<std::string>("destination_repository_name")),
destringify<DestinationType>(v.member<std::string>("destination_type")),
@@ -221,9 +221,9 @@ InstallWorkItem::deserialise(Deserialisation & d)
}
void
-InstallWorkItem::serialise(Serialiser & s) const
+InstallJob::serialise(Serialiser & s) const
{
- s.object("InstallWorkItem")
+ s.object("InstallJob")
.member(SerialiserFlags<serialise::might_be_null>(), "origin_id", origin_id())
.member(SerialiserFlags<>(), "destination_repository_name", stringify(destination_repository_name()))
.member(SerialiserFlags<>(), "destination_type", stringify(destination_type()))
@@ -234,7 +234,7 @@ InstallWorkItem::serialise(Serialiser & s) const
namespace paludis
{
template <>
- struct Implementation<UninstallWorkItem>
+ struct Implementation<UninstallJob>
{
const std::tr1::shared_ptr<const PackageIDSequence> ids_to_remove;
@@ -247,27 +247,27 @@ namespace paludis
};
}
-UninstallWorkItem::UninstallWorkItem(
+UninstallJob::UninstallJob(
const std::tr1::shared_ptr<const PackageIDSequence> & r
) :
- PrivateImplementationPattern<UninstallWorkItem>(new Implementation<UninstallWorkItem>(r))
+ PrivateImplementationPattern<UninstallJob>(new Implementation<UninstallJob>(r))
{
}
-UninstallWorkItem::~UninstallWorkItem()
+UninstallJob::~UninstallJob()
{
}
const std::tr1::shared_ptr<const PackageIDSequence>
-UninstallWorkItem::ids_to_remove() const
+UninstallJob::ids_to_remove() const
{
return _imp->ids_to_remove;
}
-const std::tr1::shared_ptr<UninstallWorkItem>
-UninstallWorkItem::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<UninstallJob>
+UninstallJob::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "UninstallWorkItem");
+ Deserialisator v(d, "UninstallJob");
std::tr1::shared_ptr<PackageIDSequence> ids_to_remove(new PackageIDSequence);
{
@@ -276,15 +276,15 @@ UninstallWorkItem::deserialise(Deserialisation & d)
ids_to_remove->push_back(vv.member<std::tr1::shared_ptr<const PackageID> >(stringify(n)));
}
- return make_shared_ptr(new UninstallWorkItem(
+ return make_shared_ptr(new UninstallJob(
ids_to_remove
));
}
void
-UninstallWorkItem::serialise(Serialiser & s) const
+UninstallJob::serialise(Serialiser & s) const
{
- s.object("UninstallWorkItem")
+ s.object("UninstallJob")
.member(SerialiserFlags<serialise::container, serialise::might_be_null>(), "ids_to_remove", ids_to_remove())
;
}
diff --git a/paludis/resolver/work_item.hh b/paludis/resolver/job.hh
index 80bd885..d0fedef 100644
--- a/paludis/resolver/work_item.hh
+++ b/paludis/resolver/job.hh
@@ -17,10 +17,10 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_ITEM_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_ITEM_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_HH 1
-#include <paludis/resolver/work_item-fwd.hh>
+#include <paludis/resolver/job-fwd.hh>
#include <paludis/resolver/destination_types-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/simple_visitor.hh>
@@ -34,85 +34,85 @@ namespace paludis
{
namespace resolver
{
- class PALUDIS_VISIBLE PretendWorkItem :
- private PrivateImplementationPattern<PretendWorkItem>
+ class PALUDIS_VISIBLE PretendJob :
+ private PrivateImplementationPattern<PretendJob>
{
public:
- PretendWorkItem(
+ PretendJob(
const std::tr1::shared_ptr<const PackageID> &
);
- ~PretendWorkItem();
+ ~PretendJob();
const std::tr1::shared_ptr<const PackageID> origin_id() const PALUDIS_ATTRIBUTE((warn_unused_result));
- static const std::tr1::shared_ptr<PretendWorkItem> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<PretendJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
};
- class PALUDIS_VISIBLE ExecuteWorkItem :
- public virtual DeclareAbstractAcceptMethods<ExecuteWorkItem, MakeTypeList<
- FetchWorkItem, InstallWorkItem, UninstallWorkItem>::Type>
+ class PALUDIS_VISIBLE ExecuteJob :
+ public virtual DeclareAbstractAcceptMethods<ExecuteJob, MakeTypeList<
+ FetchJob, InstallJob, UninstallJob>::Type>
{
public:
- virtual ~ExecuteWorkItem();
+ virtual ~ExecuteJob();
- static const std::tr1::shared_ptr<ExecuteWorkItem> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<ExecuteJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void serialise(Serialiser &) const = 0;
};
- class PALUDIS_VISIBLE FetchWorkItem :
- private PrivateImplementationPattern<FetchWorkItem>,
- public ExecuteWorkItem,
- public ImplementAcceptMethods<ExecuteWorkItem, FetchWorkItem>
+ class PALUDIS_VISIBLE FetchJob :
+ private PrivateImplementationPattern<FetchJob>,
+ public ExecuteJob,
+ public ImplementAcceptMethods<ExecuteJob, FetchJob>
{
public:
- FetchWorkItem(
+ FetchJob(
const std::tr1::shared_ptr<const PackageID> &
);
- ~FetchWorkItem();
+ ~FetchJob();
const std::tr1::shared_ptr<const PackageID> origin_id() const PALUDIS_ATTRIBUTE((warn_unused_result));
- static const std::tr1::shared_ptr<FetchWorkItem> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<FetchJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void serialise(Serialiser &) const;
};
- class PALUDIS_VISIBLE InstallWorkItem :
- private PrivateImplementationPattern<InstallWorkItem>,
- public ExecuteWorkItem,
- public ImplementAcceptMethods<ExecuteWorkItem, InstallWorkItem>
+ class PALUDIS_VISIBLE InstallJob :
+ private PrivateImplementationPattern<InstallJob>,
+ public ExecuteJob,
+ public ImplementAcceptMethods<ExecuteJob, InstallJob>
{
public:
- InstallWorkItem(
+ InstallJob(
const std::tr1::shared_ptr<const PackageID> &,
const RepositoryName &,
const DestinationType,
const std::tr1::shared_ptr<const PackageIDSequence> &);
- ~InstallWorkItem();
+ ~InstallJob();
const std::tr1::shared_ptr<const PackageID> origin_id() const PALUDIS_ATTRIBUTE((warn_unused_result));
const RepositoryName destination_repository_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
DestinationType destination_type() const PALUDIS_ATTRIBUTE((warn_unused_result));
const std::tr1::shared_ptr<const PackageIDSequence> replacing() const PALUDIS_ATTRIBUTE((warn_unused_result));
- static const std::tr1::shared_ptr<InstallWorkItem> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<InstallJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void serialise(Serialiser &) const;
};
- class PALUDIS_VISIBLE UninstallWorkItem :
- private PrivateImplementationPattern<UninstallWorkItem>,
- public ExecuteWorkItem,
- public ImplementAcceptMethods<ExecuteWorkItem, UninstallWorkItem>
+ class PALUDIS_VISIBLE UninstallJob :
+ private PrivateImplementationPattern<UninstallJob>,
+ public ExecuteJob,
+ public ImplementAcceptMethods<ExecuteJob, UninstallJob>
{
public:
- UninstallWorkItem(
+ UninstallJob(
const std::tr1::shared_ptr<const PackageIDSequence> &
);
- ~UninstallWorkItem();
+ ~UninstallJob();
const std::tr1::shared_ptr<const PackageIDSequence> ids_to_remove() const PALUDIS_ATTRIBUTE((warn_unused_result));
- static const std::tr1::shared_ptr<UninstallWorkItem> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<UninstallJob> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void serialise(Serialiser &) const;
};
}
diff --git a/paludis/resolver/work_list-fwd.hh b/paludis/resolver/job_list-fwd.hh
index c86896d..f7943f1 100644
--- a/paludis/resolver/work_list-fwd.hh
+++ b/paludis/resolver/job_list-fwd.hh
@@ -17,17 +17,17 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LIST_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LIST_FWD_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LIST_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LIST_FWD_HH 1
namespace paludis
{
namespace resolver
{
- template <typename WorkItem_>
- struct WorkList;
+ template <typename Job_>
+ struct JobList;
- typedef int WorkListIndex;
+ typedef int JobListIndex;
}
}
diff --git a/paludis/resolver/job_list.cc b/paludis/resolver/job_list.cc
new file mode 100644
index 0000000..ec3203f
--- /dev/null
+++ b/paludis/resolver/job_list.cc
@@ -0,0 +1,117 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/resolver/job_list.hh>
+#include <paludis/resolver/job.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
+#include <paludis/serialise-impl.hh>
+#include <vector>
+
+using namespace paludis;
+using namespace paludis::resolver;
+
+namespace paludis
+{
+#ifndef PALUDIS_NO_DOUBLE_TEMPLATE
+ template <>
+#endif
+ template <typename Job_>
+ struct Implementation<JobList<Job_> >
+ {
+ std::vector<std::tr1::shared_ptr<Job_> > list;
+ };
+
+#ifdef PALUDIS_NO_DOUBLE_TEMPLATE
+ template <>
+#endif
+ template <typename Job_>
+ struct WrappedForwardIteratorTraits<JobListConstIteratorTag<Job_> >
+ {
+ typedef typename std::vector<std::tr1::shared_ptr<Job_> >::const_iterator UnderlyingIterator;
+ };
+}
+
+template <typename Job_>
+JobList<Job_>::JobList() :
+ PrivateImplementationPattern<JobList<Job_> >(new Implementation<JobList<Job_> >)
+{
+}
+
+template <typename Job_>
+JobList<Job_>::~JobList()
+{
+}
+
+template <typename Job_>
+JobListIndex
+JobList<Job_>::append(const std::tr1::shared_ptr<Job_> & i)
+{
+ typename std::vector<std::tr1::shared_ptr<Job_> >::const_iterator p(_imp->list.insert(_imp->list.end(), i));
+ return p - _imp->list.begin();
+}
+
+template <typename Job_>
+int
+JobList<Job_>::length() const
+{
+ return _imp->list.size();
+}
+
+template <typename Job_>
+typename JobList<Job_>::ConstIterator
+JobList<Job_>::begin() const
+{
+ return ConstIterator(_imp->list.begin());
+}
+
+template <typename Job_>
+typename JobList<Job_>::ConstIterator
+JobList<Job_>::end() const
+{
+ return ConstIterator(_imp->list.end());
+}
+
+template <typename Job_>
+const std::tr1::shared_ptr<JobList<Job_> >
+JobList<Job_>::deserialise(Deserialisation & d)
+{
+ Deserialisator v(d, "JobList");
+ Deserialisator vv(*v.find_remove_member("items"), "c");
+ std::tr1::shared_ptr<JobList> result(new JobList);
+ for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
+ result->append(vv.member<std::tr1::shared_ptr<Job_> >(stringify(n)));
+ return result;
+}
+
+template <typename Job_>
+void
+JobList<Job_>::serialise(Serialiser & s) const
+{
+ s.object("JobList")
+ .member(SerialiserFlags<serialise::container>(), "items", _imp->list)
+ ;
+}
+
+template class JobList<PretendJob>;
+template class WrappedForwardIterator<JobListConstIteratorTag<PretendJob>, const std::tr1::shared_ptr<PretendJob> >;
+
+template class JobList<ExecuteJob>;
+template class WrappedForwardIterator<JobListConstIteratorTag<ExecuteJob>, const std::tr1::shared_ptr<ExecuteJob> >;
+
diff --git a/paludis/resolver/work_list.hh b/paludis/resolver/job_list.hh
index 22437da..c116d17 100644
--- a/paludis/resolver/work_list.hh
+++ b/paludis/resolver/job_list.hh
@@ -17,11 +17,11 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LIST_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LIST_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LIST_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LIST_HH 1
-#include <paludis/resolver/work_list-fwd.hh>
-#include <paludis/resolver/work_item-fwd.hh>
+#include <paludis/resolver/job_list-fwd.hh>
+#include <paludis/resolver/job-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/wrapped_forward_iterator.hh>
#include <paludis/serialise-fwd.hh>
@@ -31,44 +31,44 @@ namespace paludis
{
namespace resolver
{
- template <typename WorkItem_>
- struct WorkListConstIteratorTag;
+ template <typename Job_>
+ struct JobListConstIteratorTag;
- template <typename WorkItem_>
- class PALUDIS_VISIBLE WorkList :
- private PrivateImplementationPattern<WorkList<WorkItem_> >
+ template <typename Job_>
+ class PALUDIS_VISIBLE JobList :
+ private PrivateImplementationPattern<JobList<Job_> >
{
private:
- using PrivateImplementationPattern<WorkList<WorkItem_> >::_imp;
+ using PrivateImplementationPattern<JobList<Job_> >::_imp;
public:
- WorkList();
- ~WorkList();
+ JobList();
+ ~JobList();
- WorkListIndex append(const std::tr1::shared_ptr<WorkItem_> &);
+ JobListIndex append(const std::tr1::shared_ptr<Job_> &);
int length() const PALUDIS_ATTRIBUTE((warn_unused_result));
- typedef WorkListConstIteratorTag<WorkItem_> ConstIteratorTag;
- typedef WrappedForwardIterator<ConstIteratorTag, const std::tr1::shared_ptr<WorkItem_> > ConstIterator;
+ typedef JobListConstIteratorTag<Job_> ConstIteratorTag;
+ typedef WrappedForwardIterator<ConstIteratorTag, const std::tr1::shared_ptr<Job_> > ConstIterator;
ConstIterator begin() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
- static const std::tr1::shared_ptr<WorkList<WorkItem_> > deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<JobList<Job_> > deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
};
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class WorkList<PretendWorkItem>;
- extern template class WorkList<ExecuteWorkItem>;
+ extern template class JobList<PretendJob>;
+ extern template class JobList<ExecuteJob>;
#endif
}
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
- extern template class WrappedForwardIterator<resolver::WorkListConstIteratorTag<resolver::PretendWorkItem>,
- const std::tr1::shared_ptr<resolver::PretendWorkItem> >;
- extern template class WrappedForwardIterator<resolver::WorkListConstIteratorTag<resolver::ExecuteWorkItem>,
- const std::tr1::shared_ptr<resolver::ExecuteWorkItem> >;
+ extern template class WrappedForwardIterator<resolver::JobListConstIteratorTag<resolver::PretendJob>,
+ const std::tr1::shared_ptr<resolver::PretendJob> >;
+ extern template class WrappedForwardIterator<resolver::JobListConstIteratorTag<resolver::ExecuteJob>,
+ const std::tr1::shared_ptr<resolver::ExecuteJob> >;
#endif
}
diff --git a/paludis/resolver/work_lists-fwd.hh b/paludis/resolver/job_lists-fwd.hh
index f3b12bb..2587221 100644
--- a/paludis/resolver/work_lists-fwd.hh
+++ b/paludis/resolver/job_lists-fwd.hh
@@ -17,14 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LISTS_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LISTS_FWD_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LISTS_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LISTS_FWD_HH 1
namespace paludis
{
namespace resolver
{
- struct WorkLists;
+ struct JobLists;
}
}
diff --git a/paludis/resolver/work_lists.cc b/paludis/resolver/job_lists.cc
index 380718e..9552ee3 100644
--- a/paludis/resolver/work_lists.cc
+++ b/paludis/resolver/job_lists.cc
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/resolver/work_lists.hh>
-#include <paludis/resolver/work_list.hh>
+#include <paludis/resolver/job_lists.hh>
+#include <paludis/resolver/job_list.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/util/make_shared_copy.hh>
#include <paludis/serialise-impl.hh>
@@ -27,21 +27,22 @@ using namespace paludis;
using namespace paludis::resolver;
void
-WorkLists::serialise(Serialiser & s) const
+JobLists::serialise(Serialiser & s) const
{
- s.object("WorkLists")
- .member(SerialiserFlags<serialise::might_be_null>(), "execute_work_list", execute_work_list())
- .member(SerialiserFlags<serialise::might_be_null>(), "pretend_work_list", pretend_work_list())
+ s.object("JobLists")
+ .member(SerialiserFlags<serialise::might_be_null>(), "execute_job_list", execute_job_list())
+ .member(SerialiserFlags<serialise::might_be_null>(), "pretend_job_list", pretend_job_list())
;
}
-const std::tr1::shared_ptr<WorkLists>
-WorkLists::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<JobLists>
+JobLists::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "WorkLists");
+ Deserialisator v(d, "JobLists");
- return make_shared_copy(make_named_values<WorkLists>(
- n::execute_work_list() = v.member<std::tr1::shared_ptr<WorkList<ExecuteWorkItem> > >("execute_work_list"),
- n::pretend_work_list() = v.member<std::tr1::shared_ptr<WorkList<PretendWorkItem> > >("pretend_work_list")
+ return make_shared_copy(make_named_values<JobLists>(
+ n::execute_job_list() = v.member<std::tr1::shared_ptr<JobList<ExecuteJob> > >("execute_job_list"),
+ n::pretend_job_list() = v.member<std::tr1::shared_ptr<JobList<PretendJob> > >("pretend_job_list")
));
}
+
diff --git a/paludis/resolver/work_lists.hh b/paludis/resolver/job_lists.hh
index 9df0878..10f5f4d 100644
--- a/paludis/resolver/work_lists.hh
+++ b/paludis/resolver/job_lists.hh
@@ -17,12 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LISTS_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_LISTS_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LISTS_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_JOB_LISTS_HH 1
-#include <paludis/resolver/work_lists-fwd.hh>
-#include <paludis/resolver/work_list-fwd.hh>
-#include <paludis/resolver/work_item-fwd.hh>
+#include <paludis/resolver/job_lists-fwd.hh>
+#include <paludis/resolver/job_list-fwd.hh>
+#include <paludis/resolver/job-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/serialise-fwd.hh>
#include <tr1/memory>
@@ -31,18 +31,18 @@ namespace paludis
{
namespace n
{
- typedef Name<struct execute_work_list_name> execute_work_list;
- typedef Name<struct pretend_work_list_name> pretend_work_list;
+ typedef Name<struct execute_job_list_name> execute_job_list;
+ typedef Name<struct pretend_job_list_name> pretend_job_list;
}
namespace resolver
{
- struct WorkLists
+ struct JobLists
{
- NamedValue<n::execute_work_list, std::tr1::shared_ptr<WorkList<ExecuteWorkItem> > > execute_work_list;
- NamedValue<n::pretend_work_list, std::tr1::shared_ptr<WorkList<PretendWorkItem> > > pretend_work_list;
+ NamedValue<n::execute_job_list, std::tr1::shared_ptr<JobList<ExecuteJob> > > execute_job_list;
+ NamedValue<n::pretend_job_list, std::tr1::shared_ptr<JobList<PretendJob> > > pretend_job_list;
- static const std::tr1::shared_ptr<WorkLists> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
+ static const std::tr1::shared_ptr<JobLists> deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
};
}
diff --git a/paludis/resolver/lineariser-fwd.hh b/paludis/resolver/orderer-fwd.hh
index 0513860..37326bd 100644
--- a/paludis/resolver/lineariser-fwd.hh
+++ b/paludis/resolver/orderer-fwd.hh
@@ -24,7 +24,7 @@ namespace paludis
{
namespace resolver
{
- struct Lineariser;
+ struct Orderer;
}
}
diff --git a/paludis/resolver/lineariser.cc b/paludis/resolver/orderer.cc
index 7a82b88..60b96bb 100644
--- a/paludis/resolver/lineariser.cc
+++ b/paludis/resolver/orderer.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/resolver/lineariser.hh>
+#include <paludis/resolver/orderer.hh>
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/resolution.hh>
@@ -26,11 +26,11 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/strongly_connected_component.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/work_lists.hh>
-#include <paludis/resolver/work_list.hh>
-#include <paludis/resolver/work_item.hh>
+#include <paludis/resolver/job_lists.hh>
+#include <paludis/resolver/job_list.hh>
+#include <paludis/resolver/job.hh>
#include <paludis/resolver/destination.hh>
-#include <paludis/resolver/lineariser_notes.hh>
+#include <paludis/resolver/orderer_notes.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
@@ -54,7 +54,7 @@ typedef std::tr1::unordered_map<Resolvent, std::tr1::shared_ptr<const ChangeOrRe
namespace paludis
{
template <>
- struct Implementation<Lineariser>
+ struct Implementation<Orderer>
{
const Environment * const env;
const std::tr1::shared_ptr<Resolved> resolved;
@@ -70,14 +70,14 @@ namespace paludis
};
}
-Lineariser::Lineariser(
+Orderer::Orderer(
const Environment * const e,
const std::tr1::shared_ptr<Resolved> & r) :
- PrivateImplementationPattern<Lineariser>(new Implementation<Lineariser>(e, r))
+ PrivateImplementationPattern<Orderer>(new Implementation<Orderer>(e, r))
{
}
-Lineariser::~Lineariser()
+Orderer::~Orderer()
{
}
@@ -310,7 +310,7 @@ namespace
}
void
-Lineariser::resolve()
+Orderer::resolve()
{
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Nodifying Decisions"));
@@ -350,7 +350,7 @@ Lineariser::resolve()
_imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Finding NAG SCCs"));
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> ssccs(_imp->resolved->nag()->sorted_strongly_connected_components());
- _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Linearising SCCs"));
+ _imp->env->trigger_notifier_callback(NotifierCallbackResolverStageEvent("Ordering SCCs"));
for (SortedStronglyConnectedComponents::ConstIterator scc(ssccs->begin()), scc_end(ssccs->end()) ;
scc != scc_end ; ++scc)
{
@@ -375,8 +375,8 @@ Lineariser::resolve()
{
/* there's only one real package in the component, so there's no
* need to try anything clever */
- schedule(_imp->change_or_remove_resolvents.find(*changes_in_scc.begin())->second,
- make_shared_copy(make_named_values<LineariserNotes>(
+ _schedule(_imp->change_or_remove_resolvents.find(*changes_in_scc.begin())->second,
+ make_shared_copy(make_named_values<OrdererNotes>(
n::cycle_breaking() = ""
)));
}
@@ -401,7 +401,7 @@ Lineariser::resolve()
/* now we try again, hopefully with lots of small SCCs now */
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> sub_ssccs(scc_nag.sorted_strongly_connected_components());
- linearise_sub_ssccs(scc_nag, *scc, sub_ssccs, true);
+ _order_sub_ssccs(scc_nag, *scc, sub_ssccs, true);
}
}
}
@@ -415,7 +415,7 @@ namespace
}
void
-Lineariser::linearise_sub_ssccs(
+Orderer::_order_sub_ssccs(
const NAG & scc_nag,
const StronglyConnectedComponent & top_scc,
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> & sub_ssccs,
@@ -427,8 +427,8 @@ Lineariser::linearise_sub_ssccs(
if (sub_scc->nodes()->size() == 1)
{
/* yay. it's all on its own. */
- schedule(_imp->change_or_remove_resolvents.find(*sub_scc->nodes()->begin())->second,
- make_shared_copy(make_named_values<LineariserNotes>(
+ _schedule(_imp->change_or_remove_resolvents.find(*sub_scc->nodes()->begin())->second,
+ make_shared_copy(make_named_values<OrdererNotes>(
n::cycle_breaking() = (can_recurse ?
"In dependency cycle with existing packages: " + join(scc_nag.begin_nodes(), scc_nag.end_nodes(), ", ", nice_resolvent) :
"In dependency cycle with: " + join(top_scc.nodes()->begin(), top_scc.nodes()->end(), ", ", nice_resolvent))
@@ -441,8 +441,8 @@ Lineariser::linearise_sub_ssccs(
* dependency cycles which we can order however we like! */
for (Set<Resolvent>::ConstIterator r(sub_scc->nodes()->begin()), r_end(sub_scc->nodes()->end()) ;
r != r_end ; ++r)
- schedule(_imp->change_or_remove_resolvents.find(*r)->second,
- make_shared_copy(make_named_values<LineariserNotes>(
+ _schedule(_imp->change_or_remove_resolvents.find(*r)->second,
+ make_shared_copy(make_named_values<OrdererNotes>(
n::cycle_breaking() = "In run dependency cycle with: " + join(
sub_scc->nodes()->begin(), sub_scc->nodes()->end(), ", ", nice_resolvent) + (can_recurse ?
" in dependency cycle with " + join(top_scc.nodes()->begin(), top_scc.nodes()->end(), ", ", nice_resolvent) : "")
@@ -473,7 +473,7 @@ Lineariser::linearise_sub_ssccs(
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> sub_ssccs_without_met_deps(
scc_nag_without_met_deps.sorted_strongly_connected_components());
- linearise_sub_ssccs(scc_nag_without_met_deps, top_scc, sub_ssccs_without_met_deps, false);
+ _order_sub_ssccs(scc_nag_without_met_deps, top_scc, sub_ssccs_without_met_deps, false);
}
else
{
@@ -486,9 +486,9 @@ Lineariser::linearise_sub_ssccs(
}
void
-Lineariser::schedule(
+Orderer::_schedule(
const std::tr1::shared_ptr<const ChangeOrRemoveDecision> & d,
- const std::tr1::shared_ptr<const LineariserNotes> & n)
+ const std::tr1::shared_ptr<const OrdererNotes> & n)
{
_imp->resolved->taken_change_or_remove_decisions()->push_back(d, n);
if (d->required_confirmations_if_any())
@@ -499,13 +499,13 @@ Lineariser::schedule(
if (changes_to_make_decision)
{
- _imp->resolved->work_lists()->pretend_work_list()->append(make_shared_ptr(new PretendWorkItem(
+ _imp->resolved->job_lists()->pretend_job_list()->append(make_shared_ptr(new PretendJob(
changes_to_make_decision->origin_id())));
- _imp->resolved->work_lists()->execute_work_list()->append(make_shared_ptr(new FetchWorkItem(
+ _imp->resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new FetchJob(
changes_to_make_decision->origin_id())));
- _imp->resolved->work_lists()->execute_work_list()->append(make_shared_ptr(new InstallWorkItem(
+ _imp->resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new InstallJob(
changes_to_make_decision->origin_id(),
changes_to_make_decision->destination()->repository(),
changes_to_make_decision->resolvent().destination_type(),
@@ -514,7 +514,7 @@ Lineariser::schedule(
}
else if (remove_decision)
{
- _imp->resolved->work_lists()->execute_work_list()->append(make_shared_ptr(new UninstallWorkItem(
+ _imp->resolved->job_lists()->execute_job_list()->append(make_shared_ptr(new UninstallJob(
remove_decision->ids()
)));
}
diff --git a/paludis/resolver/lineariser.hh b/paludis/resolver/orderer.hh
index 36590f9..a80119b 100644
--- a/paludis/resolver/lineariser.hh
+++ b/paludis/resolver/orderer.hh
@@ -17,11 +17,11 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_HH 1
-#include <paludis/resolver/lineariser-fwd.hh>
-#include <paludis/resolver/lineariser_notes-fwd.hh>
+#include <paludis/resolver/orderer-fwd.hh>
+#include <paludis/resolver/orderer_notes-fwd.hh>
#include <paludis/resolver/resolved-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
#include <paludis/resolver/strongly_connected_component-fwd.hh>
@@ -33,25 +33,25 @@ namespace paludis
{
namespace resolver
{
- class PALUDIS_VISIBLE Lineariser :
- private PrivateImplementationPattern<Lineariser>
+ class PALUDIS_VISIBLE Orderer :
+ private PrivateImplementationPattern<Orderer>
{
private:
- void schedule(
+ void _schedule(
const std::tr1::shared_ptr<const ChangeOrRemoveDecision> &,
- const std::tr1::shared_ptr<const LineariserNotes> &);
+ const std::tr1::shared_ptr<const OrdererNotes> &);
- void linearise_sub_ssccs(
+ void _order_sub_ssccs(
const NAG &,
const StronglyConnectedComponent & top_scc,
const std::tr1::shared_ptr<const SortedStronglyConnectedComponents> & sub_ssccs,
const bool can_recurse);
public:
- Lineariser(
+ Orderer(
const Environment * const,
const std::tr1::shared_ptr<Resolved> &);
- ~Lineariser();
+ ~Orderer();
void resolve();
};
diff --git a/paludis/resolver/lineariser_notes-fwd.hh b/paludis/resolver/orderer_notes-fwd.hh
index 1dc4fca..5c105ae 100644
--- a/paludis/resolver/lineariser_notes-fwd.hh
+++ b/paludis/resolver/orderer_notes-fwd.hh
@@ -17,14 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_NOTES_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_NOTES_FWD_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_NOTES_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_NOTES_FWD_HH 1
namespace paludis
{
namespace resolver
{
- struct LineariserNotes;
+ struct OrdererNotes;
}
}
diff --git a/paludis/resolver/lineariser_notes.cc b/paludis/resolver/orderer_notes.cc
index 4996996..f7abd4f 100644
--- a/paludis/resolver/lineariser_notes.cc
+++ b/paludis/resolver/orderer_notes.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/resolver/lineariser_notes.hh>
+#include <paludis/resolver/orderer_notes.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/serialise-impl.hh>
@@ -26,19 +26,19 @@ using namespace paludis;
using namespace paludis::resolver;
void
-LineariserNotes::serialise(Serialiser & s) const
+OrdererNotes::serialise(Serialiser & s) const
{
- s.object("LineariserNotes")
+ s.object("OrdererNotes")
.member(SerialiserFlags<>(), "cycle_breaking", cycle_breaking())
;
}
-const std::tr1::shared_ptr<LineariserNotes>
-LineariserNotes::deserialise(Deserialisation & d)
+const std::tr1::shared_ptr<OrdererNotes>
+OrdererNotes::deserialise(Deserialisation & d)
{
- Deserialisator v(d, "LineariserNotes");
+ Deserialisator v(d, "OrdererNotes");
- return make_shared_ptr(new LineariserNotes(make_named_values<LineariserNotes>(
+ return make_shared_ptr(new OrdererNotes(make_named_values<OrdererNotes>(
n::cycle_breaking() = v.member<std::string>("cycle_breaking")
)));
}
diff --git a/paludis/resolver/lineariser_notes.hh b/paludis/resolver/orderer_notes.hh
index d6599aa..49685b2 100644
--- a/paludis/resolver/lineariser_notes.hh
+++ b/paludis/resolver/orderer_notes.hh
@@ -17,10 +17,10 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_NOTES_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_LINEARISER_NOTES_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_NOTES_HH
+#define PALUDIS_GUARD_PALUDIS_RESOLVER_ORDERER_NOTES_HH 1
-#include <paludis/resolver/lineariser_notes-fwd.hh>
+#include <paludis/resolver/orderer_notes-fwd.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/named_value.hh>
#include <paludis/serialise-fwd.hh>
@@ -35,12 +35,12 @@ namespace paludis
namespace resolver
{
- struct LineariserNotes
+ struct OrdererNotes
{
NamedValue<n::cycle_breaking, std::string> cycle_breaking;
void serialise(Serialiser &) const;
- static const std::tr1::shared_ptr<LineariserNotes> deserialise(
+ static const std::tr1::shared_ptr<OrdererNotes> deserialise(
Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
diff --git a/paludis/resolver/resolved.cc b/paludis/resolver/resolved.cc
index 9609899..61c28bf 100644
--- a/paludis/resolver/resolved.cc
+++ b/paludis/resolver/resolved.cc
@@ -21,7 +21,7 @@
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/decision.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/work_lists.hh>
+#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/nag.hh>
#include <paludis/util/make_named_values.hh>
#include <paludis/serialise-impl.hh>
@@ -33,6 +33,7 @@ void
Resolved::serialise(Serialiser & s) const
{
s.object("Resolved")
+ .member(SerialiserFlags<serialise::might_be_null>(), "job_lists", job_lists())
.member(SerialiserFlags<serialise::might_be_null>(), "nag", nag())
.member(SerialiserFlags<serialise::might_be_null>(), "resolutions_by_resolvent", resolutions_by_resolvent())
.member(SerialiserFlags<serialise::might_be_null>(), "taken_change_or_remove_decisions", taken_change_or_remove_decisions())
@@ -40,7 +41,6 @@ Resolved::serialise(Serialiser & s) const
.member(SerialiserFlags<serialise::might_be_null>(), "taken_unconfirmed_change_or_remove_decisions", taken_unconfirmed_change_or_remove_decisions())
.member(SerialiserFlags<serialise::might_be_null>(), "untaken_change_or_remove_decisions", untaken_change_or_remove_decisions())
.member(SerialiserFlags<serialise::might_be_null>(), "untaken_unable_to_make_decisions", untaken_unable_to_make_decisions())
- .member(SerialiserFlags<serialise::might_be_null>(), "work_lists", work_lists())
;
}
@@ -50,12 +50,14 @@ Resolved::deserialise(Deserialisation & d)
Deserialisator v(d, "Resolved");
return make_named_values<Resolved>(
+ n::job_lists() =
+ v.member<std::tr1::shared_ptr<JobLists> >("job_lists"),
n::nag() =
v.member<std::tr1::shared_ptr<NAG> >("nag"),
n::resolutions_by_resolvent() =
v.member<std::tr1::shared_ptr<ResolutionsByResolvent> >("resolutions_by_resolvent"),
n::taken_change_or_remove_decisions() =
- v.member<std::tr1::shared_ptr<ChangeOrRemoveDecisionsWithNotes> >("taken_change_or_remove_decisions"),
+ v.member<std::tr1::shared_ptr<OrderedChangeOrRemoveDecisions> >("taken_change_or_remove_decisions"),
n::taken_unable_to_make_decisions() =
v.member<std::tr1::shared_ptr<Decisions<UnableToMakeDecision> > >("taken_unable_to_make_decisions"),
n::taken_unconfirmed_change_or_remove_decisions() =
@@ -63,9 +65,7 @@ Resolved::deserialise(Deserialisation & d)
n::untaken_change_or_remove_decisions() =
v.member<std::tr1::shared_ptr<Decisions<ChangeOrRemoveDecision> > >("untaken_change_or_remove_decisions"),
n::untaken_unable_to_make_decisions() =
- v.member<std::tr1::shared_ptr<Decisions<UnableToMakeDecision> > >("untaken_unable_to_make_decisions"),
- n::work_lists() =
- v.member<std::tr1::shared_ptr<WorkLists> >("work_lists")
+ v.member<std::tr1::shared_ptr<Decisions<UnableToMakeDecision> > >("untaken_unable_to_make_decisions")
);
}
diff --git a/paludis/resolver/resolved.hh b/paludis/resolver/resolved.hh
index 60e4454..3f99214 100644
--- a/paludis/resolver/resolved.hh
+++ b/paludis/resolver/resolved.hh
@@ -24,7 +24,7 @@
#include <paludis/resolver/decisions-fwd.hh>
#include <paludis/resolver/resolutions_by_resolvent-fwd.hh>
#include <paludis/resolver/decision-fwd.hh>
-#include <paludis/resolver/work_lists-fwd.hh>
+#include <paludis/resolver/job_lists-fwd.hh>
#include <paludis/resolver/nag-fwd.hh>
#include <paludis/util/named_value.hh>
#include <paludis/serialise-fwd.hh>
@@ -34,6 +34,7 @@ namespace paludis
{
namespace n
{
+ typedef Name<struct job_lists_name> job_lists;
typedef Name<struct nag_name> nag;
typedef Name<struct resolutions_by_resolvent_name> resolutions_by_resolvent;
typedef Name<struct taken_change_or_remove_decisions_name> taken_change_or_remove_decisions;
@@ -41,21 +42,20 @@ namespace paludis
typedef Name<struct taken_unconfirmed_change_or_remove_decisions_name> taken_unconfirmed_change_or_remove_decisions;
typedef Name<struct untaken_change_or_remove_decisions_name> untaken_change_or_remove_decisions;
typedef Name<struct untaken_unable_to_make_decisions_name> untaken_unable_to_make_decisions;
- typedef Name<struct work_lists_name> work_lists;
}
namespace resolver
{
struct Resolved
{
+ NamedValue<n::job_lists, std::tr1::shared_ptr<JobLists> > job_lists;
NamedValue<n::nag, std::tr1::shared_ptr<NAG> > nag;
NamedValue<n::resolutions_by_resolvent, std::tr1::shared_ptr<ResolutionsByResolvent> > resolutions_by_resolvent;
- NamedValue<n::taken_change_or_remove_decisions, std::tr1::shared_ptr<ChangeOrRemoveDecisionsWithNotes> > taken_change_or_remove_decisions;
+ NamedValue<n::taken_change_or_remove_decisions, std::tr1::shared_ptr<OrderedChangeOrRemoveDecisions> > taken_change_or_remove_decisions;
NamedValue<n::taken_unable_to_make_decisions, std::tr1::shared_ptr<Decisions<UnableToMakeDecision> > > taken_unable_to_make_decisions;
NamedValue<n::taken_unconfirmed_change_or_remove_decisions, std::tr1::shared_ptr<Decisions<ChangeOrRemoveDecision> > > taken_unconfirmed_change_or_remove_decisions;
NamedValue<n::untaken_change_or_remove_decisions, std::tr1::shared_ptr<Decisions<ChangeOrRemoveDecision> > > untaken_change_or_remove_decisions;
NamedValue<n::untaken_unable_to_make_decisions, std::tr1::shared_ptr<Decisions<UnableToMakeDecision> > > untaken_unable_to_make_decisions;
- NamedValue<n::work_lists, std::tr1::shared_ptr<WorkLists> > work_lists;
static const Resolved deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index 3706476..a4d3650 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -24,10 +24,10 @@
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/reason.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
-#include <paludis/resolver/lineariser.hh>
+#include <paludis/resolver/orderer.hh>
#include <paludis/resolver/decisions.hh>
-#include <paludis/resolver/work_list.hh>
-#include <paludis/resolver/work_lists.hh>
+#include <paludis/resolver/job_list.hh>
+#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/nag.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/make_shared_ptr.hh>
@@ -58,26 +58,26 @@ namespace paludis
const std::tr1::shared_ptr<Resolved> resolved;
const std::tr1::shared_ptr<Decider> decider;
- const std::tr1::shared_ptr<Lineariser> lineariser;
+ const std::tr1::shared_ptr<Orderer> orderer;
Implementation(const Environment * const e, const ResolverFunctions & f) :
env(e),
fns(f),
resolved(new Resolved(make_named_values<Resolved>(
+ n::job_lists() = make_shared_copy(make_named_values<JobLists>(
+ n::execute_job_list() = make_shared_ptr(new JobList<ExecuteJob>),
+ n::pretend_job_list() = make_shared_ptr(new JobList<PretendJob>)
+ )),
n::nag() = make_shared_ptr(new NAG),
n::resolutions_by_resolvent() = make_shared_ptr(new ResolutionsByResolvent),
- n::taken_change_or_remove_decisions() = make_shared_ptr(new ChangeOrRemoveDecisionsWithNotes),
+ n::taken_change_or_remove_decisions() = make_shared_ptr(new OrderedChangeOrRemoveDecisions),
n::taken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>),
n::taken_unconfirmed_change_or_remove_decisions() = make_shared_ptr(new Decisions<ChangeOrRemoveDecision>),
n::untaken_change_or_remove_decisions() = make_shared_ptr(new Decisions<ChangeOrRemoveDecision>),
- n::untaken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>),
- n::work_lists() = make_shared_copy(make_named_values<WorkLists>(
- n::execute_work_list() = make_shared_ptr(new WorkList<ExecuteWorkItem>),
- n::pretend_work_list() = make_shared_ptr(new WorkList<PretendWorkItem>)
- ))
+ n::untaken_unable_to_make_decisions() = make_shared_ptr(new Decisions<UnableToMakeDecision>)
))),
decider(new Decider(e, f, resolved->resolutions_by_resolvent())),
- lineariser(new Lineariser(e, resolved))
+ orderer(new Orderer(e, resolved))
{
}
};
@@ -165,7 +165,7 @@ void
Resolver::resolve()
{
_imp->decider->resolve();
- _imp->lineariser->resolve();
+ _imp->orderer->resolve();
}
const std::tr1::shared_ptr<const Resolved>
diff --git a/paludis/resolver/work_item-fwd.hh b/paludis/resolver/work_item-fwd.hh
deleted file mode 100644
index 3725412..0000000
--- a/paludis/resolver/work_item-fwd.hh
+++ /dev/null
@@ -1,36 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_ITEM_FWD_HH
-#define PALUDIS_GUARD_PALUDIS_RESOLVER_WORK_ITEM_FWD_HH 1
-
-namespace paludis
-{
- namespace resolver
- {
- class PretendWorkItem;
-
- class ExecuteWorkItem;
- class FetchWorkItem;
- class InstallWorkItem;
- class UninstallWorkItem;
- }
-}
-
-#endif
diff --git a/paludis/resolver/work_list.cc b/paludis/resolver/work_list.cc
deleted file mode 100644
index 2678d54..0000000
--- a/paludis/resolver/work_list.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <paludis/resolver/work_list.hh>
-#include <paludis/resolver/work_item.hh>
-#include <paludis/util/private_implementation_pattern-impl.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/serialise-impl.hh>
-#include <vector>
-
-using namespace paludis;
-using namespace paludis::resolver;
-
-namespace paludis
-{
-#ifndef PALUDIS_NO_DOUBLE_TEMPLATE
- template <>
-#endif
- template <typename WorkItem_>
- struct Implementation<WorkList<WorkItem_> >
- {
- std::vector<std::tr1::shared_ptr<WorkItem_> > list;
- };
-
-#ifdef PALUDIS_NO_DOUBLE_TEMPLATE
- template <>
-#endif
- template <typename WorkItem_>
- struct WrappedForwardIteratorTraits<WorkListConstIteratorTag<WorkItem_> >
- {
- typedef typename std::vector<std::tr1::shared_ptr<WorkItem_> >::const_iterator UnderlyingIterator;
- };
-}
-
-template <typename WorkItem_>
-WorkList<WorkItem_>::WorkList() :
- PrivateImplementationPattern<WorkList<WorkItem_> >(new Implementation<WorkList<WorkItem_> >)
-{
-}
-
-template <typename WorkItem_>
-WorkList<WorkItem_>::~WorkList()
-{
-}
-
-template <typename WorkItem_>
-WorkListIndex
-WorkList<WorkItem_>::append(const std::tr1::shared_ptr<WorkItem_> & i)
-{
- typename std::vector<std::tr1::shared_ptr<WorkItem_> >::const_iterator p(_imp->list.insert(_imp->list.end(), i));
- return p - _imp->list.begin();
-}
-
-template <typename WorkItem_>
-int
-WorkList<WorkItem_>::length() const
-{
- return _imp->list.size();
-}
-
-template <typename WorkItem_>
-typename WorkList<WorkItem_>::ConstIterator
-WorkList<WorkItem_>::begin() const
-{
- return ConstIterator(_imp->list.begin());
-}
-
-template <typename WorkItem_>
-typename WorkList<WorkItem_>::ConstIterator
-WorkList<WorkItem_>::end() const
-{
- return ConstIterator(_imp->list.end());
-}
-
-template <typename WorkItem_>
-const std::tr1::shared_ptr<WorkList<WorkItem_> >
-WorkList<WorkItem_>::deserialise(Deserialisation & d)
-{
- Deserialisator v(d, "WorkList");
- Deserialisator vv(*v.find_remove_member("items"), "c");
- std::tr1::shared_ptr<WorkList> result(new WorkList);
- for (int n(1), n_end(vv.member<int>("count") + 1) ; n != n_end ; ++n)
- result->append(vv.member<std::tr1::shared_ptr<WorkItem_> >(stringify(n)));
- return result;
-}
-
-template <typename WorkItem_>
-void
-WorkList<WorkItem_>::serialise(Serialiser & s) const
-{
- s.object("WorkList")
- .member(SerialiserFlags<serialise::container>(), "items", _imp->list)
- ;
-}
-
-template class WorkList<PretendWorkItem>;
-template class WrappedForwardIterator<WorkListConstIteratorTag<PretendWorkItem>, const std::tr1::shared_ptr<PretendWorkItem> >;
-
-template class WorkList<ExecuteWorkItem>;
-template class WrappedForwardIterator<WorkListConstIteratorTag<ExecuteWorkItem>, const std::tr1::shared_ptr<ExecuteWorkItem> >;
-
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index 7f6453f..07a24f5 100644
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -52,7 +52,7 @@
#include <paludis/resolver/unsuitable_candidates.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/resolver/required_confirmations.hh>
-#include <paludis/resolver/lineariser_notes.hh>
+#include <paludis/resolver/orderer_notes.hh>
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -1090,14 +1090,14 @@ namespace
}
}
- std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const LineariserNotes> >
+ std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const OrdererNotes> >
get_decision_and_notes(const std::tr1::shared_ptr<const ChangeOrRemoveDecision> & d)
{
return std::make_pair(d, make_null_shared_ptr());
}
- std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const LineariserNotes> >
- get_decision_and_notes(const std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const LineariserNotes> > & d)
+ std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const OrdererNotes> >
+ get_decision_and_notes(const std::pair<std::tr1::shared_ptr<const ChangeOrRemoveDecision>, std::tr1::shared_ptr<const OrdererNotes> > & d)
{
return d;
}
@@ -1130,7 +1130,7 @@ namespace
const std::pair<
std::tr1::shared_ptr<const ChangeOrRemoveDecision>,
- std::tr1::shared_ptr<const LineariserNotes> > star_i(get_decision_and_notes(*i));
+ std::tr1::shared_ptr<const OrdererNotes> > star_i(get_decision_and_notes(*i));
const ChangesToMakeDecision * const changes_to_make_decision(simple_visitor_cast<const ChangesToMakeDecision>(*star_i.first));
const RemoveDecision * const remove_decision(simple_visitor_cast<const RemoveDecision>(*star_i.first));
diff --git a/src/clients/cave/cmd_execute_resolution.cc b/src/clients/cave/cmd_execute_resolution.cc
index d5f8d56..99af01e 100644
--- a/src/clients/cave/cmd_execute_resolution.cc
+++ b/src/clients/cave/cmd_execute_resolution.cc
@@ -49,9 +49,9 @@
#include <paludis/resolver/resolver.hh>
#include <paludis/resolver/resolvent.hh>
#include <paludis/resolver/destination.hh>
-#include <paludis/resolver/work_lists.hh>
-#include <paludis/resolver/work_list.hh>
-#include <paludis/resolver/work_item.hh>
+#include <paludis/resolver/job_lists.hh>
+#include <paludis/resolver/job_list.hh>
+#include <paludis/resolver/job.hh>
#include <paludis/package_id.hh>
#include <paludis/version_spec.hh>
#include <paludis/metadata_key.hh>
@@ -581,19 +581,19 @@ namespace
int execute_pretends(
const std::tr1::shared_ptr<Environment> & env,
- const std::tr1::shared_ptr<WorkLists> & lists,
+ const std::tr1::shared_ptr<JobLists> & lists,
const ExecuteResolutionCommandLine & cmdline)
{
bool failed(false);
- int x(0), y(lists->pretend_work_list()->length()), last_x(0);
+ int x(0), y(lists->pretend_job_list()->length()), last_x(0);
if (0 != env->perform_hook(Hook("pretend_all_pre")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
throw ActionAbortedError("Aborted by hook");
- for (WorkList<PretendWorkItem>::ConstIterator c(lists->pretend_work_list()->begin()),
- c_end(lists->pretend_work_list()->end()) ;
+ for (JobList<PretendJob>::ConstIterator c(lists->pretend_job_list()->begin()),
+ c_end(lists->pretend_job_list()->end()) ;
c != c_end ; ++c)
{
if (++x == 1)
@@ -639,7 +639,7 @@ namespace
{
}
- int visit(InstallWorkItem & install_item)
+ int visit(InstallJob & install_item)
{
++x_install;
@@ -656,7 +656,7 @@ namespace
return 0;
}
- int visit(UninstallWorkItem & uninstall_item)
+ int visit(UninstallJob & uninstall_item)
{
/* we treat uninstalls as installs for counts. if you're reading
* this it's probably because you think that that's silly, which
@@ -673,7 +673,7 @@ namespace
return 0;
}
- int visit(FetchWorkItem & fetch_item)
+ int visit(FetchJob & fetch_item)
{
++x_fetch;
std::tr1::shared_ptr<OutputManager> output_manager_goes_here;
@@ -687,20 +687,20 @@ namespace
int execute_executions(
const std::tr1::shared_ptr<Environment> & env,
- const std::tr1::shared_ptr<WorkLists> & lists,
+ const std::tr1::shared_ptr<JobLists> & lists,
const ExecuteResolutionCommandLine & cmdline,
Summary &)
{
int retcode(0);
- int x_fetch(0), x_install(0), y(lists->pretend_work_list()->length());
+ int x_fetch(0), x_install(0), y(lists->pretend_job_list()->length());
if (0 != env->perform_hook(Hook("install_all_pre")
("TARGETS", join(cmdline.begin_parameters(), cmdline.end_parameters(), " "))
).max_exit_status())
throw ActionAbortedError("Aborted by hook");
- for (WorkList<ExecuteWorkItem>::ConstIterator c(lists->execute_work_list()->begin()),
- c_end(lists->execute_work_list()->end()) ;
+ for (JobList<ExecuteJob>::ConstIterator c(lists->execute_job_list()->begin()),
+ c_end(lists->execute_job_list()->end()) ;
c != c_end ; ++c)
{
ExecuteOneVisitor execute(env, cmdline, x_fetch, x_install, y);
@@ -720,7 +720,7 @@ namespace
int execute_resolution_main(
const std::tr1::shared_ptr<Environment> & env,
- const std::tr1::shared_ptr<WorkLists> & lists,
+ const std::tr1::shared_ptr<JobLists> & lists,
const ExecuteResolutionCommandLine & cmdline,
Summary & summary)
{
@@ -741,7 +741,7 @@ namespace
}
void display_summary(
- const std::tr1::shared_ptr<WorkLists> &,
+ const std::tr1::shared_ptr<JobLists> &,
Summary &,
const bool)
{
@@ -749,7 +749,7 @@ namespace
int execute_resolution(
const std::tr1::shared_ptr<Environment> & env,
- const std::tr1::shared_ptr<WorkLists> & lists,
+ const std::tr1::shared_ptr<JobLists> & lists,
const ExecuteResolutionCommandLine & cmdline)
{
Context context("When executing chosen resolution:");
@@ -802,7 +802,7 @@ int
ExecuteResolutionCommand::run(
const std::tr1::shared_ptr<Environment> & env,
const std::tr1::shared_ptr<const Sequence<std::string > > & args,
- const std::tr1::shared_ptr<WorkLists> & maybe_lists
+ const std::tr1::shared_ptr<JobLists> & maybe_lists
)
{
ExecuteResolutionCommandLine cmdline;
@@ -816,7 +816,7 @@ ExecuteResolutionCommand::run(
cmdline.import_options.apply(env);
- std::tr1::shared_ptr<WorkLists> lists(maybe_lists);
+ std::tr1::shared_ptr<JobLists> lists(maybe_lists);
if (! lists)
{
if (getenv_with_default("PALUDIS_SERIALISED_RESOLUTION_FD", "").empty())
@@ -825,8 +825,8 @@ ExecuteResolutionCommand::run(
int fd(destringify<int>(getenv_with_default("PALUDIS_SERIALISED_RESOLUTION_FD", "")));
SafeIFStream deser_stream(fd);
Deserialiser deserialiser(env.get(), deser_stream);
- Deserialisation deserialisation("WorkLists", deserialiser);
- lists = WorkLists::deserialise(deserialisation);
+ Deserialisation deserialisation("JobLists", deserialiser);
+ lists = JobLists::deserialise(deserialisation);
close(fd);
}
diff --git a/src/clients/cave/cmd_execute_resolution.hh b/src/clients/cave/cmd_execute_resolution.hh
index ec2fc1f..7ef3c28 100644
--- a/src/clients/cave/cmd_execute_resolution.hh
+++ b/src/clients/cave/cmd_execute_resolution.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_CMD_EXECUTE_RESOLUTION_HH 1
#include "command.hh"
-#include <paludis/resolver/work_lists-fwd.hh>
+#include <paludis/resolver/job_lists-fwd.hh>
namespace paludis
{
@@ -41,7 +41,7 @@ namespace paludis
int run(
const std::tr1::shared_ptr<Environment> &,
const std::tr1::shared_ptr<const Sequence<std::string > > & args,
- const std::tr1::shared_ptr<resolver::WorkLists> & maybe_work_lists);
+ const std::tr1::shared_ptr<resolver::JobLists> & maybe_job_lists);
std::tr1::shared_ptr<args::ArgsHandler> make_doc_cmdline();
};
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index adb20eb..d8c8ca5 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -52,7 +52,7 @@
#include <paludis/resolver/sanitised_dependencies.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
#include <paludis/resolver/required_confirmations.hh>
-#include <paludis/resolver/work_lists.hh>
+#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/decisions.hh>
#include <paludis/user_dep_spec.hh>
#include <paludis/notifier_callback.hh>
@@ -1250,10 +1250,10 @@ namespace
return DisplayResolutionCommand().run(env, args, resolved);
}
- void serialise_work_lists(StringListStream & ser_stream, const WorkLists & work_lists)
+ void serialise_job_lists(StringListStream & ser_stream, const JobLists & job_lists)
{
Serialiser ser(ser_stream);
- work_lists.serialise(ser);
+ job_lists.serialise(ser);
ser_stream.nothing_more_to_write();
}
@@ -1311,7 +1311,7 @@ namespace
* be a fun exercise for someone with way too much time on their hands.
* */
StringListStream ser_stream;
- serialise_work_lists(ser_stream, *resolved->work_lists());
+ serialise_job_lists(ser_stream, *resolved->job_lists());
std::string command;
if (program_options.a_execute_resolution_program.specified())
@@ -1339,7 +1339,7 @@ namespace
become_command(cmd);
}
else
- return ExecuteResolutionCommand().run(env, args, resolved->work_lists());
+ return ExecuteResolutionCommand().run(env, args, resolved->job_lists());
}
struct KindNameVisitor