libzypp  17.25.6
zypp::VendorAttr::Impl Class Reference

VendorAttr implementation. More...

Public Member Functions

 Impl ()
 Ctor. More...
 
void addVendorList (VendorList &&vendorList_r)
 Add a new equivalent vendor set. More...
 
bool equivalent (IdString lVendor, IdString rVendor) const
 Return whether two vendor strings should be treated as equivalent. More...
 
unsigned foreachVendorList (std::function< bool(VendorList)> fnc_r) const
 

Private Types

using VendorGroupMap = std::map< std::string, unsigned >
 
typedef DefaultIntegral< unsigned, 0 > VendorMatchEntry
 
typedef std::unordered_map< IdString, VendorMatchEntryVendorMatch
 

Private Member Functions

void vendorMatchIdReset ()
 Reset vendor match cache if _vendorGroupMap was changed. More...
 
unsigned vendorMatchId (IdString vendor) const
 Helper mapping a vendor string to it's eqivalence class ID. More...
 
Implclone () const
 clone for RWCOW_pointer More...
 

Private Attributes

VendorGroupMap _vendorGroupMap
 Vendor group definition. Equivalent groups share the same ID. More...
 
unsigned _vendorGroupId = 0
 Highest group ID in use (incremented). More...
 
VendorMatch _vendorMatch
 Cache mapping vendor strings to equivalence class ID. More...
 
unsigned _nextId = 0
 Least equivalence class ID in use (decremented). More...
 

Friends

std::ostream & operator<< (std::ostream &str, const Impl &obj)
 
ImplrwcowClone (const Impl *rhs)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const VendorAttr::Impl &obj)
 

Detailed Description

VendorAttr implementation.

Definition at line 40 of file VendorAttr.cc.

Member Typedef Documentation

◆ VendorGroupMap

using zypp::VendorAttr::Impl::VendorGroupMap = std::map<std::string,unsigned>
private

Definition at line 80 of file VendorAttr.cc.

◆ VendorMatchEntry

Definition at line 85 of file VendorAttr.cc.

◆ VendorMatch

typedef std::unordered_map<IdString, VendorMatchEntry> zypp::VendorAttr::Impl::VendorMatch
private

Definition at line 86 of file VendorAttr.cc.

Constructor & Destructor Documentation

◆ Impl()

zypp::VendorAttr::Impl::Impl ( )
inline

Ctor.

bsc#1030686: The legacy default equivalence of 'suse' and 'opensuse' has been removed. bnc#812608: No prefix compare in opensuse namespace, so just create a class for 'suse*'

Definition at line 50 of file VendorAttr.cc.

Member Function Documentation

◆ addVendorList()

void zypp::VendorAttr::Impl::addVendorList ( VendorList &&  vendorList_r)

Add a new equivalent vendor set.

Definition at line 156 of file VendorAttr.cc.

◆ equivalent()

bool zypp::VendorAttr::Impl::equivalent ( IdString  lVendor,
IdString  rVendor 
) const
inline

Return whether two vendor strings should be treated as equivalent.

Definition at line 58 of file VendorAttr.cc.

◆ foreachVendorList()

unsigned zypp::VendorAttr::Impl::foreachVendorList ( std::function< bool(VendorList)>  fnc_r) const
inline

Definition at line 61 of file VendorAttr.cc.

◆ vendorMatchIdReset()

void zypp::VendorAttr::Impl::vendorMatchIdReset ( )
inlineprivate

Reset vendor match cache if _vendorGroupMap was changed.

Definition at line 91 of file VendorAttr.cc.

◆ vendorMatchId()

unsigned zypp::VendorAttr::Impl::vendorMatchId ( IdString  vendor) const
private

Helper mapping a vendor string to it's eqivalence class ID.

  • Return the vendor strings eqivalence class ID stored in _vendorMatch.
  • If not found, assign and return the eqivalence class ID of the lowercased string.
  • If not found, assign and return a new ID (look into the predefined VendorGroupMap (id>0), otherwise create a new ID (<0)).

Definition at line 113 of file VendorAttr.cc.

◆ clone()

Impl* zypp::VendorAttr::Impl::clone ( ) const
inlineprivate

clone for RWCOW_pointer

Definition at line 109 of file VendorAttr.cc.

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  str,
const Impl obj 
)
friend

◆ rwcowClone

Impl* rwcowClone ( const Impl rhs)
friend

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream &  str,
const VendorAttr::Impl obj 
)
related

Stream output

Definition at line 198 of file VendorAttr.cc.

Member Data Documentation

◆ _vendorGroupMap

VendorGroupMap zypp::VendorAttr::Impl::_vendorGroupMap
private

Vendor group definition. Equivalent groups share the same ID.

Definition at line 81 of file VendorAttr.cc.

◆ _vendorGroupId

unsigned zypp::VendorAttr::Impl::_vendorGroupId = 0
private

Highest group ID in use (incremented).

Definition at line 82 of file VendorAttr.cc.

◆ _vendorMatch

VendorMatch zypp::VendorAttr::Impl::_vendorMatch
mutableprivate

Cache mapping vendor strings to equivalence class ID.

Definition at line 87 of file VendorAttr.cc.

◆ _nextId

unsigned zypp::VendorAttr::Impl::_nextId = 0
mutableprivate

Least equivalence class ID in use (decremented).

Definition at line 88 of file VendorAttr.cc.


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