libzypp: zypp/ProblemSolution.h Source File

libzypp 17.38.6

ProblemSolution.h
Go to the documentation of this file.
1
8
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
22namespace zypp
23{
40 class ZYPP_API ProblemSolution : public base::ReferenceCounted
41 {
42 public:
43 using SolutionAction_Ptr = solver::detail::SolutionAction_Ptr;
44 using SolutionActionList = solver::detail::SolutionActionList;
45
47 ProblemSolution();
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
102 std::optional<std::set<PoolItem>> getIfSkipsPatchesOnly() const;
103#endif
104
105 private:
106 struct Impl;
107 RWCOW_pointer<Impl> _pimpl;
108 };
109
111 std::ostream& operator<<(std::ostream&, const ProblemSolution & obj ) ZYPP_API;
112
114 std::ostream& operator<<(std::ostream&, const ProblemSolutionList & obj ) ZYPP_API;
115
116} // namespace zypp
118#endif // ZYPP_PROBLEMSOLUTION_H
119
PoolItem.h
ProblemTypes.h
ResolverProblem.h
zypp::ProblemSolution
Class representing one possible solution to a problem found during resolving.
Definition ProblemSolution.h:41
zypp::ProblemSolution::setDescription
void setDescription(std::string description)
Set description of the solution.
Definition ProblemSolution.cc:116
zypp::ProblemSolution::setDetails
void setDetails(const std::string &details)
Set detail description of the solution.
Definition ProblemSolution.cc:119
zypp::ProblemSolution::_pimpl
RWCOW_pointer< Impl > _pimpl
Definition ProblemSolution.h:107
zypp::ProblemSolution::skipsPatchesOnly
bool skipsPatchesOnly() const
The solution contains only 'do not install patch:' actions.
Definition ProblemSolution.cc:146
zypp::ProblemSolution::description
const std::string & description() const
Return a one-line text description of this solution.
Definition ProblemSolution.cc:106
zypp::ProblemSolution::SolutionAction_Ptr
solver::detail::SolutionAction_Ptr SolutionAction_Ptr
Definition ProblemSolution.h:43
zypp::ProblemSolution::ProblemSolution
ProblemSolution()
Constructor.
Definition ProblemSolution.cc:90
zypp::ProblemSolution::actions
const SolutionActionList & actions() const
Return the list of actions forming this solution.
Definition ProblemSolution.cc:112
zypp::ProblemSolution::SolutionActionList
solver::detail::SolutionActionList SolutionActionList
Definition ProblemSolution.h:44
zypp::ProblemSolution::pushDescriptionDetail
void pushDescriptionDetail(std::string description, bool front=false)
Collect multiple action descriptions in details (NL separated).
Definition ProblemSolution.cc:122
zypp::ProblemSolution::details
const std::string & details() const
Return a (possibly multi-line) detailed description of this solution or an empty string if there are ...
Definition ProblemSolution.cc:109
zypp::ProblemSolution::addAction
void addAction(const SolutionAction_Ptr &action)
Add an action to the actions list.
Definition ProblemSolution.cc:143
zypp::base::ReferenceCounted
Base class for reference counted objects.
Definition ReferenceCounted.h:35
zypp::solver::detail::SolutionActionList
std::list< SolutionAction_Ptr > SolutionActionList
Definition Types.h:48
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::ProblemSolutionList
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition ProblemTypes.h:43
zypp::ZYPP_API
const Arch Arch_empty ZYPP_API
relates: Arch This is an empty Arch represented by an empty string.
Definition Arch.h:173
zypp::operator<<
std::ostream & operator<<(std::ostream &str, const Capabilities &obj)
relates: Capabilities Stream output
Definition Capabilities.cc:65
zypp::ProblemSolution::Impl
ProblemSolution implementation.
Definition ProblemSolution.cc:46
zypp::RWCOW_pointer
RW_pointer supporting 'copy on write' functionality.
Definition PtrTypes.h:469