9f3bbe7ec2bcef911bc7db1cd695793e5c77aa42
[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 #include "zypp/base/Logger.h"
26 #include "zypp/solver/detail/SolverQueueItem.h"
27
28 /////////////////////////////////////////////////////////////////////////
29 namespace zypp
30 { ///////////////////////////////////////////////////////////////////////
31   ///////////////////////////////////////////////////////////////////////
32   namespace solver
33   { /////////////////////////////////////////////////////////////////////
34     /////////////////////////////////////////////////////////////////////
35     namespace detail
36     { ///////////////////////////////////////////////////////////////////
37
38 using namespace std;
39
40 IMPL_PTR_TYPE(SolverQueueItem);
41
42 //---------------------------------------------------------------------------
43
44 std::ostream &
45 SolverQueueItem::dumpOn( std::ostream & os ) const
46 {
47     switch (_type) {
48       case QUEUE_ITEM_TYPE_UNKNOWN       :      os << "unknown"; break;
49       case QUEUE_ITEM_TYPE_UPDATE        :      os << "update"; break;
50       case QUEUE_ITEM_TYPE_LOCK          :      os << "lock"; break;
51       case QUEUE_ITEM_TYPE_INSTALL       :      os << "install"; break;
52       case QUEUE_ITEM_TYPE_DELETE        :      os << "delete"; break;
53       case QUEUE_ITEM_TYPE_INSTALL_ONE_OF:      os << "install one of"; break;
54       default: os << "?solverqueueitem?"; break;
55     }
56     return os;
57 }
58
59
60 ostream&
61 operator<<( ostream & os, const SolverQueueItemList & itemlist )
62 {
63     for (SolverQueueItemList::const_iterator iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
64         if (iter != itemlist.begin())
65             os << "," << endl << "\t";
66         os << **iter;
67     }
68     return os;
69 }
70
71 //---------------------------------------------------------------------------
72
73 SolverQueueItem::SolverQueueItem (SolverQueueItemType type, const ResPool & pool)
74     : _type (type)
75     , _pool (pool)
76 {
77 }
78
79
80 SolverQueueItem::~SolverQueueItem()
81 {
82 }
83
84 //---------------------------------------------------------------------------
85
86 void
87 SolverQueueItem::copy (const SolverQueueItem *from)
88 {
89 }
90
91
92 //---------------------------------------------------------------------------
93
94
95 ///////////////////////////////////////////////////////////////////
96     };// namespace detail
97     /////////////////////////////////////////////////////////////////////
98     /////////////////////////////////////////////////////////////////////
99   };// namespace solver
100   ///////////////////////////////////////////////////////////////////////
101   ///////////////////////////////////////////////////////////////////////
102 };// namespace zypp
103 /////////////////////////////////////////////////////////////////////////