libzypp  13.10.6
SolutionAction.h
Go to the documentation of this file.
1 /*
2  *
3  * Easy-to use interface to the ZYPP dependency resolver
4  *
5  * Author: Stefan Hundhammer <sh@suse.de>
6  *
7  **/
8 
9 #ifndef ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
10 #define ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
11 
12 #include <list>
13 #include <string>
14 
16 #include "zypp/base/PtrTypes.h"
17 
18 #include "zypp/Dep.h"
19 #include "zypp/Capability.h"
20 
24 
26 namespace zypp
27 {
28  namespace solver
30  {
31  namespace detail
33  {
34 
39  {
40  protected:
41  SolutionAction ();
42  public:
43  virtual ~SolutionAction();
44 
45  // ---------------------------------- I/O
46  virtual std::ostream & dumpOn( std::ostream & str ) const;
47  friend std::ostream& operator<<(std::ostream & str, const SolutionAction & action)
48  { return action.dumpOn (str); }
49  friend std::ostream& operator<<(std::ostream & str, const SolutionActionList & actionlist);
50  friend std::ostream& operator<<(std::ostream & str, const CSolutionActionList & actionlist);
51 
52  // ---------------------------------- methods
57  virtual bool execute (Resolver & resolver) const = 0;
58  };
59 
60 
66  typedef enum
67  {
78 
79 
81  {
82  public:
85  : SolutionAction(),
86  _item( item ), _action( action ) {}
87 
90  : SolutionAction(),
91  _capability( capability ), _action( action ) {}
92 
93 
94  TransactionSolutionAction( SolverQueueItem_Ptr item,
96  : SolutionAction(),
97  _solverQueueItem( item ), _action( action ) {}
98 
100  : SolutionAction(),
101  _item(), _action( action ) {}
102 
103  // ---------------------------------- I/O
104  virtual std::ostream & dumpOn( std::ostream & str ) const;
105  friend std::ostream& operator<<(std::ostream& str, const TransactionSolutionAction & action)
106  { return action.dumpOn (str); }
107 
108  // ---------------------------------- accessors
109 
110  const PoolItem item() const { return _item; }
111  const Capability capability() const { return _capability; }
112  TransactionKind action() const { return _action; }
113 
114  // ---------------------------------- methods
115  virtual bool execute(Resolver & resolver) const;
116 
117  protected:
118 
121  SolverQueueItem_Ptr _solverQueueItem;
122 
124  };
125 
126 
131  typedef enum
132  {
135 
136 
145  {
146  public:
147 
149  const InjectSolutionKind & kind)
150  : SolutionAction(),
151  _item( item ),
152  _kind( kind ) {}
153 
154  // ---------------------------------- I/O
155  virtual std::ostream & dumpOn( std::ostream & str ) const;
156  friend std::ostream& operator<<(std::ostream& str, const InjectSolutionAction & action)
157  { return action.dumpOn (str); }
158 
159  // ---------------------------------- accessors
160  const PoolItem item() const { return _item; }
161 
162  // ---------------------------------- methods
163  virtual bool execute(Resolver & resolver) const;
164 
165  protected:
168  };
169 
170 
172  };// namespace detail
175  };// namespace solver
178 };// namespace zypp
180 
181 #endif // ZYPP_SOLVER_DETAIL_SOLUTIONACTION_H
182 
virtual bool execute(Resolver &resolver) const =0
Execute this action.
InjectSolutionAction(PoolItem item, const InjectSolutionKind &kind)
A problem solution action that injects an artificial &quot;provides&quot; to the pool to satisfy open requireme...
TransactionSolutionAction(PoolItem item, TransactionKind action)
friend std::ostream & operator<<(std::ostream &str, const SolutionAction &action)
friend std::ostream & operator<<(std::ostream &str, const TransactionSolutionAction &action)
TransactionSolutionAction(SolverQueueItem_Ptr item, TransactionKind action)
Abstract base class for one action of a problem solution.
A mid layer class we should remove.
Definition: Resolver.h:101
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream &amp; operator&lt;&lt;.
virtual bool execute(Resolver &resolver) const
Execute this action.
Base class for reference counted objects.
InjectSolutionKind
Type of ignoring; currently only WEAK.
std::list< SolutionAction_constPtr > CSolutionActionList
Definition: Types.h:58
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream &amp; operator&lt;&lt;.
friend std::ostream & operator<<(std::ostream &str, const InjectSolutionAction &action)
TransactionKind
A problem solution action that performs a transaction (installs, removes, keep ...) one resolvable (package, patch, pattern, product).
A sat capability.
Definition: Capability.h:59
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream &amp; operator&lt;&lt;.
Reference to a PoolItem connecting ResObject and ResStatus.
Definition: PoolItem.h:50
TransactionSolutionAction(Capability capability, TransactionKind action)
virtual bool execute(Resolver &resolver) const
Execute this action.
std::list< SolutionAction_Ptr > SolutionActionList
Definition: Types.h:57