aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-09-02 13:55:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-09-02 13:55:03 +0100
commit5478723fe66236f70308e9feaa1d6262b4126d9c (patch)
treeaff545d507effba7990a4c216d85856e7afc348c
parenta378ef71ec960ed3ecdf7151cd9685fb24dec136 (diff)
downloadpaludis-5478723fe66236f70308e9feaa1d6262b4126d9c.tar.gz
paludis-5478723fe66236f70308e9feaa1d6262b4126d9c.tar.xz
JobList::number
-rw-r--r--paludis/resolver/job_list.cc7
-rw-r--r--paludis/resolver/job_list.hh2
2 files changed, 9 insertions, 0 deletions
diff --git a/paludis/resolver/job_list.cc b/paludis/resolver/job_list.cc
index bcaff0a..6a3d428 100644
--- a/paludis/resolver/job_list.cc
+++ b/paludis/resolver/job_list.cc
@@ -90,6 +90,13 @@ JobList<Job_>::fetch(const JobNumber n) const
}
template <typename Job_>
+JobNumber
+JobList<Job_>::number(const ConstIterator & i) const
+{
+ return i.template underlying_iterator<typename WrappedForwardIteratorTraits<ConstIteratorTag>::UnderlyingIterator>() - _imp->list.begin();
+}
+
+template <typename Job_>
const std::shared_ptr<JobList<Job_> >
JobList<Job_>::deserialise(Deserialisation & d)
{
diff --git a/paludis/resolver/job_list.hh b/paludis/resolver/job_list.hh
index 07f2e26..f468d97 100644
--- a/paludis/resolver/job_list.hh
+++ b/paludis/resolver/job_list.hh
@@ -55,6 +55,8 @@ namespace paludis
ConstIterator end() const PALUDIS_ATTRIBUTE((warn_unused_result));
ConstIterator fetch(const JobNumber) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ JobNumber number(const ConstIterator &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
static const std::shared_ptr<JobList<Job_> > deserialise(Deserialisation &) PALUDIS_ATTRIBUTE((warn_unused_result));
void serialise(Serialiser &) const;
};