00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* QueueItemConflict.h 00003 * 00004 * Copyright (C) 2000-2002 Ximian, Inc. 00005 * Copyright (C) 2005 SUSE Linux Products GmbH 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License, 00009 * version 2, as published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00019 * 02111-1307, USA. 00020 */ 00021 00022 #ifndef ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H 00023 #define ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H 00024 00025 #include <iosfwd> 00026 #include <list> 00027 #include <string> 00028 00029 #include "zypp/solver/detail/Types.h" 00030 #include "zypp/solver/detail/QueueItem.h" 00031 00032 #include "zypp/Capability.h" 00033 00035 namespace zypp 00036 { 00037 00038 namespace solver 00039 { 00040 00041 namespace detail 00042 { 00043 00045 // 00046 // CLASS NAME : QueueItemConflict 00047 00048 class QueueItemConflict : public QueueItem { 00049 00050 00051 private: 00052 const Capability _capability; // the conflicting capability 00053 PoolItem_Ref _conflicting_item; // the item which issued the conflict, can be 'empty' for 'extraConflicts' 00054 bool _soft; 00055 00056 bool _actually_an_obsolete; 00057 00058 public: 00059 00060 QueueItemConflict (const ResPool & pool, const Capability & capability, PoolItem_Ref item, bool soft = false); 00061 virtual ~QueueItemConflict(); 00062 00063 // ---------------------------------- I/O 00064 00065 virtual std::ostream & dumpOn( std::ostream & str ) const; 00066 00067 friend std::ostream& operator<<(std::ostream & str, const QueueItemConflict & obj) 00068 { return obj.dumpOn (str); } 00069 00070 // ---------------------------------- accessors 00071 00072 const Capability & capability (void) const { return _capability; } 00073 bool isSoft (void) const { return _soft; } 00074 bool actuallyAnObsolete (void) const { return _actually_an_obsolete; } 00075 void setActuallyAnObsolete (void) { _actually_an_obsolete = true; } 00076 00077 // ---------------------------------- methods 00078 00079 virtual bool process (ResolverContext_Ptr context, QueueItemList & qil); 00080 virtual QueueItem_Ptr copy (void) const; 00081 virtual int cmp (QueueItem_constPtr item) const; 00082 virtual bool isRedundant (ResolverContext_Ptr context) const { return false; } 00083 virtual bool isSatisfied (ResolverContext_Ptr context) const { return false; } 00084 00085 }; 00086 00088 };// namespace detail 00091 };// namespace solver 00094 };// namespace zypp 00096 #endif // ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H