00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ 00002 /* ResolverInfoContainer.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_RESOLVERINFOCONTAINER_H 00023 #define ZYPP_SOLVER_DETAIL_RESOLVERINFOCONTAINER_H 00024 00025 #include "zypp/solver/detail/Types.h" 00026 #include "zypp/solver/detail/ResolverInfo.h" 00027 00029 namespace zypp 00030 { 00031 00032 namespace solver 00033 { 00034 00035 namespace detail 00036 { 00037 00039 // 00040 // CLASS NAME : ResolverInfoContainer 00041 00042 class ResolverInfoContainer : public ResolverInfo { 00043 00044 private: 00045 00046 PoolItemList _item_list; 00047 00048 protected: 00049 00050 ResolverInfoContainer (ResolverInfoType type, PoolItem_Ref initial_item, int priority, PoolItem_Ref child = PoolItem_Ref()); 00051 00052 public: 00053 virtual ~ResolverInfoContainer(); 00054 00055 void copy (ResolverInfoContainer_constPtr from); 00056 00057 // ---------------------------------- I/O 00058 00059 virtual std::ostream & dumpOn( std::ostream & str ) const; 00060 friend std::ostream& operator<<(std::ostream & str, const ResolverInfoContainer & obj) 00061 { return obj.dumpOn (str); } 00062 00063 // ---------------------------------- accessors 00064 00065 PoolItemList items (void) const { return _item_list; } 00066 00067 // ---------------------------------- methods 00068 00069 virtual bool merge (ResolverInfoContainer_Ptr to_be_merged); 00070 virtual ResolverInfo_Ptr copy (void) const; 00071 00072 std::string itemsToString (const bool names_only) const; 00073 00074 bool mentions (PoolItem_Ref item) const; 00075 void addRelatedPoolItem (PoolItem_Ref item); 00076 void addRelatedPoolItemList (const PoolItemList & items); 00077 00078 }; 00079 00081 };// namespace detail 00084 };// namespace solver 00087 };// namespace zypp 00089 #endif // ZYPP_SOLVER_DETAIL_RESOLVERINFOCONTAINER_H