Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / solver / detail / SolverQueueItem.cc
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* SolverQueueItem.cc
3  *
4  * Copyright (C) 2008 SUSE Linux Products GmbH
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18  * 02111-1307, USA.
19  */
20 extern "C"
21 {
22 #include <solv/solver.h>
23 }
24
25 #define ZYPP_USE_RESOLVER_INTERNALS
26
27 #include "zypp/base/Logger.h"
28 #include "zypp/solver/detail/SolverQueueItem.h"
29
30 /////////////////////////////////////////////////////////////////////////
31 namespace zypp
32 { ///////////////////////////////////////////////////////////////////////
33   ///////////////////////////////////////////////////////////////////////
34   namespace solver
35   { /////////////////////////////////////////////////////////////////////
36     /////////////////////////////////////////////////////////////////////
37     namespace detail
38     { ///////////////////////////////////////////////////////////////////
39
40 using namespace std;
41
42 IMPL_PTR_TYPE(SolverQueueItem);
43
44 //---------------------------------------------------------------------------
45
46 std::ostream &
47 SolverQueueItem::dumpOn( std::ostream & os ) const
48 {
49     switch (_type) {
50       case QUEUE_ITEM_TYPE_UNKNOWN       :      os << "unknown"; break;
51       case QUEUE_ITEM_TYPE_UPDATE        :      os << "update"; break;
52       case QUEUE_ITEM_TYPE_LOCK          :      os << "lock"; break;
53       case QUEUE_ITEM_TYPE_INSTALL       :      os << "install"; break;
54       case QUEUE_ITEM_TYPE_DELETE        :      os << "delete"; break;
55       case QUEUE_ITEM_TYPE_INSTALL_ONE_OF:      os << "install one of"; break;
56       default: os << "?solverqueueitem?"; break;
57     }
58     return os;
59 }
60
61
62 ostream&
63 operator<<( ostream & os, const SolverQueueItemList & itemlist )
64 {
65     for (SolverQueueItemList::const_iterator iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
66         if (iter != itemlist.begin())
67             os << "," << endl << "\t";
68         os << **iter;
69     }
70     return os;
71 }
72
73 //---------------------------------------------------------------------------
74
75 SolverQueueItem::SolverQueueItem (SolverQueueItemType type, const ResPool & pool)
76     : _type (type)
77     , _pool (pool)
78 {
79 }
80
81
82 SolverQueueItem::~SolverQueueItem()
83 {
84 }
85
86 //---------------------------------------------------------------------------
87
88 void
89 SolverQueueItem::copy (const SolverQueueItem *from)
90 {
91 }
92
93
94 //---------------------------------------------------------------------------
95
96
97 ///////////////////////////////////////////////////////////////////
98     };// namespace detail
99     /////////////////////////////////////////////////////////////////////
100     /////////////////////////////////////////////////////////////////////
101   };// namespace solver
102   ///////////////////////////////////////////////////////////////////////
103   ///////////////////////////////////////////////////////////////////////
104 };// namespace zypp
105 /////////////////////////////////////////////////////////////////////////