Author: schubi2
Date: Mon Apr 14 11:57:01 2008
New Revision: 9602
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9602&view=rev
Log:
Add new base class for solver queue
Added:
trunk/libzypp/zypp/sat/SolverQueueItem.cc
trunk/libzypp/zypp/sat/SolverQueueItem.h
Modified:
trunk/libzypp/zypp/CMakeLists.txt
Modified: trunk/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=9602&r1=9601&r2=9602&view=diff
==============================================================================
--- trunk/libzypp/zypp/CMakeLists.txt (original)
+++ trunk/libzypp/zypp/CMakeLists.txt Mon Apr 14 11:57:01 2008
@@ -521,6 +521,7 @@
sat/LookupAttr.cc
sat/SATResolver.cc
sat/SolvAttr.cc
+ sat/SolverQueueItem.cc
)
SET( zypp_sat_HEADERS
@@ -532,6 +533,7 @@
sat/LocaleSupport.h
sat/LookupAttr.h
sat/SATResolver.h
+ sat/SolverQueueItem.h
sat/SolvAttr.h
)
Added: trunk/libzypp/zypp/sat/SolverQueueItem.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolverQueueItem.cc?rev=9602&view=auto
==============================================================================
--- trunk/libzypp/zypp/sat/SolverQueueItem.cc (added)
+++ trunk/libzypp/zypp/sat/SolverQueueItem.cc Mon Apr 14 11:57:01 2008
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* SolverQueueItem.cc
+ *
+ * Copyright (C) 2008 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#include "zypp/base/Logger.h"
+#include "zypp/sat/SolverQueueItem.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolverQueueItem);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+SolverQueueItem::dumpOn( std::ostream & os ) const
+{
+ switch (_type) {
+ case QUEUE_ITEM_TYPE_UNKNOWN : os << "unknown"; break;
+ case QUEUE_ITEM_TYPE_UPDATE : os << "update"; break;
+ case QUEUE_ITEM_TYPE_REQUIRE : os << "require"; break;
+ case QUEUE_ITEM_TYPE_CONFLICT : os << "conflict"; break;
+ case QUEUE_ITEM_TYPE_INSTALL_ONE_OF: os << "install one of"; break;
+ default: os << "?solverqueueitem?"; break;
+ }
+ return os;
+}
+
+
+ostream&
+operator<<( ostream & os, const SolverQueueItemList & itemlist )
+{
+ for (SolverQueueItemList::const_iterator iter = itemlist.begin(); iter != itemlist.end(); ++iter) {
+ if (iter != itemlist.begin())
+ os << "," << endl << "\t";
+ os << **iter;
+ }
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItem::SolverQueueItem (SolverQueueItemType type, const ResPool & pool)
+ : _type (type)
+ , _pool (pool)
+{
+}
+
+
+SolverQueueItem::~SolverQueueItem()
+{
+}
+
+//---------------------------------------------------------------------------
+
+void
+SolverQueueItem::copy (const SolverQueueItem *from)
+{
+}
+
+
+//---------------------------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
Added: trunk/libzypp/zypp/sat/SolverQueueItem.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SolverQueueItem.h?rev=9602&view=auto
==============================================================================
--- trunk/libzypp/zypp/sat/SolverQueueItem.h (added)
+++ trunk/libzypp/zypp/sat/SolverQueueItem.h Mon Apr 14 11:57:01 2008
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/* QueueItem.h
+ *
+ * Copyright (C) 2008 SUSE Linux Products GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef ZYPP_SOLVER_DETAIL_QUEUEITEM_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEM_H
+
+#include <iosfwd>
+#include <list>
+#include <string>
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/NonCopyable.h"
+#include "zypp/base/PtrTypes.h"
+
+#include "zypp/ResPool.h"
+
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+typedef enum {
+ QUEUE_ITEM_TYPE_UNKNOWN = 0,
+ QUEUE_ITEM_TYPE_UPDATE,
+ QUEUE_ITEM_TYPE_REQUIRE,
+ QUEUE_ITEM_TYPE_CONFLICT,
+ QUEUE_ITEM_TYPE_INSTALL_ONE_OF,
+} SolverQueueItemType;
+
+DEFINE_PTR_TYPE(SolverQueueItem);
+
+typedef std::list