#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"
//
// 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
{}
/** 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 ) )
{}
{ 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
{ 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()