sat/SATResolver.cc
sat/SolvAttr.cc
sat/SolverQueueItem.cc
+ sat/SolverQueueItemInstall.cc
+ sat/SolverQueueItemDelete.cc
+ sat/SolverQueueItemUpdate.cc
+ sat/SolverQueueItemInstallOneOf.cc
)
SET( zypp_sat_HEADERS
sat/LookupAttr.h
sat/SATResolver.h
sat/SolverQueueItem.h
+ sat/SolverQueueItemInstall.h
+ sat/SolverQueueItemDelete.h
+ sat/SolverQueueItemUpdate.h
+ sat/SolverQueueItemInstallOneOf.h
sat/SolvAttr.h
)
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 : os << "install"; break;
+ case QUEUE_ITEM_TYPE_DELETE : os << "delete"; break;
case QUEUE_ITEM_TYPE_INSTALL_ONE_OF: os << "install one of"; break;
default: os << "?solverqueueitem?"; break;
}
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/NonCopyable.h"
#include "zypp/base/PtrTypes.h"
-
#include "zypp/ResPool.h"
-
/////////////////////////////////////////////////////////////////////////
namespace zypp
{ ///////////////////////////////////////////////////////////////////////
typedef enum {
QUEUE_ITEM_TYPE_UNKNOWN = 0,
QUEUE_ITEM_TYPE_UPDATE,
- QUEUE_ITEM_TYPE_REQUIRE,
- QUEUE_ITEM_TYPE_CONFLICT,
+ QUEUE_ITEM_TYPE_INSTALL,
+ QUEUE_ITEM_TYPE_DELETE,
QUEUE_ITEM_TYPE_INSTALL_ONE_OF,
} SolverQueueItemType;
void copy (const SolverQueueItem *from);
- bool isConflict (void) const { return _type == QUEUE_ITEM_TYPE_CONFLICT; }
- bool isRequire (void) const { return _type == QUEUE_ITEM_TYPE_REQUIRE; }
+ bool isDelete (void) const { return _type == QUEUE_ITEM_TYPE_DELETE; }
+ bool isInstall (void) const { return _type == QUEUE_ITEM_TYPE_INSTALL; }
bool isUpdate (void) const { return _type == QUEUE_ITEM_TYPE_UPDATE; }
bool isInstallOneOf (void) const { return _type == QUEUE_ITEM_TYPE_INSTALL_ONE_OF; }
--- /dev/null
+/* -*- 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/SolverQueueItemDelete.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolverQueueItemDelete);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+SolverQueueItemDelete::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Delete: ";
+ os << _name;
+
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItemDelete::SolverQueueItemDelete (const ResPool & pool, std::string name, bool soft)
+ : SolverQueueItem (QUEUE_ITEM_TYPE_DELETE, pool)
+ , _name (name)
+ , _soft (soft)
+{
+}
+
+
+SolverQueueItemDelete::~SolverQueueItemDelete()
+{
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItem_Ptr
+SolverQueueItemDelete::copy (void) const
+{
+ SolverQueueItemDelete_Ptr new_delete = new SolverQueueItemDelete (pool(), _name);
+ new_delete->SolverQueueItem::copy(this);
+
+ new_delete->_soft = _soft;
+ return new_delete;
+}
+
+
+//---------------------------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
--- /dev/null
+/* -*- 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_QUEUEITEMDELETE_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEMDELETE_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/sat/SolverQueueItem.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+DEFINE_PTR_TYPE(SolverQueueItemDelete);
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : SolverQueueItemDelete
+
+class SolverQueueItemDelete : public SolverQueueItem {
+
+ private:
+
+ std::string _name;
+ bool _soft; // if triggered by a soft requirement (a recommends)
+
+ public:
+
+ SolverQueueItemDelete (const ResPool & pool, std::string name, bool soft = false);
+ virtual ~SolverQueueItemDelete();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemDelete & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ bool isSoft (void) const { return _soft; }
+
+ // ---------------------------------- methods
+
+ virtual SolverQueueItem_Ptr copy (void) const;
+ virtual int cmp (SolverQueueItem_constPtr item) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEMDELETE_H
--- /dev/null
+/* -*- 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/SolverQueueItemInstall.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolverQueueItemInstall);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+SolverQueueItemInstall::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Install: ";
+ os << _name;
+
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItemInstall::SolverQueueItemInstall (const ResPool & pool, std::string name, bool soft)
+ : SolverQueueItem (QUEUE_ITEM_TYPE_INSTALL, pool)
+ , _name (name)
+ , _soft (soft)
+{
+}
+
+
+SolverQueueItemInstall::~SolverQueueItemInstall()
+{
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItem_Ptr
+SolverQueueItemInstall::copy (void) const
+{
+ SolverQueueItemInstall_Ptr new_install = new SolverQueueItemInstall (pool(), _name);
+ new_install->SolverQueueItem::copy(this);
+
+ new_install->_soft = _soft;
+ return new_install;
+}
+
+
+//---------------------------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
--- /dev/null
+/* -*- 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_QUEUEITEMINSTALL_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALL_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/sat/SolverQueueItem.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+DEFINE_PTR_TYPE(SolverQueueItemInstall);
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : SolverQueueItemInstall
+
+class SolverQueueItemInstall : public SolverQueueItem {
+
+ private:
+
+ std::string _name;
+ bool _soft; // if triggered by a soft requirement (a recommends)
+
+ public:
+
+ SolverQueueItemInstall (const ResPool & pool, std::string name, bool soft = false);
+ virtual ~SolverQueueItemInstall();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemInstall & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ bool isSoft (void) const { return _soft; }
+
+ // ---------------------------------- methods
+
+ virtual SolverQueueItem_Ptr copy (void) const;
+ virtual int cmp (SolverQueueItem_constPtr item) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALL_H
--- /dev/null
+/* -*- 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/SolverQueueItemInstallOneOf.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolverQueueItemInstallOneOf);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+SolverQueueItemInstallOneOf::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "InstallOneOf: ";
+ for (PoolItemList::const_iterator iter = _oneOfList.begin();
+ iter != _oneOfList.end();
+ iter++)
+ os << *iter;
+
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItemInstallOneOf::SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList, bool soft)
+ : SolverQueueItem (QUEUE_ITEM_TYPE_INSTALL_ONE_OF, pool)
+ , _oneOfList (itemList)
+ , _soft (soft)
+{
+}
+
+
+SolverQueueItemInstallOneOf::~SolverQueueItemInstallOneOf()
+{
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItem_Ptr
+SolverQueueItemInstallOneOf::copy (void) const
+{
+ SolverQueueItemInstallOneOf_Ptr new_installOneOf = new SolverQueueItemInstallOneOf (pool(), _oneOfList, _soft);
+ new_installOneOf->SolverQueueItem::copy(this);
+
+ new_installOneOf->_soft = _soft;
+ return new_installOneOf;
+}
+
+
+//---------------------------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
--- /dev/null
+/* -*- 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_QUEUEITEMINSTALLONEOF_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALLONEOF_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/sat/SolverQueueItem.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+DEFINE_PTR_TYPE(SolverQueueItemInstallOneOf);
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : SolverQueueItemInstallOneOf
+
+class SolverQueueItemInstallOneOf : public SolverQueueItem {
+
+ public:
+ typedef std::list<PoolItem> PoolItemList;
+
+ private:
+
+ PoolItemList _oneOfList; // List of candidates
+ bool _soft; // if triggered by a soft requirement (a recommends)
+
+ public:
+
+ SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList, bool soft = false);
+ virtual ~SolverQueueItemInstallOneOf();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemInstallOneOf & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ bool isSoft (void) const { return _soft; }
+
+ // ---------------------------------- methods
+
+ virtual SolverQueueItem_Ptr copy (void) const;
+ virtual int cmp (SolverQueueItem_constPtr item) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALLONEOF_H
--- /dev/null
+/* -*- 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/SolverQueueItemUpdate.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+using namespace std;
+
+IMPL_PTR_TYPE(SolverQueueItemUpdate);
+
+//---------------------------------------------------------------------------
+
+std::ostream &
+SolverQueueItemUpdate::dumpOn( std::ostream & os ) const
+{
+ os << "[" << (_soft?"Soft":"") << "Update: ";
+ os << _item;
+
+ return os;
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItemUpdate::SolverQueueItemUpdate (const ResPool & pool,
+ const PoolItem & item, bool soft)
+ : SolverQueueItem (QUEUE_ITEM_TYPE_UPDATE, pool)
+ , _item (item)
+ , _soft (soft)
+{
+}
+
+
+SolverQueueItemUpdate::~SolverQueueItemUpdate()
+{
+}
+
+//---------------------------------------------------------------------------
+
+SolverQueueItem_Ptr
+SolverQueueItemUpdate::copy (void) const
+{
+ SolverQueueItemUpdate_Ptr new_update = new SolverQueueItemUpdate (pool(), _item);
+ new_update->SolverQueueItem::copy(this);
+
+ new_update->_soft = _soft;
+ return new_update;
+}
+
+
+//---------------------------------------------------------------------------
+
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
--- /dev/null
+/* -*- 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_QUEUEITEMUPDATE_H
+#define ZYPP_SOLVER_DETAIL_QUEUEITEMUPDATE_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/sat/SolverQueueItem.h"
+#include "zypp/PoolItem.h"
+
+/////////////////////////////////////////////////////////////////////////
+namespace zypp
+{ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+ namespace solver
+ { /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ namespace detail
+ { ///////////////////////////////////////////////////////////////////
+
+DEFINE_PTR_TYPE(SolverQueueItemUpdate);
+
+
+///////////////////////////////////////////////////////////////////
+//
+// CLASS NAME : SolverQueueItemUpdate
+
+class SolverQueueItemUpdate : public SolverQueueItem {
+
+ private:
+
+ PoolItem _item; // the item to-be-updated
+ bool _soft; // if triggered by a soft requirement (a recommends)
+
+ public:
+
+ SolverQueueItemUpdate (const ResPool & pool, const PoolItem & item, bool soft = false);
+ virtual ~SolverQueueItemUpdate();
+
+ // ---------------------------------- I/O
+
+ virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemUpdate & obj)
+ { return obj.dumpOn (str); }
+
+ // ---------------------------------- accessors
+
+ bool isSoft (void) const { return _soft; }
+
+ // ---------------------------------- methods
+
+ virtual SolverQueueItem_Ptr copy (void) const;
+ virtual int cmp (SolverQueueItem_constPtr item) const;
+};
+
+///////////////////////////////////////////////////////////////////
+ };// namespace detail
+ /////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////
+ };// namespace solver
+ ///////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////
+};// namespace zypp
+/////////////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_SOLVER_DETAIL_QUEUEITEMUPDATE_H