libzypp 17.38.6
zyppng::sat::NamespaceProvider Class Reference

Abstract base class for logic providing data to a libsolv namespace. More...

#include <zypp/ng/sat/namespaces/namespaceprovider.h>

Inheritance diagram for zyppng::sat::NamespaceProvider:

Public Member Functions

virtual ~NamespaceProvider ()=default
virtual bool isSatisfied (detail::IdType value) const
 Check if a specific value satisfies this namespace condition.
virtual void checkDirty (Pool &)
 checkDirty
virtual void prepare (Pool &)
 prepare
virtual void onReset (Pool &)
virtual void attach (Pool &pool)

Protected Member Functions

void notifyDirty (PoolInvalidation invalidationLevel, std::initializer_list< std::string_view > reasons)
 Notify the attached registry/pool that data has changed.

Protected Attributes

Pool_pool = nullptr

Detailed Description

Abstract base class for logic providing data to a libsolv namespace.

A NamespaceProvider acts as the "Source of Truth" for specific dependency types (e.g., Locales, Modaliases, or Filesystem paths). It decouples high-level configuration logic from the low-level pool implementation.

Note
This class maintains a 1:1 relationship with a NamespaceComponent via a dirty-notification callback.

Definition at line 35 of file namespaceprovider.h.

Constructor & Destructor Documentation

◆ ~NamespaceProvider()

virtual zyppng::sat::NamespaceProvider::~NamespaceProvider ( )
virtualdefault

Member Function Documentation

◆ isSatisfied()

bool zyppng::sat::NamespaceProvider::isSatisfied ( detail::IdType value) const
virtual

Check if a specific value satisfies this namespace condition.

Parameters
valueThe id value to check (e.g., "en_US" for a locale namespace).
Returns
True if the condition is met, false otherwise.

This method is typically called via the libsolv namespace callback during dependency resolution.

Reimplemented in zyppng::sat::namespaces::FilesystemNamespaceProvider, zyppng::sat::namespaces::LanguageNamespaceProvider, and zyppng::sat::namespaces::ModaliasNamespaceProvider.

Definition at line 16 of file namespaceprovider.cc.

◆ checkDirty()

virtual void zyppng::sat::NamespaceProvider::checkDirty ( Pool & )
inlinevirtual

checkDirty

Called before the pool prepare sequence starts. This is the correct place to probe external state and call pool.setDirty() if needed. The default implementation does nothing.

Reimplemented in zyppng::sat::namespaces::FilesystemNamespaceProvider.

Definition at line 55 of file namespaceprovider.h.

◆ prepare()

virtual void zyppng::sat::NamespaceProvider::prepare ( Pool & )
inlinevirtual

prepare

Called during the pre-index phase of pool preparation, after checkDirty() and before pool_createwhatprovides(). Use this to set up any state the libsolv namespace callback needs to answer queries correctly during index construction. The default implementation does nothing.

Definition at line 66 of file namespaceprovider.h.

◆ onReset()

virtual void zyppng::sat::NamespaceProvider::onReset ( Pool & )
inlinevirtual

Reimplemented in zyppng::sat::namespaces::LanguageNamespaceProvider.

Definition at line 68 of file namespaceprovider.h.

◆ attach()

void zyppng::sat::NamespaceProvider::attach ( Pool & pool)
virtual

Attaching to a pool, default just stores a backlink pointer to the pool.

Definition at line 21 of file namespaceprovider.cc.

◆ notifyDirty()

void zyppng::sat::NamespaceProvider::notifyDirty ( PoolInvalidation invalidationLevel,
std::initializer_list< std::string_view > reasons )
protected

Notify the attached registry/pool that data has changed.

  • Derived classes must call this whenever their internal configuration (e.g., the set of active locales) is updated to ensure the libsolv caches are invalidated.

Definition at line 26 of file namespaceprovider.cc.

Member Data Documentation

◆ _pool

Pool* zyppng::sat::NamespaceProvider::_pool = nullptr
protected

Definition at line 85 of file namespaceprovider.h.


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