libzypp 17.38.6
preparedpool.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
9#include "preparedpool.h"
10#include <zypp/ng/sat/pool.h>
13
14#ifndef NDEBUG
15# include <cassert>
16#endif
17
18namespace zyppng::sat {
19
20 PreparedPool::PreparedPool( Pool & pool_r ) noexcept
21 : _pool( pool_r )
22#ifndef NDEBUG
24#endif
25 {
26#ifndef NDEBUG
27 _serialWatcher.remember( _pool.serial() );
28#endif
29 }
30
32 {
33#ifndef NDEBUG
34 assert( !_serialWatcher.remember( _pool.serial() )
35 && "PreparedPool used after Pool was invalidated" );
36#endif
37 return _pool.get();
38 }
39
41 {
42 return ::pool_whatprovides( get(), cap_r );
43 }
44
46 {
47 return get()->whatprovidesdata[offset_r];
48 }
49
50 Queue PreparedPool::whatMatchesDep( const SolvAttr & attr, const Capability & cap ) const
51 {
52 sat::Queue q;
53 ::pool_whatmatchesdep( get(), attr.id(), cap.id(), q, 0 );
54 return q;
55 }
56
57 Queue PreparedPool::whatMatchesSolvable( const SolvAttr & attr, const Solvable & solv ) const
58 {
59 sat::Queue q;
60 ::pool_whatmatchessolvable( get(), attr.id(), static_cast<Id>( solv.id() ), q, 0 );
61 return q;
62 }
63
64 Queue PreparedPool::whatContainsDep( const SolvAttr & attr, const Capability & cap ) const
65 {
66 sat::Queue q;
67 ::pool_whatcontainsdep( get(), attr.id(), cap.id(), q, 0 );
68 return q;
69 }
70
71} // namespace zyppng::sat
Solvable attribute keys.
Definition SolvAttr.h:41
IdType id() const
A sat capability.
Definition capability.h:74
sat::detail::IdType id() const
Expert backdoor.
Definition capability.h:301
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.
unsigned whatProvidesCapabilityId(detail::IdType cap_r) const
Returns the offset into the internal whatprovidesdata array for cap_r.
Queue whatMatchesSolvable(const SolvAttr &, const Solvable &) const
All solvables whose attribute attr_r matches solvable solv_r.
SerialNumberWatcher _serialWatcher
detail::CPool * get() const noexcept
Expert backdoor — raw libsolv pool pointer.
Queue whatContainsDep(const SolvAttr &, const Capability &) const
All solvables whose attribute attr_r contains dependency cap_r.
Libsolv Id queue wrapper.
Definition queue.h:37
A Solvable object within the sat Pool.
Definition solvable.h:65
IdType id() const
Expert backdoor.
Definition solvable.h:338
zypp::sat::detail::CPool CPool
zypp::sat::detail::IdType IdType
This file contains private API, this might break at any time between releases.