libzypp: zypp::Repository::EraseFromPool Struct Reference

libzypp 17.38.13

zypp::Repository::EraseFromPool Struct Reference

Functor removing Repository from its Pool. More...

`#include <zypp/Repository.h>`

## Public Member Functions
void | operator() (Repository repository_r) const

## Detailed Description

Functor removing Repository from its 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:102
MIL
#define MIL
Definition Logger.h:103
zypp::AutoDispose
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
zypp::Repository::addSolv
void addSolv(const Pathname &file_r)
Load Solvables from a solv-file.
Definition Repository.cc:321
zypp::sat::Pool
Global sat-pool.
Definition Pool.h:47
zypp::sat::Pool::reposInsert
Repository reposInsert(const std::string &alias_r)
Return a Repository named alias_r.
Definition Pool.cc:143
zypp::Repository::EraseFromPool
Functor removing Repository from its Pool.
Definition Repository.h:444
1 sat::pool(){0repos|2solv}
2 sat::pool(){1repos|2612solv}
3 sat::pool(){0repos|2solv}

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

Definition at line 443 of file Repository.h.

## Member Function Documentation

## ◆ operator()()

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

Definition at line 445 of file Repository.h.

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

- zypp/Repository.h