- use each define
authorArvin Schnell <aschnell@suse.de>
Tue, 31 Jul 2007 09:11:59 +0000 (09:11 +0000)
committerArvin Schnell <aschnell@suse.de>
Tue, 31 Jul 2007 09:11:59 +0000 (09:11 +0000)
swig/ruby/ruby.i
swig/zypp.i

index 284f882..e654aa7 100644 (file)
@@ -30,7 +30,7 @@
 %mixin cls "Enumerable"; \
 %extend cls { \
     void each() { \
-       cls::iterator i = self->begin(); \
+       cls::const_iterator i = self->begin(); \
         while ( i != self->end() ) { \
            const storetype tmp = &**i; \
            rb_yield( SWIG_NewPointerObj( (void*) tmp, $descriptor(storetype), 0)); \
@@ -46,7 +46,7 @@
 %mixin cls "Enumerable"; \
 %extend cls { \
     void each() { \
-       cls::iterator i = self->begin(); \
+       cls::const_iterator i = self->begin(); \
         while ( i != self->end() ) { \
            const storetype tmp = &*i; \
            rb_yield( SWIG_NewPointerObj( (void*) tmp, $descriptor(storetype), 0)); \
     }
 }
 
-%extend ResPool {
-    void each()
-    {
-        ResPool::const_iterator i = self->begin();
-        while ( i != self->end() ) {
-            rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
-            ++i;
-        }
-    }
-}
+// %extend ResPool {
+//     void each()
+//     {
+//         ResPool::const_iterator i = self->begin();
+//         while ( i != self->end() ) {
+//             rb_yield( SWIG_NewPointerObj( (void *) &*i, SWIGTYPE_p_PoolItem_Ref, 0));
+//             ++i;
+//         }
+//     }
+// }
 
 %extend ResPool {
     void each_by_kind( const ResObject::Kind & kind_r )
index ee69252..74f21d6 100644 (file)
@@ -118,6 +118,7 @@ class intrusive_ptr {
 /* define iterators using swig macros */
 iter2( ResStore, ResObject* )
 iter3( CapSet, Capability* )
+iter3(ResPool, PoolItem_Ref*)
 auto_iterator( std::list<RepoInfo>, RepoInfo )
 
 #endif