New Solvable::isKind overload to test whether a Solvable is within a range of kinds.
authorMichael Andres <ma@suse.de>
Fri, 10 Apr 2009 11:19:27 +0000 (13:19 +0200)
committerMichael Andres <ma@suse.de>
Thu, 16 Apr 2009 11:14:59 +0000 (13:14 +0200)
zypp/sat/Solvable.h

index d0bbd01..68fbf59 100644 (file)
@@ -149,12 +149,19 @@ namespace zypp
         IdString     ident()    const;
 
         ResKind      kind()     const;
-        /** Test whether a Solvable is of a certain \ref ResKind. */
-        bool         isKind( const ResKind & kind_r ) const;
+        /** Test whether a Solvable is of a certain \ref ResKind.
+        * The test is far cheaper than actually retriveing and
+         * comparing the \ref kind.
+        */
+        bool isKind( const ResKind & kind_r ) const;
         /** \overload */
         template<class _Res>
         bool isKind() const
         { return isKind( resKind<_Res>() ); }
+        /** \overload Extend the test to a range of \ref ResKind. */
+        template<class _Iterator>
+        bool isKind( _Iterator begin, _Iterator end )
+        { for_( it, begin, end ) if ( isKind( *it ) ) return true; return false; }
 
         std::string  name()     const;
         Edition      edition()  const;