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