libzypp  17.38.7
architecturecomponent.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_ARCHITECTURECOMPONENT_H_INCLUDED
15 #define ZYPP_NG_SAT_COMPONENTS_ARCHITECTURECOMPONENT_H_INCLUDED
16 
17 #include "poolcomponents.h"
18 #include <zypp/ng/arch.h>
20 #include <functional>
21 
22 namespace zyppng::sat {
23 
31  public:
33  using ArchitectureProvider = std::function<zypp::Arch()>;
34 
35  ArchitectureComponent() = default;
36 
38  void setProvider( ArchitectureProvider provider );
39 
41  zypp::Arch arch() const
43 
44  InitStage stage() const override { return InitStage::Environment; }
45  int priority() const override { return 0; }
46 
47  void attach(Pool &pool) override;
48  void prepare( Pool & pool ) override;
49  void onRepoAdded( Pool & pool, detail::RepoIdType id ) override;
50  void onReset( Pool & pool ) override;
51 
52  private:
53  Pool *_pool = nullptr;
56  };
57 
58 
59 } // namespace zyppng::sat
60 
61 #endif
Simple serial number watcher.
Definition: SerialNumber.h:122
Architecture.
Definition: Arch.h:36
std::function< zypp::Arch()> ArchitectureProvider
Provider function returning an Arch.
static Arch detectSystemArchitecture()
Determine system architecture evaluating uname and /proc/cpuinfo.
Definition: Arch.cc:701
Orchestrator for a libsolv pool instance.
Definition: pool.h:36
Component managing the Pool architecture.
Arches, Locales, Namespace Callbacks (The Foundation)
Interface for components that run BEFORE the whatprovides index is built.
This file contains private API, this might break at any time between releases.
Definition: capabilities.h:22
int priority() const override
Fine-grained ordering within a stage.
void onRepoAdded(Pool &pool, detail::RepoIdType id) override
zypp::Arch arch() const
Get the current architecture.
InitStage
Execution stages for IPoolComponent (pre-index phase).
zypp::sat::detail::RepoIdType RepoIdType
Definition: poolconstants.h:45
void setProvider(ArchitectureProvider provider)
Set a custom architecture provider.