24#include <zypp/base/LogTools.h>
41 inline bool solutionInList(
const ProblemSolutionList & solutions_r,
const ProblemSolution_Ptr & solution_r )
43 for (
const ProblemSolution_Ptr & solution : solutions_r )
45 if ( solution->description() == solution_r->description()
46 && solution->details() == solution_r->details()
47 && solution->actions().size() == solution_r->actions().size() )
85 friend Impl * rwcowClone<Impl>(
const Impl * rhs );
88 {
return new Impl( *
this ); }
93 : _pimpl( new
Impl() )
97 : _pimpl( new
Impl(
std::move(description) ) )
101 : _pimpl( new
Impl(
std::move(description),
std::move(details) ) )
105 : _pimpl( new
Impl(
std::move(description),
std::move(details),
std::move(completeProblemInfo) ) )
113 {
return _pimpl->_description; }
116 {
return _pimpl->_details; }
119 {
return _pimpl->_solutions; }
122 {
return _pimpl->_completeProblemInfo; }
132 if ( ! solutionInList(
_pimpl->_solutions, solution ) )
135 {
_pimpl->_solutions.push_front( solution ); }
137 {
_pimpl->_solutions.push_back( solution ); }
144 os <<
"Problem:" << endl;
145 os <<
"==============================" << endl;
148 os <<
"------------------------------" << endl;
150 os <<
"==============================" << endl;
155 {
return dumpRange( os, obj.begin(), obj.end(),
"",
"",
", ",
"",
"" ); }
Describe a solver problem and offer solutions.
const std::vector< std::string > & completeProblemInfo() const
Return a one-line description for each problematic rule in the problem tree.
void setDetails(std::string details)
Set detail description of the problem.
const std::string & description() const
Return a one-line description of the problem.
ResolverProblem()
Constructor.
RWCOW_pointer< Impl > _pimpl
const ProblemSolutionList & solutions() const
Return the possible solutions to this problem.
~ResolverProblem()
Destructor.
const std::string & details() const
Return a (possibly muti-line) detailed description of the problem or an empty string if there are no ...
void setDescription(std::string description)
Set description of the problem.
void addSolution(ProblemSolution_Ptr solution, bool inFront=false)
Add a solution to this problem.
Easy-to use interface to the ZYPP dependency resolver.
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
std::list< ResolverProblem_Ptr > ResolverProblemList
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::list< ProblemSolution_Ptr > ProblemSolutionList
ResolverProblem implementation.
Impl * clone() const
clone for RWCOW_pointer
std::vector< std::string > _completeProblemInfo
Impl(std::string &&description, std::string &&details, std::vector< std::string > &&completeProblemInfo)
Impl(std::string &&description)
ProblemSolutionList _solutions
Impl(std::string &&description, std::string &&details)
#define IMPL_PTR_TYPE(NAME)