libzypp 17.38.6
zyppng::sat::PreparedPool Class Reference

A move-only, non-owning view of a Pool that guarantees the whatprovides index is valid. More...

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

Public Member Functions

 PreparedPool ()=delete
 PreparedPool (const PreparedPool &)=delete
PreparedPooloperator= (const PreparedPool &)=delete
 PreparedPool (PreparedPool &&)=default
PreparedPooloperator= (PreparedPool &&)=default
 ~PreparedPool ()=default
Poolpool () const noexcept
 Access the owning Pool.
detail::CPoolget () const noexcept
 Expert backdoor — raw libsolv pool pointer.

whatprovides queries

These methods require the whatprovides index to be valid, which is guaranteed by the type invariant of PreparedPool.

class Pool
Pool_pool
SerialNumberWatcher _serialWatcher
unsigned whatProvidesCapabilityId (detail::IdType cap_r) const
 Returns the offset into the internal whatprovidesdata array for cap_r.
detail::IdType whatProvidesData (unsigned offset_r) const
 Returns the id stored at offset_r in the whatprovidesdata array.
Queue whatMatchesDep (const SolvAttr &, const Capability &) const
 All solvables whose attribute attr_r matches dependency cap_r.
Queue whatMatchesSolvable (const SolvAttr &, const Solvable &) const
 All solvables whose attribute attr_r matches solvable solv_r.
Queue whatContainsDep (const SolvAttr &, const Capability &) const
 All solvables whose attribute attr_r contains dependency cap_r.
 PreparedPool (Pool &pool_r) noexcept
 Only Pool::prepare() may construct a PreparedPool.

Detailed Description

A move-only, non-owning view of a Pool that guarantees the whatprovides index is valid.

Obtaining a PreparedPool
A PreparedPool is obtainable only as the return value of Pool::prepare(). It cannot be default-constructed or copied.
Ownership
PreparedPool is non-owning. Destroying it does nothing to the underlying libsolv index — the index lives inside the libsolv ::Pool struct and is managed by the owning Pool.
Thread safety
PreparedPool is a non-owning view. Concurrent reads are safe as long as the owning Pool is not mutated concurrently.
Debug invariant
In debug builds the serial number of the pool is captured at construction. Every query asserts the serial has not changed, catching use-after-invalidate.

Definition at line 50 of file preparedpool.h.

Constructor & Destructor Documentation

◆ PreparedPool() [1/4]

zyppng::sat::PreparedPool::PreparedPool ( )
delete

◆ PreparedPool() [2/4]

zyppng::sat::PreparedPool::PreparedPool ( const PreparedPool & )
delete

◆ PreparedPool() [3/4]

zyppng::sat::PreparedPool::PreparedPool ( PreparedPool && )
default

◆ ~PreparedPool()

zyppng::sat::PreparedPool::~PreparedPool ( )
default

◆ PreparedPool() [4/4]

zyppng::sat::PreparedPool::PreparedPool ( Pool & pool_r)
explicitprivatenoexcept

Only Pool::prepare() may construct a PreparedPool.

Definition at line 20 of file preparedpool.cc.

Member Function Documentation

◆ operator=() [1/2]

PreparedPool & zyppng::sat::PreparedPool::operator= ( const PreparedPool & )
delete

◆ operator=() [2/2]

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

◆ pool()

Pool & zyppng::sat::PreparedPool::pool ( ) const
inlinenoexcept

Access the owning Pool.

Definition at line 63 of file preparedpool.h.

◆ get()

detail::CPool * zyppng::sat::PreparedPool::get ( ) const
noexcept

Expert backdoor — raw libsolv pool pointer.

Definition at line 31 of file preparedpool.cc.

◆ whatProvidesCapabilityId()

unsigned zyppng::sat::PreparedPool::whatProvidesCapabilityId ( detail::IdType cap_r) const

Returns the offset into the internal whatprovidesdata array for cap_r.

Use whatProvidesData to iterate the stored ids.

Definition at line 40 of file preparedpool.cc.

◆ whatProvidesData()

detail::IdType zyppng::sat::PreparedPool::whatProvidesData ( unsigned offset_r) const

Returns the id stored at offset_r in the whatprovidesdata array.

Iterate from whatProvidesCapabilityId until a 0 id is returned.

Definition at line 45 of file preparedpool.cc.

◆ whatMatchesDep()

Queue zyppng::sat::PreparedPool::whatMatchesDep ( const SolvAttr & attr,
const Capability & cap ) const

All solvables whose attribute attr_r matches dependency cap_r.

Definition at line 50 of file preparedpool.cc.

◆ whatMatchesSolvable()

Queue zyppng::sat::PreparedPool::whatMatchesSolvable ( const SolvAttr & attr,
const Solvable & solv ) const

All solvables whose attribute attr_r matches solvable solv_r.

Definition at line 57 of file preparedpool.cc.

◆ whatContainsDep()

Queue zyppng::sat::PreparedPool::whatContainsDep ( const SolvAttr & attr,
const Capability & cap ) const

All solvables whose attribute attr_r contains dependency cap_r.

Definition at line 64 of file preparedpool.cc.

◆ Pool

friend class Pool
friend

Definition at line 94 of file preparedpool.h.

Member Data Documentation

◆ _pool

Pool& zyppng::sat::PreparedPool::_pool
private

Definition at line 99 of file preparedpool.h.

◆ _serialWatcher

SerialNumberWatcher zyppng::sat::PreparedPool::_serialWatcher
private

Definition at line 101 of file preparedpool.h.


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