libzypp: zyppng::sat::Pool Class Reference

libzypp 17.38.7

zyppng::sat::Pool Class Reference

Orchestrator for a libsolv pool instance. More...

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

## Public Types
using | RepositoryIterable = zypp::Iterable<detail::RepositoryIterator>
using | SolvableIterable = zypp::Iterable<detail::SolvableIterator>

## Public Member Functions
| Pool ()
| Default ctor.
| Pool (const Pool &)=delete
| Pool (Pool &&)=delete
Pool & | operator= (const Pool &)=delete
Pool & | operator= (Pool &&)=delete
| ~Pool ()
| Dtor.
detail::CPool * | get () const
| Expert backdoor.
const SerialNumber & | serial () const
| Serial number changing whenever the content changes.
const SerialNumber & | serialIDs () const
| Serial number changing whenever resusePoolIDs==true was used.
PreparedPool | prepare ()
| Update housekeeping data (e.g.
detail::size_type | capacity () const
void | setDirty (PoolInvalidation invalidation, std::initializer_list< std::string_view > reasons)
| Invalidate everything.
void | clear ()
| Reset the pool by removing all repositories and solvables.
Solvable management
bool | solvablesEmpty () const
| Whether Pool contains solvables.
detail::size_type | solvablesSize () const
| Number of solvables in Pool.
SolvableIterable | solvables () const
| Iterator to the first Solvable.
Component management
zypp::Pathname | rootDir () const
void | rootDir (const zypp::Pathname &root_r)
| Set rootdir (for file conflicts check).

## Friends
class | Repository
class | Solvable

## Actions invalidating housekeeping data.
All methods expect valid arguments being passed.
detail::CPool * | _pool
| sat-pool.
SerialNumber | _serial
| Serial number - changes with each Pool content change.
SerialNumber | _serialIDs
| Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also invalidate its PoolItems!
SerialNumberWatcher | _watcher
| Watch serial number.
PoolComponentSet | _componentsSet
| Component set managing modular pool logic.
bool | _preparing = false
| True while prepare() is running — setDirty() is illegal in this window.
detail::IdType | parserpmrichdep (const char *capstr_r)
| libsolv capability parser
detail::SolvableIdType | getFirstId () const
| Get id of the first valid Solvable.
detail::SolvableIdType | getNextId (detail::SolvableIdType id_r) const
| Get id of the next valid Solvable.
PoolComponentSet & | components ()
| Get rootdir (for file conflicts check).
const PoolComponentSet & | components () const
template<typename T>
T & | component ()
template<typename T>
const T * | findComponent () const
detail::CRepo * | _createRepo (const std::string &name_r)
| Creating a new repo named name_r.
void | _deleteRepo (detail::CRepo *repo_r)
| Delete repo repo_r from pool.
int | _addSolv (detail::CRepo *repo_r, FILE *file_r)
| Adding solv file to a repo.
int | _addHelix (detail::CRepo *repo_r, FILE *file_r)
| Adding helix file to a repo.
int | _addTesttags (detail::CRepo *repo_r, FILE *file_r)
| Adding testtags file to a repo.
detail::SolvableIdType | _addSolvables (detail::CRepo *repo_r, unsigned count_r)
| Adding Solvables to a repo.
void | _postRepoAdd (detail::CRepo *repo_r)
| Helper postprocessing the repo after adding solv or helix files.
bool | validSolvable (const detail::CSolvable &slv_r) const
| a `valid` Solvable has a non NULL repo pointer.
bool | validSolvable (detail::SolvableIdType id_r) const
bool | validSolvable (const detail::CSolvable *slv_r) const
detail::CPool * | getPool () const
detail::CRepo * | getRepo (detail::RepoIdType id_r) const
detail::CSolvable * | getSolvable (detail::SolvableIdType id_r) const
| Return pointer to the sat-solvable or NULL if it is not valid.

## Repository management
Repository | reposFind (const std::string &alias_r) const
| Find a Repository named `alias_r`.
Repository | reposInsert (const std::string &alias_r)
| Return a Repository named `alias_r`.
void | reposErase (const std::string &alias_r)
| Remove a Repository named `alias_r`.
void | reposEraseAll ()
| Remove all repos from the pool.
bool | reposEmpty () const
| Whether Pool contains repos.
detail::size_type | reposSize () const
| Number of repos in Pool.
RepositoryIterable | repos () const
| Iteratable to the repositories.
Repository | findSystemRepo () const
| Return the system repository if it is on the pool.
Repository | systemRepo ()
| Return the system repository, create it if missing.
bool | isSystemRepo (detail::CRepo *repo_r) const
static const std::string & | systemRepoAlias ()
| Reserved system repository alias `@System` .
detail::CRepo * | _systemRepoPtr () const

## Detailed Description

Orchestrator for a libsolv pool instance.

Definition at line 36 of file pool.h.

## Member Typedef Documentation

## ◆ RepositoryIterable

using zyppng::sat::Pool::RepositoryIterable = zypp::Iterable<detail::RepositoryIterator>

Definition at line 42 of file pool.h.

## ◆ SolvableIterable

using zyppng::sat::Pool::SolvableIterable = zypp::Iterable<detail::SolvableIterator>

Definition at line 43 of file pool.h.

## Constructor & Destructor Documentation

## ◆ Pool() [1/3]

zyppng::sat::Pool::Pool | ( |  | ) |

Default ctor.

Definition at line 89 of file pool.cc.

## ◆ Pool() [2/3]

zyppng::sat::Pool::Pool | ( | const Pool & |  | ) |
| delete

## ◆ Pool() [3/3]

zyppng::sat::Pool::Pool | ( | Pool && |  | ) |
| delete

## ◆ ~Pool()

zyppng::sat::Pool::~Pool | ( |  | ) |

Dtor.

Definition at line 97 of file pool.cc.

## Member Function Documentation

## ◆ operator=() [1/2]

Pool & zyppng::sat::Pool::operator= | ( | const Pool & |  | ) |
| delete

## ◆ operator=() [2/2]

Pool & zyppng::sat::Pool::operator= | ( | Pool && |  | ) |
| delete

## ◆ get()

detail::CPool * zyppng::sat::Pool::get | ( |  | ) | const
| inline

Expert backdoor.

Definition at line 59 of file pool.h.

## ◆ serial()

const SerialNumber & zyppng::sat::Pool::serial | ( |  | ) | const
| inline

Serial number changing whenever the content changes.

Definition at line 63 of file pool.h.

## ◆ serialIDs()

const SerialNumber & zyppng::sat::Pool::serialIDs | ( |  | ) | const
| inline

Serial number changing whenever resusePoolIDs==true was used.

ResPool must also invalidate its PoolItems!

Definition at line 67 of file pool.h.

## ◆ prepare()

PreparedPool zyppng::sat::Pool::prepare | ( |  | ) |

Update housekeeping data (e.g.

whatprovides). Returns a PreparedPool — a move-only view that guarantees the index is valid.

Definition at line 106 of file pool.cc.

## ◆ capacity()

detail::size_type zyppng::sat::Pool::capacity | ( |  | ) | const

Definition at line 103 of file pool.cc.

## ◆ setDirty()

void zyppng::sat::Pool::setDirty | ( | PoolInvalidation | invalidation,
|  | std::initializer_list< std::string_view > | reasons )

Invalidate everything.

Definition at line 152 of file pool.cc.

## ◆ clear()

void zyppng::sat::Pool::clear | ( |  | ) |

Reset the pool by removing all repositories and solvables.

This is primarily useful for test isolation since StringPool is currently a singleton.

Definition at line 143 of file pool.cc.

## ◆ systemRepoAlias()

const std::string & zyppng::sat::Pool::systemRepoAlias | ( |  | ) |
| static

Reserved system repository alias `@System` .

Definition at line 178 of file pool.cc.

## ◆ reposFind()

Repository zyppng::sat::Pool::reposFind | ( | const std::string & | alias_r | ) | const

Find a Repository named `alias_r`.

Returns Repository::noRepository if there is no such Repository.

Definition at line 184 of file pool.cc.

## ◆ reposInsert()

Repository zyppng::sat::Pool::reposInsert | ( | const std::string & | alias_r | ) |

Return a Repository named `alias_r`.

It a such a Repository does not already exist a new empty Repository is created.

Definition at line 194 of file pool.cc.

## ◆ reposErase()

void zyppng::sat::Pool::reposErase | ( | const std::string & | alias_r | ) |
| inline

Remove a Repository named `alias_r`.

Definition at line 107 of file pool.h.

## ◆ reposEraseAll()

void zyppng::sat::Pool::reposEraseAll | ( |  | ) |
| inline

Remove all repos from the pool.

This also shrinks a pool which may have become large after having added and removed repos lots of times.

Definition at line 114 of file pool.h.

## ◆ reposEmpty()

bool zyppng::sat::Pool::reposEmpty | ( |  | ) | const

Whether Pool contains repos.

Definition at line 202 of file pool.cc.

## ◆ reposSize()

detail::size_type zyppng::sat::Pool::reposSize | ( |  | ) | const

Number of repos in Pool.

Definition at line 205 of file pool.cc.

## ◆ repos()

Pool::RepositoryIterable zyppng::sat::Pool::repos | ( |  | ) | const

Iteratable to the repositories.

Definition at line 208 of file pool.cc.

## ◆ findSystemRepo()

Repository zyppng::sat::Pool::findSystemRepo | ( |  | ) | const

Return the system repository if it is on the pool.

Definition at line 222 of file pool.cc.

## ◆ systemRepo()

Repository zyppng::sat::Pool::systemRepo | ( |  | ) |

Return the system repository, create it if missing.

Definition at line 225 of file pool.cc.

## ◆ isSystemRepo()

bool zyppng::sat::Pool::isSystemRepo | ( | detail::CRepo * | repo_r | ) | const
| inline

Definition at line 132 of file pool.h.

## ◆ _systemRepoPtr()

detail::CRepo * zyppng::sat::Pool::_systemRepoPtr | ( |  | ) | const
| inlineprivate

Definition at line 136 of file pool.h.

## ◆ solvablesEmpty()

bool zyppng::sat::Pool::solvablesEmpty | ( |  | ) | const

Whether Pool contains solvables.

Definition at line 232 of file pool.cc.

## ◆ solvablesSize()

detail::size_type zyppng::sat::Pool::solvablesSize | ( |  | ) | const

Number of solvables in Pool.

Definition at line 245 of file pool.cc.

## ◆ solvables()

Pool::SolvableIterable zyppng::sat::Pool::solvables | ( |  | ) | const

Iterator to the first Solvable.

Definition at line 258 of file pool.cc.

## ◆ rootDir() [1/2]

zypp::Pathname zyppng::sat::Pool::rootDir | ( |  | ) | const
| inline

Definition at line 155 of file pool.h.

## ◆ rootDir() [2/2]

void zyppng::sat::Pool::rootDir | ( | const zypp::Pathname & | root_r | ) |
| inline

Set rootdir (for file conflicts check).

Definition at line 162 of file pool.h.

## ◆ _createRepo()

detail::CRepo * zyppng::sat::Pool::_createRepo | ( | const std::string & | name_r | ) |
| private

Creating a new repo named name_r.

Definition at line 266 of file pool.cc.

## ◆ _deleteRepo()

void zyppng::sat::Pool::_deleteRepo | ( | detail::CRepo * | repo_r | ) |
| private

Delete repo repo_r from pool.

Definition at line 277 of file pool.cc.

## ◆ _addSolv()

int zyppng::sat::Pool::_addSolv | ( | detail::CRepo * | repo_r,
|  | FILE * | file_r )
| private

Adding solv file to a repo.

Except for `isSystemRepo_r`, solvables of incompatible architecture are filtered out.

Definition at line 291 of file pool.cc.

## ◆ _addHelix()

int zyppng::sat::Pool::_addHelix | ( | detail::CRepo * | repo_r,
|  | FILE * | file_r )
| private

Adding helix file to a repo.

Except for `isSystemRepo_r`, solvables of incompatible architecture are filtered out.

Definition at line 300 of file pool.cc.

## ◆ _addTesttags()

int zyppng::sat::Pool::_addTesttags | ( | detail::CRepo * | repo_r,
|  | FILE * | file_r )
| private

Adding testtags file to a repo.

Except for `isSystemRepo_r`, solvables of incompatible architecture are filtered out.

Definition at line 309 of file pool.cc.

## ◆ _addSolvables()

detail::SolvableIdType zyppng::sat::Pool::_addSolvables | ( | detail::CRepo * | repo_r,
|  | unsigned | count_r )
| private

Adding Solvables to a repo.

Definition at line 318 of file pool.cc.

## ◆ _postRepoAdd()

void zyppng::sat::Pool::_postRepoAdd | ( | detail::CRepo * | repo_r | ) |
| private

Helper postprocessing the repo after adding solv or helix files.

Definition at line 324 of file pool.cc.

## ◆ validSolvable() [1/3]

bool zyppng::sat::Pool::validSolvable | ( | const detail::CSolvable & | slv_r | ) | const
| inlineprivate

a `valid` Solvable has a non NULL repo pointer.

Definition at line 208 of file pool.h.

## ◆ validSolvable() [2/3]

bool zyppng::sat::Pool::validSolvable | ( | detail::SolvableIdType | id_r | ) | const
| inlineprivate

Definition at line 211 of file pool.h.

## ◆ validSolvable() [3/3]

bool zyppng::sat::Pool::validSolvable | ( | const detail::CSolvable * | slv_r | ) | const
| inlineprivate

Definition at line 214 of file pool.h.

## ◆ getPool()

detail::CPool * zyppng::sat::Pool::getPool | ( |  | ) | const
| inlineprivate

Definition at line 217 of file pool.h.

## ◆ getRepo()

detail::CRepo * zyppng::sat::Pool::getRepo | ( | detail::RepoIdType | id_r | ) | const
| inlineprivate

Todo
  a quick check whether the repo was meanwhile deleted.

Definition at line 221 of file pool.h.

## ◆ getSolvable()

detail::CSolvable * zyppng::sat::Pool::getSolvable | ( | detail::SolvableIdType | id_r | ) | const
| inlineprivate

Return pointer to the sat-solvable or NULL if it is not valid.

See also
  validSolvable.

Definition at line 227 of file pool.h.

## ◆ parserpmrichdep()

detail::IdType zyppng::sat::Pool::parserpmrichdep | ( | const char * | capstr_r | ) |
| inline

libsolv capability parser

Definition at line 236 of file pool.h.

## ◆ getFirstId()

detail::SolvableIdType zyppng::sat::Pool::getFirstId | ( |  | ) | const
| inline

Get id of the first valid Solvable.

This is the next valid after the system solvable.

Definition at line 242 of file pool.h.

## ◆ getNextId()

detail::SolvableIdType zyppng::sat::Pool::getNextId | ( | detail::SolvableIdType | id_r | ) | const
| inline

Get id of the next valid Solvable.

This goes round robbin. At the end it returns noSolvableId. Passing noSolvableId it returns the 1st valid Solvable.

See also
  validSolvable.

Definition at line 250 of file pool.h.

## ◆ components() [1/2]

PoolComponentSet & zyppng::sat::Pool::components | ( |  | ) |
| inline

Get rootdir (for file conflicts check).

Definition at line 262 of file pool.h.

## ◆ components() [2/2]

const PoolComponentSet & zyppng::sat::Pool::components | ( |  | ) | const
| inline

Definition at line 263 of file pool.h.

## ◆ component()

template<typename T>

T & zyppng::sat::Pool::component | ( |  | ) |
| inline

Definition at line 266 of file pool.h.

## ◆ findComponent()

template<typename T>

const T * zyppng::sat::Pool::findComponent | ( |  | ) | const
| inline

Definition at line 269 of file pool.h.

## Friends And Related Symbol Documentation

## ◆ Repository

friend class Repository
| friend

Definition at line 38 of file pool.h.

## ◆ Solvable

friend class Solvable
| friend

Definition at line 39 of file pool.h.

## Member Data Documentation

## ◆ _pool

detail::CPool* zyppng::sat::Pool::_pool
| private

sat-pool.

Definition at line 274 of file pool.h.

## ◆ _serial

SerialNumber zyppng::sat::Pool::_serial
| private

Serial number - changes with each Pool content change.

Definition at line 276 of file pool.h.

## ◆ _serialIDs

SerialNumber zyppng::sat::Pool::_serialIDs
| private

Serial number of IDs - changes whenever resusePoolIDs==true - ResPool must also invalidate its PoolItems!

Definition at line 278 of file pool.h.

## ◆ _watcher

SerialNumberWatcher zyppng::sat::Pool::_watcher
| private

Watch serial number.

Definition at line 280 of file pool.h.

## ◆ _componentsSet

PoolComponentSet zyppng::sat::Pool::_componentsSet
| private

Component set managing modular pool logic.

Definition at line 282 of file pool.h.

## ◆ _preparing

bool zyppng::sat::Pool::_preparing = false
| private

True while prepare() is running — setDirty() is illegal in this window.

Definition at line 285 of file pool.h.

The documentation for this class was generated from the following files:

- zypp/ng/sat/pool.h
- zypp/ng/sat/pool.cc