|
libzypp 17.38.6
|
A pure data container describing a set of solvables by ident and/or provides. More...
#include <zypp/ng/sat/solvablespec.h>
Public Member Functions | |
| SolvableSpec ()=default | |
| ~SolvableSpec ()=default | |
| SolvableSpec (const SolvableSpec &)=default | |
| SolvableSpec (SolvableSpec &&)=default | |
| SolvableSpec & | operator= (const SolvableSpec &)=default |
| SolvableSpec & | operator= (SolvableSpec &&)=default |
| bool | empty () const |
| Whether the spec has no idents and no provides tokens. | |
| void | clear () |
| Reset to empty state. | |
Ident-based matching | |
A solvable matches by ident when its | |
| void | addIdent (IdString ident_r) |
| Add ident_r to the ident set. | |
| const IdStringSet & | idents () const |
| bool | containsIdent (const IdString &ident_r) const |
| Whether ident_r has been added to the spec (for introspection/tests). | |
Provides-based matching | |
A solvable matches by provides when its provides list contains a capability that matches one of these tokens. Callers use | |
| void | addProvides (Capability cap_r) |
| Add cap_r to the provides set. | |
| const CapabilitySet & | provides () const |
| bool | containsProvides (const Capability &cap_r) const |
| Whether cap_r has been added to the spec (for introspection/tests). | |
Text-format parser | |
Each entry is either:
Empty strings and strings beginning with | |
| IdStringSet | _idents |
| CapabilitySet | _provides |
| void | parse (std::string_view spec_r) |
| Parse and add a single spec entry. | |
| void | parseFrom (const zypp::InputStream &istr_r) |
Parse and add specs from istr_r (one per line; #-comments and empty lines are skipped automatically). | |
| template<class TIterator> | |
| void | parseFrom (TIterator begin, TIterator end) |
| Parse and add specs from an iterator range of string-like values. | |
| void | splitParseFrom (std::string_view multispec_r) |
Split multispec_r on ',', ' ', '\t' and parse each token. | |
| bool | contains (Pool &pool_r, const Solvable &solv_r) const |
| Test whether a single Solvable matches this spec. | |
A pure data container describing a set of solvables by ident and/or provides.
zypp::sat::SolvableSpec. It is intentionally a pure data container: it stores sets of IdString idents and Capability provides tokens, but it holds no pool reference, no cache, and no lazy-evaluation state.Evaluation (i.e., resolving which concrete Solvable objects match) is done externally by callers who supply an explicit Pool& reference. This makes SolvableSpec safe to copy, store, and pass across component boundaries without pool-lifetime concerns.
zypp::sat::SolvableSpec stores a lazy shared_ptr<WhatProvides> cache and calls setDirty() to invalidate it. That design couples the spec to a specific pool instance. Here the spec is stateless; the PackagePolicyComponent owns the cache and rebuilds it in prepare().pool() or touch any global pool state. Definition at line 54 of file solvablespec.h.
|
default |
|
default |
|
default |
|
default |
|
default |
|
default |
|
inline |
Whether the spec has no idents and no provides tokens.
Definition at line 66 of file solvablespec.h.
|
inline |
Reset to empty state.
Definition at line 70 of file solvablespec.h.
|
inline |
Add ident_r to the ident set.
No-op if ident_r is empty.
Definition at line 79 of file solvablespec.h.
|
inline |
Definition at line 82 of file solvablespec.h.
Whether ident_r has been added to the spec (for introspection/tests).
Definition at line 86 of file solvablespec.h.
|
inline |
Add cap_r to the provides set.
No-op if cap_r is empty.
Definition at line 98 of file solvablespec.h.
|
inline |
Definition at line 101 of file solvablespec.h.
|
inline |
Whether cap_r has been added to the spec (for introspection/tests).
Definition at line 105 of file solvablespec.h.
| void SolvableSpec::parse | ( | std::string_view | spec_r | ) |
Parse and add a single spec entry.
Definition at line 52 of file solvablespec.cc.
| void SolvableSpec::parseFrom | ( | const zypp::InputStream & | istr_r | ) |
Parse and add specs from istr_r (one per line; #-comments and empty lines are skipped automatically).
Definition at line 63 of file solvablespec.cc.
|
inline |
Parse and add specs from an iterator range of string-like values.
Definition at line 127 of file solvablespec.h.
| void SolvableSpec::splitParseFrom | ( | std::string_view | multispec_r | ) |
Split multispec_r on ',', ' ', '\t' and parse each token.
Definition at line 72 of file solvablespec.cc.
Test whether a single Solvable matches this spec.
A solvable matches if its ident is in idents(), or if it provides at least one of the capabilities in provides().
| pool_r | The Pool owning solv_r (used to expand provides tokens via whatprovides). |
| solv_r | The solvable to test. |
Definition at line 25 of file solvablespec.cc.
|
private |
Definition at line 147 of file solvablespec.h.
|
private |
Definition at line 148 of file solvablespec.h.