libzypp  10.5.0
SolverQueueItemInstallOneOf.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
00002 /* QueueItem.h
00003  *
00004  * Copyright (C) 2008 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_QUEUEITEMINSTALLONEOF_H
00022 #define ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALLONEOF_H
00023 
00024 #include <iosfwd>
00025 #include <string>
00026 
00027 #include "zypp/solver/detail/SolverQueueItem.h"
00028 
00030 namespace zypp
00031 { 
00032 
00033   namespace solver
00034   { 
00035 
00036     namespace detail
00037     { 
00038 
00040 //
00041 //      CLASS NAME : SolverQueueItemInstallOneOf
00042 
00043 class SolverQueueItemInstallOneOf : public SolverQueueItem {
00044 
00045   public:
00046     typedef std::list<PoolItem> PoolItemList;
00047     
00048   private:
00049 
00050     PoolItemList _oneOfList; // List of candidates
00051     bool _soft;          // if triggered by a soft requirement (a recommends)    
00052 
00053   public:
00054 
00055     SolverQueueItemInstallOneOf (const ResPool & pool, const PoolItemList & itemList, bool soft = false);
00056     virtual ~SolverQueueItemInstallOneOf();
00057     
00058     // ---------------------------------- I/O
00059 
00060     virtual std::ostream & dumpOn( std::ostream & str ) const;
00061 
00062     friend std::ostream& operator<<(std::ostream & str, const SolverQueueItemInstallOneOf & obj)
00063     { return obj.dumpOn (str); }
00064 
00065     // ---------------------------------- accessors
00066 
00067     bool isSoft (void) const { return _soft; }    
00068     
00069     // ---------------------------------- methods
00070 
00071     virtual bool addRule (_Queue & q);    
00072     virtual SolverQueueItem_Ptr copy (void) const;
00073     virtual int cmp (SolverQueueItem_constPtr item) const;
00074 };
00075 
00077     };// namespace detail
00080   };// namespace solver
00083 };// namespace zypp
00085 
00086 #endif // ZYPP_SOLVER_DETAIL_QUEUEITEMINSTALLONEOF_H