libzypp  17.38.7
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 
22 namespace zyppng::sat {
23 
24  class NamespaceProvider;
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
void registerProvider(detail::IdType namespaceId, std::shared_ptr< NamespaceProvider > provider)
Register a provider for a specific namespace.
Mediator managing the collection of NamespaceProviders for a Pool.
Orchestrator for a libsolv pool instance.
Definition: pool.h:36
std::unordered_map< detail::IdType, std::shared_ptr< NamespaceProvider > > _providers
Internal map of IDs to their respective providers.
void prepare(Pool &pool) override
zypp::sat::detail::CPool CPool
Definition: poolconstants.h:36
bool handleNamespace(detail::IdType namespaceId, detail::IdType value) const
The entry point for the libsolv namespace callback.
Arches, Locales, Namespace Callbacks (The Foundation)
int priority() const override
Fine-grained ordering within a stage.
Interface for components that run BEFORE the whatprovides index is built.
InitStage stage() const override
This file contains private API, this might break at any time between releases.
Definition: capabilities.h:22
zypp::sat::detail::IdType IdType
Definition: poolconstants.h:43
static detail::IdType libsolv_callback(detail::CPool *, void *data, detail::IdType lhs, detail::IdType rhs)
The static C-style callback for libsolv.
void attach(Pool &pool) override
void checkDirty(Pool &pool) override
Probe external state.
~NamespaceComponent() override=default
void onReset(Pool &pool) override
InitStage
Execution stages for IPoolComponent (pre-index phase).