aboutsummaryrefslogtreecommitdiff
path: root/paludis/resolver/job_state.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-26 14:49:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-26 14:49:00 +0000
commit7457673c62853dca4c1c041b631eb93a97072870 (patch)
tree23607b48703c944e6bd344fba0fcae6b95bbc7c9 /paludis/resolver/job_state.cc
parent22f38487876630e97e4df4ea9573139c2c630c21 (diff)
downloadpaludis-7457673c62853dca4c1c041b631eb93a97072870.tar.gz
paludis-7457673c62853dca4c1c041b631eb93a97072870.tar.xz
Job*State::any_output_manager_wants_to_flush
Diffstat (limited to 'paludis/resolver/job_state.cc')
-rw-r--r--paludis/resolver/job_state.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/paludis/resolver/job_state.cc b/paludis/resolver/job_state.cc
index 60afc2c3c..c3e63f17a 100644
--- a/paludis/resolver/job_state.cc
+++ b/paludis/resolver/job_state.cc
@@ -19,7 +19,11 @@
#include <paludis/resolver/job_state.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/indirect_iterator-impl.hh>
+#include <paludis/output_manager.hh>
#include <list>
+#include <algorithm>
+#include <tr1/functional>
using namespace paludis;
using namespace paludis::resolver;
@@ -125,6 +129,15 @@ JobSucceededState::add_output_manager(const std::tr1::shared_ptr<OutputManager>
_imp->output_managers.push_back(o);
}
+bool
+JobSucceededState::any_output_manager_wants_to_flush() const
+{
+ return indirect_iterator(_imp->output_managers.end()) != std::find_if(
+ indirect_iterator(_imp->output_managers.begin()),
+ indirect_iterator(_imp->output_managers.end()),
+ std::tr1::bind(&OutputManager::want_to_flush, std::tr1::placeholders::_1));
+}
+
JobFailedState::JobFailedState(const std::tr1::shared_ptr<const Job> & j) :
PrivateImplementationPattern<JobFailedState>(new Implementation<JobFailedState>(j))
{
@@ -146,6 +159,15 @@ JobFailedState::add_output_manager(const std::tr1::shared_ptr<OutputManager> & o
_imp->output_managers.push_back(o);
}
+bool
+JobFailedState::any_output_manager_wants_to_flush() const
+{
+ return indirect_iterator(_imp->output_managers.end()) != std::find_if(
+ indirect_iterator(_imp->output_managers.begin()),
+ indirect_iterator(_imp->output_managers.end()),
+ std::tr1::bind(&OutputManager::want_to_flush, std::tr1::placeholders::_1));
+}
+
const std::string
JobFailedState::state_name() const
{