Imported Upstream version 14.45.0
[platform/upstream/libzypp.git] / zypp / sat / SolvableSet.h
index cd177bc..daa8ebd 100644 (file)
@@ -15,7 +15,7 @@
 #include <iosfwd>
 
 #include "zypp/base/PtrTypes.h"
-#include "zypp/base/Hash.h"
+#include "zypp/base/Tr1hash.h"
 #include "zypp/sat/Solvable.h"
 #include "zypp/sat/SolvIterMixin.h"
 
@@ -30,14 +30,14 @@ namespace zypp
     //
     // CLASS NAME : SolvableSet
     //
-    /** Solvable set wrapper to allow adding additional convenience iterators.
+    /** Solvable set wrapper to allow adding additioanal convenience iterators.
      */
-    class SolvableSet : public SolvIterMixin<SolvableSet,std::unordered_set<Solvable>::const_iterator>
+    class SolvableSet : public SolvIterMixin<SolvableSet,std::tr1::unordered_set<Solvable>::const_iterator>
     {
       friend std::ostream & operator<<( std::ostream & str, const SolvableSet & obj );
 
       public:
-        typedef std::unordered_set<Solvable> Container;
+        typedef std::tr1::unordered_set<Solvable> Container;
         typedef Container::value_type             value_type;
         typedef Container::size_type              size_type;
         typedef Solvable_iterator                 const_iterator; // from SolvIterMixin
@@ -49,8 +49,8 @@ namespace zypp
         {}
 
         /** Ctor building a set from a range. */
-        template<class TInputIterator>
-        SolvableSet( TInputIterator begin_r, TInputIterator end_r )
+        template<class _InputIterator>
+        SolvableSet( _InputIterator begin_r, _InputIterator end_r )
         : _pimpl( new Container( begin_r, end_r ) )
         {}
 
@@ -64,9 +64,9 @@ namespace zypp
         { return _pimpl->size(); }
 
        /** */
-       template<class TSolv>
-       bool contains( const TSolv & solv_r ) const
-       { return( get().count( asSolvable()( solv_r ) ) ); }
+       template<class _Solv>
+       bool contains( const _Solv & solv_r ) const
+       { return( get().find( asSolvable()( solv_r ) ) != end() ); }
 
         /** Iterator pointing to the first \ref Solvable. */
         const_iterator begin() const
@@ -77,22 +77,14 @@ namespace zypp
         { return _pimpl->end(); }
 
       public:
-       /** Clear the container */
-       void clear()
-       { get().clear(); }
 
        /** Insert a Solvable.
         * \return \c true if it was actually inserted, or \c false if already present.
-        */
-       template<class TSolv>
-       bool insert( const TSolv & solv_r )
+       */
+       template<class _Solv>
+       bool insert( const _Solv & solv_r )
        { return get().insert( asSolvable()( solv_r ) ).second; }
 
-       /** Insert a range of Solvables. */
-       template<class TIterator>
-       void insert( TIterator begin_r, TIterator end_r )
-       { for_( it, begin_r, end_r ) insert( *it ); }
-
       public:
         /** The set. */
         Container & get()