libzypp: zyppng::sat::Repository::EraseFromPool Struct Reference

libzypp 17.38.7

zyppng::sat::Repository::EraseFromPool Struct Reference

Query class for Repository related products. More...

`#include <zypp/ng/sat/repository.h>`

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

## Detailed Description

Query class for Repository related products.

Products are identified by CpeIds within the repositories metadata.

See also
  http://en.opensuse.org/Standards/Rpm_Metadata#SUSE_repository_info_.28suseinfo.xml.29.2C_extensions_to_repomd.xml

The iterator does not provide a dereference operator so you can do * on it, but you can access the attributes of each related product directly from the iterator.

for_( it, repo.compatibleWithProductBegin(), repo.compatibleWithProductEnd() )
{
cout << it.label() << ": " << it.cpeid() << endl;
}
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition Easy.h:27
zyppng::repo
Definition downloader.cc:22

Iterate the repository compatible distros. Iterate distos the repository provides upadates for. 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
zyppng::sat::Pool
Orchestrator for a libsolv pool instance.
Definition pool.h:37
zyppng::sat::Pool::reposInsert
Repository reposInsert(const std::string &alias_r)
Return a Repository named alias_r.
Definition pool.cc:194
zyppng::sat::Repository::addSolv
void addSolv(const zypp::Pathname &file_r)
Load Solvables from a solv-file.
Definition repository.cc:215
zyppng::sat::Repository::EraseFromPool
Query class for Repository related products.
Definition repository.h:462
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 461 of file repository.h.

## Member Function Documentation

## ◆ operator()()

void zyppng::sat::Repository::EraseFromPool::operator() | ( | Repository | repository_r | ) | const
| inline

Definition at line 463 of file repository.h.

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

- zypp/ng/sat/repository.h