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 bool _explicitly_requested; 00058 00059 public: 00060 00061 QueueItemConflict (const ResPool & pool, const Capability & capability, PoolItem_Ref item, bool soft = false); 00062 virtual ~QueueItemConflict(); 00063 00064 // ---------------------------------- I/O 00065 00066 virtual std::ostream & dumpOn( std::ostream & str ) const; 00067 00068 friend std::ostream& operator<<(std::ostream & str, const QueueItemConflict & obj) 00069 { return obj.dumpOn (str); } 00070 00071 // ---------------------------------- accessors 00072 00073 const Capability & capability (void) const { return _capability; } 00074 bool isSoft (void) const { return _soft; } 00075 bool actuallyAnObsolete (void) const { return _actually_an_obsolete; } 00076 void setActuallyAnObsolete (void) { _actually_an_obsolete = true; } 00077 void setExplicitlyRequested (void) { _explicitly_requested = true; } 00078 00079 // ---------------------------------- methods 00080 00081 virtual bool process (const QueueItemList & mainQueue, ResolverContext_Ptr context, QueueItemList & qil); 00082 virtual QueueItem_Ptr copy (void) const; 00083 virtual int cmp (QueueItem_constPtr item) const; 00084 virtual bool isRedundant (ResolverContext_Ptr context) const { return false; } 00085 virtual bool isSatisfied (ResolverContext_Ptr context) const { return false; } 00086 00087 }; 00088 00090 };// namespace detail 00093 };// namespace solver 00096 };// namespace zypp 00098 #endif // ZYPP_SOLVER_DETAIL_QUEUEITEMCONFLICT_H
1.5.3