aboutsummaryrefslogtreecommitdiff
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
parent22f38487876630e97e4df4ea9573139c2c630c21 (diff)
downloadpaludis-7457673c62853dca4c1c041b631eb93a97072870.tar.gz
paludis-7457673c62853dca4c1c041b631eb93a97072870.tar.xz
Job*State::any_output_manager_wants_to_flush
-rw-r--r--paludis/resolver/job_state.cc22
-rw-r--r--paludis/resolver/job_state.hh2
2 files changed, 24 insertions, 0 deletions
diff --git a/paludis/resolver/job_state.cc b/paludis/resolver/job_state.cc
index 60afc2c..c3e63f1 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
{
diff --git a/paludis/resolver/job_state.hh b/paludis/resolver/job_state.hh
index 1479e76..c3c946d 100644
--- a/paludis/resolver/job_state.hh
+++ b/paludis/resolver/job_state.hh
@@ -72,6 +72,7 @@ namespace paludis
virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
void add_output_manager(const std::tr1::shared_ptr<OutputManager> &);
+ bool any_output_manager_wants_to_flush() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE JobFailedState :
@@ -87,6 +88,7 @@ namespace paludis
virtual const std::string state_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
void add_output_manager(const std::tr1::shared_ptr<OutputManager> &);
+ bool any_output_manager_wants_to_flush() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE JobSkippedState :