libzypp 17.38.6
zyppng::sat::EvaluatedSolvableSpec Class Reference

A SolvableSpec that has been evaluated against a specific Pool. More...

#include <zypp/ng/sat/solvablespec.h>

Public Types

using SolvIdSet = std::unordered_set<detail::SolvableIdType>

Public Member Functions

 EvaluatedSolvableSpec (PreparedPool &pp_r, const SolvableSpec &spec_r)
 Construct by evaluating spec_r against pp_r.
 EvaluatedSolvableSpec (const EvaluatedSolvableSpec &)=default
 EvaluatedSolvableSpec (EvaluatedSolvableSpec &&)=default
EvaluatedSolvableSpecoperator= (const EvaluatedSolvableSpec &)=default
EvaluatedSolvableSpecoperator= (EvaluatedSolvableSpec &&)=default
bool empty () const
 Whether no solvable matched the spec at construction time.
bool contains (const Solvable &solv_r) const
 O(1) membership test — no pool access required.
const SolvIdSetids () const
 Direct access to the resolved id set (e.g.

Private Attributes

SolvIdSet _ids

Detailed Description

A SolvableSpec that has been evaluated against a specific Pool.

Design
This is the explicit, pool-bound counterpart to the pure-data SolvableSpec. Construction takes an explicit Pool& and immediately resolves the spec into a flat SolvableIdType hash set. Subsequent contains() calls are O(1) with no pool access required.

The pool-binding is visible in the type: an EvaluatedSolvableSpec is a snapshot of the pool at construction time. If the pool changes, construct a new instance. There is no setDirty() / lazy-rebuild mechanism by design.

Relationship to SolvableSpec
spec.parse( "provides:kernel-default" );
// ... later, with a pool in hand:
if ( eval.contains( solv ) ) { ... } // O(1), no pool needed
EvaluatedSolvableSpec(PreparedPool &pp_r, const SolvableSpec &spec_r)
Construct by evaluating spec_r against pp_r.
A pure data container describing a set of solvables by ident and/or provides.
void parse(std::string_view spec_r)
Parse and add a single spec entry.

Definition at line 174 of file solvablespec.h.

Member Typedef Documentation

◆ SolvIdSet

Definition at line 177 of file solvablespec.h.

Constructor & Destructor Documentation

◆ EvaluatedSolvableSpec() [1/3]

zyppng::sat::EvaluatedSolvableSpec::EvaluatedSolvableSpec ( PreparedPool & pp_r,
const SolvableSpec & spec_r )

Construct by evaluating spec_r against pp_r.

Definition at line 84 of file solvablespec.cc.

◆ EvaluatedSolvableSpec() [2/3]

zyppng::sat::EvaluatedSolvableSpec::EvaluatedSolvableSpec ( const EvaluatedSolvableSpec & )
default

◆ EvaluatedSolvableSpec() [3/3]

zyppng::sat::EvaluatedSolvableSpec::EvaluatedSolvableSpec ( EvaluatedSolvableSpec && )
default

Member Function Documentation

◆ operator=() [1/2]

EvaluatedSolvableSpec & zyppng::sat::EvaluatedSolvableSpec::operator= ( const EvaluatedSolvableSpec & )
default

◆ operator=() [2/2]

EvaluatedSolvableSpec & zyppng::sat::EvaluatedSolvableSpec::operator= ( EvaluatedSolvableSpec && )
default

◆ empty()

bool zyppng::sat::EvaluatedSolvableSpec::empty ( ) const
inline

Whether no solvable matched the spec at construction time.

Definition at line 188 of file solvablespec.h.

◆ contains()

bool zyppng::sat::EvaluatedSolvableSpec::contains ( const Solvable & solv_r) const

O(1) membership test — no pool access required.

Definition at line 116 of file solvablespec.cc.

◆ ids()

const SolvIdSet & zyppng::sat::EvaluatedSolvableSpec::ids ( ) const
inline

Direct access to the resolved id set (e.g.

for bulk operations).

Definition at line 195 of file solvablespec.h.

Member Data Documentation

◆ _ids

SolvIdSet zyppng::sat::EvaluatedSolvableSpec::_ids
private

Definition at line 199 of file solvablespec.h.


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