aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/decisions.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-13 21:05:06 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 13:22:11 +0100
commit50d099e6e079d180d14584180f942e9e365690ea (patch)
tree8a4e6aa88bb7d49f7114ba14e0d4045e0c31fe0d /paludis/resolver/decisions.cc
parentc8eae70be8510bdd42283c1ecac745af2f9a8a80 (diff)
downloadpaludis-50d099e6e079d180d14584180f942e9e365690ea.tar.gz
paludis-50d099e6e079d180d14584180f942e9e365690ea.tar.xz
Basic ordering support
Diffstat (limited to 'paludis/resolver/decisions.cc')
-rw-r--r--paludis/resolver/decisions.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/paludis/resolver/decisions.cc b/paludis/resolver/decisions.cc
index 1203e44..1c11f6b 100644
--- a/paludis/resolver/decisions.cc
+++ b/paludis/resolver/decisions.cc
@@ -23,6 +23,7 @@
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/wrapped_forward_iterator-impl.hh>
#include <list>
using namespace paludis;
@@ -38,6 +39,15 @@ namespace paludis
{
std::list<std::tr1::shared_ptr<const Decision_> > values;
};
+
+#ifdef PALUDIS_NO_DOUBLE_TEMPLATE
+ template <>
+#endif
+ template <typename Decision_>
+ struct WrappedForwardIteratorTraits<DecisionsConstIteratorTag<Decision_> >
+ {
+ typedef typename std::list<std::tr1::shared_ptr<const Decision_> >::const_iterator UnderlyingIterator;
+ };
}
template <typename Decision_>
@@ -67,7 +77,28 @@ Decisions<Decision_>::cast_push_back(const std::tr1::shared_ptr<const Decision>
push_back(std::tr1::static_pointer_cast<const Decision_>(d));
}
+template <typename Decision_>
+typename Decisions<Decision_>::ConstIterator
+Decisions<Decision_>::begin() const
+{
+ return ConstIterator(_imp->values.begin());
+}
+
+template <typename Decision_>
+typename Decisions<Decision_>::ConstIterator
+Decisions<Decision_>::end() const
+{
+ return ConstIterator(_imp->values.end());
+}
+
template class Decisions<UnableToMakeDecision>;
template class Decisions<ChangesToMakeDecision>;
template class Decisions<ChangeOrRemoveDecision>;
+template class WrappedForwardIterator<DecisionsConstIteratorTag<UnableToMakeDecision>,
+ const std::tr1::shared_ptr<const UnableToMakeDecision> >;
+template class WrappedForwardIterator<DecisionsConstIteratorTag<ChangesToMakeDecision>,
+ const std::tr1::shared_ptr<const ChangesToMakeDecision> >;
+template class WrappedForwardIterator<DecisionsConstIteratorTag<ChangeOrRemoveDecision>,
+ const std::tr1::shared_ptr<const ChangeOrRemoveDecision> >;
+