Josef Reidinger wrote:
Ok, so I only make seriazeble and deseriazable of PoolQuery (may I use
and <)...and add saveQueriesToFile and LoadQueriesFromFile functions which move between container(of queries) and file. Rest of handling with locks I relinguish to pool (like make locks container, adding and removing from container or locking solvables from queries). Is this what you mean?
When I do this I get idea what about make universal serializeToFile
function which take as input iterators to object which have operator<<
and also recoveryFromFile. It can be part of base
something like this
template <class InputIter>
void serializeToFile( InputIter begin, InputIter end, const Pathname &file){
ofstream s( file.c_str(),ofstream::trunc | ofstream::out );
s.exceptions( ofstream::bad );
try {
copy(begin,end,ostream_iterator ii(locks, locks.end());
recoveryFromFile<PoolQuery>( "/etc/zypp/locks", ii);
//save to file
serializeToFile(locks.begin(),locks.end(),"/etc/zypp/locks");
and thats all
What do you think about this?
Pepa
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-devel+help@opensuse.org