As we need some serial number indicating a changed ResPool content, I added 2 simple classes SerialNumber and SerialNumberWatcher to zypp/base/SerialNumber.h This should be ok for a simple polling solution. /////////////////////////////////////////////////////////////////// // // CLASS NAME : SerialNumber // /** Simple serial number provider. * * \ref serial returns a serial number. The number returned stays * the same unless \ref setDirty was called to bring the object * into \c dirty state. The next call to \ref serial will increment * the serial number and bring the object into \c clean state. * * \code * SerialNumber sno; * sno.serial(); // SERIAL(0); () = clean * sno.setDirty(); // SERIAL*0*; ** = dirty * sno.serial(); // SERIAL(1) * sno.setDirty(); // SERIAL*1* * sno.setDirty(); // SERIAL*1* * sno.serial(); // SERIAL(2) * \endcode */ /////////////////////////////////////////////////////////////////// // // CLASS NAME : SerialNumberWatcher // /** Simple serial number watcher. * * \ref SerialNumberWatcher remembers a serial number * and tells whenever new numbers you feed change. * * All methods are overloaded to take an \unsigned or a * <tt>const SerialNumber &</tt> as argument. * * \code * SerialNumber sno; * * void check() * { * static SerialNumberWatcher watcher( sno ); * * if ( watcher.remember( sno ) ) * { * cout << "Serial number changed." << endl; * } * } * * int main() * { * check(); // * check(); // * sno.dirty(); * check(); // "Serial number changed." * check(); // * check(); // * sno.dirty(); * check(); // "Serial number changed." * \endcode */ -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org