libzypp 17.38.6
packagepolicycomponent.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
13#ifndef ZYPP_NG_SAT_COMPONENTS_PACKAGEPOLICYCOMPONENT_H_INCLUDED
14#define ZYPP_NG_SAT_COMPONENTS_PACKAGEPOLICYCOMPONENT_H_INCLUDED
15
16#include "poolcomponents.h"
19#include <optional>
20
21namespace zyppng::sat {
22
48 {
49 public:
51 ~PackagePolicyComponent() override = default;
52
53 PreparedStage stage() const override { return PreparedStage::Policy; }
54
56 void attach(Pool &p) override;
57
59 void prepare( PreparedPool & pp ) override;
60
62 void onInvalidate( Pool & pool, PoolInvalidation invalidation ) override;
63
65 void onReset( Pool & pool ) override;
66
69 bool isRetracted( const Solvable & solv_r ) const;
71
74 bool isPtfMaster ( const Solvable & solv_r ) const;
75 bool isPtfPackage( const Solvable & solv_r ) const;
77
80
87
88 bool isNeedreboot( const Solvable & solv_r ) const;
90
91 private:
92 Pool *_pool = nullptr;
93 // --- spec (definition) layer ---
98
99 // --- evaluated (cache) layer ---
100 // Populated by prepare(); reset to nullopt by onInvalidate().
101 std::optional<EvaluatedSolvableSpec> _retractedEval;
102 std::optional<EvaluatedSolvableSpec> _ptfMasterEval;
103 std::optional<EvaluatedSolvableSpec> _ptfPackageEval;
104 std::optional<EvaluatedSolvableSpec> _needrebootEval;
105 };
106
107
108} // namespace zyppng::sat
109
110#endif // ZYPP_NG_SAT_COMPONENTS_PACKAGEPOLICYCOMPONENT_H_INCLUDED
Interface for components that run AFTER the whatprovides index is built.
PreparedStage stage() const override
~PackagePolicyComponent() override=default
std::optional< EvaluatedSolvableSpec > _needrebootEval
void attach(Pool &p) override
called when the component is attached to a pool
void prepare(PreparedPool &pp) override
Called by Pool::prepare() — evaluates all specs against the prepared pool.
void setNeedrebootSpec(SolvableSpec spec)
Replace the reboot-needed spec.
void onReset(Pool &pool) override
Called on full pool reset — resets all evaluated forms.
SolvableSpec _ptfMasterSpec
hardwired: provides ptf()
std::optional< EvaluatedSolvableSpec > _ptfPackageEval
bool isNeedreboot(const Solvable &solv_r) const
bool isRetracted(const Solvable &solv_r) const
void onInvalidate(Pool &pool, PoolInvalidation invalidation) override
Called when pool content changes — resets all evaluated forms.
std::optional< EvaluatedSolvableSpec > _ptfMasterEval
std::optional< EvaluatedSolvableSpec > _retractedEval
SolvableSpec _ptfPackageSpec
hardwired: provides ptf-package()
SolvableSpec _retractedSpec
hardwired: provides retracted-patch-package()
bool isPtfPackage(const Solvable &solv_r) const
bool isPtfMaster(const Solvable &solv_r) const
Orchestrator for a libsolv pool instance.
Definition pool.h:37
A move-only, non-owning view of a Pool that guarantees the whatprovides index is valid.
A pure data container describing a set of solvables by ident and/or provides.
A Solvable object within the sat Pool.
Definition solvable.h:65
This file contains private API, this might break at any time between releases.
PreparedStage
Execution stages for IPreparedPoolComponent (post-index phase).
@ Policy
Blacklists, Reboot Specs, Storage Policy.
PoolInvalidation
Defines the scope of an invalidation request for the Pool.
This file contains private API, this might break at any time between releases.