1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/sat/WhatObsoletes.h
12 #ifndef ZYPP_SAT_WHATOBSOLETES_H
13 #define ZYPP_SAT_WHATOBSOLETES_H
18 #include "zypp/sat/WhatProvides.h"
20 ///////////////////////////////////////////////////////////////////
22 { /////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////
25 { /////////////////////////////////////////////////////////////////
27 ///////////////////////////////////////////////////////////////////
29 // CLASS NAME : WhatObsoletes
31 /** Container of \b installed \ref Solvable which would be
32 * obsoleted by the \ref Solvable passed to the ctor.
34 * \todo Publish obsoleteUsesProvides config option.
36 class WhatObsoletes : public SolvIterMixin<WhatObsoletes,detail::WhatProvidesIterator>,
37 protected detail::PoolMember
40 typedef Solvable value_type;
41 typedef unsigned size_type;
49 /** Ctor from \ref Solvable. */
51 WhatObsoletes( Solvable item_r );
53 /** Ctor from \ref PoolItem. */
55 WhatObsoletes( const PoolItem & item_r );
57 /** Ctor from \ref ResObject::constPtr. */
59 WhatObsoletes( const ResObject_constPtr item_r );
61 /** Ctor from a range of \ref Solvable, \ref PoolItem or \ref ResObject::constPtr. */
62 template <class _Iterator>
63 WhatObsoletes( _Iterator begin, _Iterator end )
66 for_( it, begin, end )
72 /** Whether the container is empty. */
74 { return ! ( _begin && *_begin ); }
76 /** Number of solvables inside. */
77 size_type size() const;
80 typedef detail::WhatProvidesIterator const_iterator;
82 /** Iterator pointing to the first \ref Solvable. */
83 const_iterator begin() const
84 { return const_iterator( _begin ); }
86 /** Iterator pointing behind the last \ref Solvable. */
87 const_iterator end() const
88 { return const_iterator(); }
91 void ctorAdd( const PoolItem & item_r );
92 void ctorAdd( ResObject_constPtr item_r );
93 void ctorAdd( Solvable item_r );
97 const sat::detail::IdType * _begin;
98 shared_ptr<void> _private;
100 ///////////////////////////////////////////////////////////////////
102 /** \relates WhatObsoletes Stream output */
103 std::ostream & operator<<( std::ostream & str, const WhatObsoletes & obj );
105 /////////////////////////////////////////////////////////////////
107 ///////////////////////////////////////////////////////////////////
108 /////////////////////////////////////////////////////////////////
110 ///////////////////////////////////////////////////////////////////
111 #endif // ZYPP_SAT_WHATOBSOLETES_H