Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / solver / detail / ProblemSolutionCombi.h
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* Resolver_problems.cc
3  *
4  * Copyright (C) 2000-2002 Ximian, Inc.
5  * Copyright (C) 2005 SUSE Linux Products GmbH
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21
22 #ifndef ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
23 #define ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONINSTALL_H
24 #ifndef ZYPP_USE_RESOLVER_INTERNALS
25 #error Do not directly include this file!
26 #else
27
28 #include <string>
29
30 #include "zypp/ProblemSolution.h"
31 #include "zypp/solver/detail/SolutionAction.h" // TransactionKind
32
33 /////////////////////////////////////////////////////////////////////////
34 namespace zypp
35 {
36   ///////////////////////////////////////////////////////////////////////
37   namespace solver
38   {
39     /////////////////////////////////////////////////////////////////////
40     namespace detail
41     {
42       /////////////////////////////////////////////////////////////////////////
43       /// \class ProblemSolutionCombi
44       /// \brief Class representing one possible solution to one problem found during resolving.
45       ///
46       /// This problem solution is a combination of different actions,
47       /// e.G. install, delete, keep different resolvables.
48       /////////////////////////////////////////////////////////////////////////
49       class ProblemSolutionCombi : public ProblemSolution
50       {
51       public:
52         /** Constructor. */
53         ProblemSolutionCombi();
54
55         /**
56          * Add a single action of an item
57          */
58         void addSingleAction( PoolItem item, TransactionKind action );
59
60         /**
61          * Add a single action of a capability
62          */
63         void addSingleAction( Capability capability, TransactionKind action );
64
65         /**
66          * Add a single action of a SolverQueueItem
67          */
68         void addSingleAction( SolverQueueItem_Ptr item, TransactionKind action );
69
70         /**
71          * returns the number of actions
72          */
73         size_t actionCount()
74         { return actions().size(); }
75
76         /**
77          * Set description text (append)
78          */
79         void addDescription( std::string description )
80         { pushDescriptionDetail( std::move(description) ); }
81
82         /**
83          * Set description text (prepend)
84          */
85         void addFrontDescription( std::string description )
86         { pushDescriptionDetail( std::move(description), /*front*/true ); }
87       };
88
89     } // namespace detail
90     /////////////////////////////////////////////////////////////////////
91   } // namespace solver
92   ///////////////////////////////////////////////////////////////////////
93 } // namespace zypp
94 /////////////////////////////////////////////////////////////////////////
95 #endif // ZYPP_USE_RESOLVER_INTERNALS
96 #endif // ZYPP_SOLVER_DETAIL_PROBLEMSOLUTIONAINSTALL_H
97