libzypp  13.10.6
zypp::Repository::EraseFromPool Struct Reference

Functor removing Repository from it's Pool. More...

#include <Repository.h>

Public Member Functions

void operator() (Repository repository_r) const
 

Detailed Description

Functor removing Repository from it's Pool.

E.g. used as dispose function in. AutoDispose to provide a convenient and exception safe temporary Repository.

* sat::Pool satpool;
* MIL << "1 " << satpool << endl;
* {
* AutoDispose<Repository> tmprepo( (Repository::EraseFromPool()) );
* *tmprepo = satpool.reposInsert( "A" );
* tmprepo->addSolv( "sl10.1-beta7-packages.solv" );
* DBG << "2 " << satpool << endl;
* // Calling 'tmprepo.resetDispose();' here
* // would keep the Repo.
* }
* MIL << "3 " << satpool << endl;
*
* 1 sat::pool(){0repos|2slov}
* 2 sat::pool(){1repos|2612slov}
* 3 sat::pool(){0repos|2slov}
*

Leaving the block without calling tmprepo.resetDispose(); before, will automatically remove the Repo from it's Pool.

Definition at line 385 of file Repository.h.

Member Function Documentation

void zypp::Repository::EraseFromPool::operator() ( Repository  repository_r) const
inline

Definition at line 387 of file Repository.h.


The documentation for this struct was generated from the following file: