00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* ResolverQueue.h 00003 * 00004 * Copyright (C) 2007 SUSE Linux Products GmbH 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License, 00008 * version 2, as published by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 00018 * 02111-1307, USA. 00019 */ 00020 00021 #ifndef ZYPP_SOLVER_DETAIL_CONTEXTPOOL_H 00022 #define ZYPP_SOLVER_DETAIL_CONTEXTPOOL_H 00023 00024 #include <iosfwd> 00025 #include <list> 00026 #include <map> 00027 #include <string> 00028 00029 #include "zypp/base/ReferenceCounted.h" 00030 #include "zypp/base/NonCopyable.h" 00031 #include "zypp/base/PtrTypes.h" 00032 00033 #include "zypp/solver/detail/Types.h" 00034 #include "zypp/solver/detail/QueueItem.h" 00035 00036 #include "zypp/Capability.h" 00037 00039 namespace zypp 00040 { 00041 00042 namespace solver 00043 { 00044 00045 namespace detail 00046 { 00047 00048 00049 typedef std::list <ResolverContext_Ptr> ResolverContextList; 00050 00052 // 00053 // CLASS NAME : ContextPool 00061 class ContextPool : public base::ReferenceCounted, private base::NonCopyable { 00062 00063 private: 00065 unsigned maxContext; 00067 ResolverContextList contextList; 00068 00069 public: 00070 ContextPool (); 00076 ContextPool (const int maxCount); 00077 virtual ~ContextPool(); 00078 00079 // ---------------------------------- I/O 00080 00081 friend std::ostream& operator<<(std::ostream&, const ContextPool & contextPool); 00082 00083 00084 // ---------------------------------- methods 00089 int contextListSize() const { return contextList.size(); } 00100 void addContext (ResolverContext_Ptr context, 00101 const PoolItemList & installItems, 00102 const PoolItemList & deleteItems, 00103 const PoolItemList & lockUninstalledItems, 00104 const PoolItemList & keepItems); 00115 ResolverContext_Ptr findContext (PoolItemList & installItems, 00116 PoolItemList & deleteItems, 00117 const PoolItemList & lockUninstalledItems, 00118 const PoolItemList & keepItems); 00119 00124 void reset () { contextList.clear(); } 00125 00126 }; 00128 };// namespace detail 00131 };// namespace solver 00134 };// namespace zypp 00136 00137 #endif // ZYPP_SOLVER_DETAIL_CONTEXTPOOL_H 00138
1.5.3