libzypp: zyppng::sat::NamespaceComponent Class Reference

libzypp 17.38.14

zyppng::sat::NamespaceComponent Class Reference

Mediator managing the collection of NamespaceProviders for a Pool. More...

`#include <zypp/ng/sat/components/namespacecomponent.h>`

Inheritance diagram for zyppng::sat::NamespaceComponent:

## Public Member Functions
| ~NamespaceComponent () override=default
void | registerProvider (detail::IdType namespaceId, std::shared_ptr< NamespaceProvider > provider)
| Register a provider for a specific namespace.
bool | handleNamespace (detail::IdType namespaceId, detail::IdType value) const
| The entry point for the libsolv namespace callback.
InitStage | stage () const override
int | priority () const override
| Fine-grained ordering within a stage.
void | attach (Pool &pool) override
void | checkDirty (Pool &pool) override
| Probe external state.
void | prepare (Pool &pool) override
void | onReset (Pool &pool) override
Public Member Functions inherited from zyppng::sat::detail::IBasicPoolComponent
virtual void | onInvalidate (Pool &, PoolInvalidation)
| React to pool invalidation — clear internal caches.
virtual void | onRepoAdded (Pool &, RepoIdType)
virtual void | onRepoRemoved (Pool &, RepoIdType)
virtual | ~IBasicPoolComponent ()=default
| IBasicPoolComponent ()=default
| IBasicPoolComponent (const IBasicPoolComponent &)=delete
| IBasicPoolComponent (IBasicPoolComponent &&)=delete
IBasicPoolComponent & | operator= (const IBasicPoolComponent &)=delete
IBasicPoolComponent & | operator= (IBasicPoolComponent &&)=delete

## Static Private Member Functions
static detail::IdType | libsolv_callback (detail::CPool *, void *data, detail::IdType lhs, detail::IdType rhs)
| The static C-style callback for libsolv.

## Private Attributes
std::unordered_map< detail::IdType, std::shared_ptr< NamespaceProvider > > | _providers
| Internal map of IDs to their respective providers.

## Detailed Description

Mediator managing the collection of NamespaceProviders for a Pool.

The NamespaceComponent acts as the central hub for libsolv namespace callbacks. It maps libsolv Namespace IDs to specific NamespaceProvider instances and propagates dirty notifications up to the Pool.

By keeping this logic separate from the Pool, we prevent high-level dependencies (like Locales or Hardware detection) from leaking into the low-level pool header.

Definition at line 37 of file namespacecomponent.h.

## Constructor & Destructor Documentation

## ◆ ~NamespaceComponent()

zyppng::sat::NamespaceComponent::~NamespaceComponent | ( |  | ) |
| overridedefault

## Member Function Documentation

## ◆ registerProvider()

void zyppng::sat::NamespaceComponent::registerProvider | ( | detail::IdType | namespaceId,
|  | std::shared_ptr< NamespaceProvider > | provider )

Register a provider for a specific namespace.

Parameters

  namespaceId | The ID representing the namespace (e.g., 'namespace:language').
  provider | A shared pointer to the provider implementation.

Definition at line 18 of file namespacecomponent.cc.

## ◆ handleNamespace()

bool zyppng::sat::NamespaceComponent::handleNamespace | ( | detail::IdType | namespaceId,
|  | detail::IdType | value ) const

The entry point for the libsolv namespace callback.

Parameters

  namespaceId | The ID of the namespace being queried.
  value | The value to be checked.

Returns
  True if any registered provider satisfies the condition.

Definition at line 23 of file namespacecomponent.cc.

## ◆ stage()

InitStage zyppng::sat::NamespaceComponent::stage | ( |  | ) | const
| inlineoverridevirtual

Reimplemented from zyppng::sat::IPoolComponent.

Definition at line 59 of file namespacecomponent.h.

## ◆ priority()

int zyppng::sat::NamespaceComponent::priority | ( |  | ) | const
| inlineoverridevirtual

Fine-grained ordering within a stage.

Lower values run earlier. Default is 0.

Note
  Prefer stage() for coarse ordering; use priority() only when ordering within a stage matters.

Reimplemented from zyppng::sat::IPoolComponent.

Definition at line 60 of file namespacecomponent.h.

## ◆ attach()

void zyppng::sat::NamespaceComponent::attach | ( | Pool & | pool | ) |
| overridevirtual

Reimplemented from zyppng::sat::IPoolComponent.

Definition at line 31 of file namespacecomponent.cc.

## ◆ checkDirty()

void zyppng::sat::NamespaceComponent::checkDirty | ( | Pool & |  | ) |
| overridevirtual

Probe external state.

May call pool.setDirty(). Called once per prepare() invocation, before any component prepare work starts. This is the ONLY point during the prepare sequence where calling setDirty() is legal (asserted in debug builds).

Reimplemented from zyppng::sat::detail::IBasicPoolComponent.

Definition at line 40 of file namespacecomponent.cc.

## ◆ prepare()

void zyppng::sat::NamespaceComponent::prepare | ( | Pool & | pool | ) |
| overridevirtual

Reimplemented from zyppng::sat::IPoolComponent.

Definition at line 46 of file namespacecomponent.cc.

## ◆ onReset()

void zyppng::sat::NamespaceComponent::onReset | ( | Pool & | pool | ) |
| overridevirtual

Reimplemented from zyppng::sat::detail::IBasicPoolComponent.

Definition at line 52 of file namespacecomponent.cc.

## ◆ libsolv_callback()

detail::IdType zyppng::sat::NamespaceComponent::libsolv_callback | ( | detail::CPool * | ,
|  | void * | data,
|  | detail::IdType | lhs,
|  | detail::IdType | rhs )
| staticprivate

The static C-style callback for libsolv.

Definition at line 58 of file namespacecomponent.cc.

## Member Data Documentation

## ◆ _providers

std::unordered_map<detail::IdType, std::shared_ptr<NamespaceProvider> > zyppng::sat::NamespaceComponent::_providers
| private

Internal map of IDs to their respective providers.

Definition at line 73 of file namespacecomponent.h.

The documentation for this class was generated from the following files:

- zypp/ng/sat/components/namespacecomponent.h
- zypp/ng/sat/components/namespacecomponent.cc