aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 13:07:02 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-14 13:22:04 +0100
commit46a057a29d293998af6079a9ddbeefa050bf4449 (patch)
tree41a8d06a91880326f5ea92755344245bd773ac8b
parentbf6cfe9d43403c955ed521821d18c5aef99c8675 (diff)
downloadpaludis-46a057a29d293998af6079a9ddbeefa050bf4449.tar.gz
paludis-46a057a29d293998af6079a9ddbeefa050bf4449.tar.xz
Deserialise ChangeOrRemoveDecision
-rw-r--r--paludis/resolver/decision.cc15
-rw-r--r--paludis/resolver/decision.hh3
2 files changed, 18 insertions, 0 deletions
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index 5f1473e..09427a5 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -79,6 +79,21 @@ Decision::deserialise(Deserialisation & d)
throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
}
+const std::tr1::shared_ptr<ChangeOrRemoveDecision>
+ChangeOrRemoveDecision::deserialise(Deserialisation & d)
+{
+ if (d.class_name() == "ChangesToMakeDecision")
+ {
+ return ChangesToMakeDecision::deserialise(d);
+ }
+ else if (d.class_name() == "RemoveDecision")
+ {
+ return RemoveDecision::deserialise(d);
+ }
+ else
+ throw InternalError(PALUDIS_HERE, "unknown class '" + stringify(d.class_name()) + "'");
+}
+
const std::tr1::shared_ptr<ChangesToMakeDecision>
ChangesToMakeDecision::deserialise(Deserialisation & d)
{
diff --git a/paludis/resolver/decision.hh b/paludis/resolver/decision.hh
index 2ae9e13..2afa959 100644
--- a/paludis/resolver/decision.hh
+++ b/paludis/resolver/decision.hh
@@ -100,6 +100,9 @@ namespace paludis
class PALUDIS_VISIBLE ChangeOrRemoveDecision :
public Decision
{
+ public:
+ static const std::tr1::shared_ptr<ChangeOrRemoveDecision> deserialise(
+ Deserialisation & d) PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE ChangesToMakeDecision :