libzypp 17.38.6
namespacecomponent.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPP_NG_SAT_COMPONENTS_NAMESPACECOMPONENT_H_INCLUDED
15#define ZYPP_NG_SAT_COMPONENTS_NAMESPACECOMPONENT_H_INCLUDED
16
17#include <memory>
18#include <unordered_map>
20#include "poolcomponents.h"
21
22namespace zyppng::sat {
23
25
38 public:
39
40 ~NamespaceComponent() override = default;
41
47 void registerProvider( detail::IdType namespaceId, std::shared_ptr<NamespaceProvider> provider );
48
55 bool handleNamespace( detail::IdType namespaceId, detail::IdType value ) const;
56
57 // --- IPoolComponent implementation ---
58
59 InitStage stage() const override { return InitStage::Environment; }
60 int priority() const override { return -10; } // Run early in Environment stage
61
62 void attach ( Pool & pool ) override;
63 void checkDirty( Pool & pool ) override;
64 void prepare ( Pool & pool ) override;
65 void onReset ( Pool & pool ) override;
66
67 private:
68
71
73 std::unordered_map<detail::IdType, std::shared_ptr<NamespaceProvider>> _providers;
74 };
75
76} // namespace zyppng::sat
77
78#endif
Interface for components that run BEFORE the whatprovides index is built.
Mediator managing the collection of NamespaceProviders for a Pool.
bool handleNamespace(detail::IdType namespaceId, detail::IdType value) const
The entry point for the libsolv namespace callback.
static detail::IdType libsolv_callback(detail::CPool *, void *data, detail::IdType lhs, detail::IdType rhs)
The static C-style callback for libsolv.
void checkDirty(Pool &pool) override
Probe external state.
InitStage stage() const override
int priority() const override
Fine-grained ordering within a stage.
~NamespaceComponent() override=default
std::unordered_map< detail::IdType, std::shared_ptr< NamespaceProvider > > _providers
Internal map of IDs to their respective providers.
void prepare(Pool &pool) override
void onReset(Pool &pool) override
void attach(Pool &pool) override
void registerProvider(detail::IdType namespaceId, std::shared_ptr< NamespaceProvider > provider)
Register a provider for a specific namespace.
Abstract base class for logic providing data to a libsolv namespace.
Orchestrator for a libsolv pool instance.
Definition pool.h:37
zypp::sat::detail::CPool CPool
zypp::sat::detail::IdType IdType
This file contains private API, this might break at any time between releases.
InitStage
Execution stages for IPoolComponent (pre-index phase).
@ Environment
Arches, Locales, Namespace Callbacks (The Foundation).