libzypp: zypp::Repository::EraseFromPool Struct Reference

libzypp 17.25.10

Public Member Functions | List of all members
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;
DBG
#define DBG
Definition: Logger.h:90
MIL
#define MIL
Definition: Logger.h:91
1 sat::pool(){0repos|2solv}
2 sat::pool(){1repos|2612solv}
3 sat::pool(){0repos|2solv}
repos
RepoInfoList repos
Definition: RepoManager.cc:277

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

Definition at line 438 of file Repository.h.

## Member Function Documentation

## ◆ operator()()

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

Definition at line 440 of file Repository.h.

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

- zypp/Repository.h