00001 00009 #ifndef ZYPP_PROBLEMSOLUTION_H 00010 #define ZYPP_PROBLEMSOLUTION_H 00011 00012 #include <list> 00013 #include <string> 00014 00015 #include "zypp/base/ReferenceCounted.h" 00016 #include "zypp/base/PtrTypes.h" 00017 #include "zypp/Resolver.h" 00018 #include "zypp/solver/detail/Resolver.h" 00019 #include "zypp/ResolverProblem.h" 00020 #include "zypp/solver/detail/SolutionAction.h" 00021 #include "zypp/solver/detail/Types.h" 00022 00024 namespace zypp 00025 { 00026 00027 00043 class ProblemSolution : public base::ReferenceCounted 00044 { 00045 protected: 00046 00051 void clear(); 00052 00053 // 00054 // Data members 00055 // 00056 ResolverProblem_Ptr _problem; 00057 solver::detail::CSolutionActionList _actions; 00058 std::string _description; 00059 std::string _details; 00060 00061 public: 00062 00066 ProblemSolution( ResolverProblem_Ptr parent, const std::string & description, const std::string & details ); 00067 00071 ~ProblemSolution(); 00072 00073 // ---------------------------------- I/O 00074 00075 friend std::ostream& operator<<(std::ostream&, const ProblemSolution & solution); 00076 friend std::ostream& operator<<(std::ostream&, const ProblemSolutionList & solutionlist); 00077 friend std::ostream& operator<<(std::ostream&, const CProblemSolutionList & solutionlist); 00078 00079 // ---------------------------------- accessors 00083 std::string description() const { return _description; } 00084 00089 std::string details() const { return _details; } 00090 00094 ResolverProblem_Ptr problem() const { return _problem; } 00095 00096 // ---------------------------------- methods 00097 00103 bool apply (solver::detail::Resolver & resolver); 00104 00108 void addAction( solver::detail::SolutionAction_constPtr action ); 00109 00110 }; 00111 00112 00114 };// namespace zypp 00116 00117 #endif // ZYPP_PROBLEMSOLUTION_H 00118