libzypp  17.32.4
ProblemSolution.h
Go to the documentation of this file.
1 
9 #ifndef ZYPP_PROBLEMSOLUTION_H
10 #define ZYPP_PROBLEMSOLUTION_H
11 
12 #include <set>
13 #include <list>
14 #include <string>
15 #include <optional>
16 
17 #include <zypp/PoolItem.h>
18 #include <zypp/ProblemTypes.h>
19 #include <zypp/ResolverProblem.h>
20 
22 namespace zypp
23 {
41  {
42  public:
43  using SolutionAction_Ptr = solver::detail::SolutionAction_Ptr;
45 
48 
50  ProblemSolution( std::string description );
51 
53  ProblemSolution( std::string description, std::string details );
54 
56  ~ProblemSolution() override;
57 
58 
62  const std::string & description() const;
63 
68  const std::string & details() const;
69 
73  const SolutionActionList & actions() const;
74 
78  void setDescription( std::string description );
79 
83  void setDetails( const std::string& details );
84 
88  void pushDescriptionDetail( std::string description, bool front = false );
89 
90 
94  void addAction( const SolutionAction_Ptr& action );
95 
96  public:
98  bool skipsPatchesOnly() const;
99 
100 #ifdef __cpp_lib_optional // YAST/PK explicitly use c++11 until 15-SP3
101 
102  std::optional<std::set<PoolItem>> getIfSkipsPatchesOnly() const;
103 #endif
104 
105  private:
106  struct Impl;
108  };
109 
111  std::ostream& operator<<(std::ostream&, const ProblemSolution & obj );
112 
114  std::ostream& operator<<(std::ostream&, const ProblemSolutionList & obj );
115 
116 } // namespace zypp
118 #endif // ZYPP_PROBLEMSOLUTION_H
119 
const SolutionActionList & actions() const
Return the list of actions forming this solution.
RWCOW_pointer< Impl > _pimpl
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
ProblemSolution()
Constructor.
const std::string & details() const
Return a (possibly multi-line) detailed description of this solution or an empty string if there are ...
solver::detail::SolutionAction_Ptr SolutionAction_Ptr
solver::detail::SolutionActionList SolutionActionList
void setDetails(const std::string &details)
Set detail description of the solution.
Base class for reference counted objects.
void addAction(const SolutionAction_Ptr &action)
Add an action to the actions list.
~ProblemSolution() override
Destructor.
void setDescription(std::string description)
Set description of the solution.
bool skipsPatchesOnly() const
The solution contains only &#39;do not install patch:&#39; actions.
std::list< SolutionAction_Ptr > SolutionActionList
Definition: Types.h:48
ProblemSolution implementation.
const std::string & description() const
Return a one-line text description of this solution.
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
void pushDescriptionDetail(std::string description, bool front=false)
Collect multiple action descriptions in details (NL separated)
Class representing one possible solution to a problem found during resolving.
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43