libzypp  17.24.2
zypp::VendorAttr::Impl Class Reference

VendorAttr implementation. More...

Public Member Functions

void legacySetup ()
 bsc#1030686: The legacy default equivalence of 'suse' and 'opensuse' has been removed. 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...
 

Private Types

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

Private Member Functions

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

Private Attributes

VendorMap _vendorMap
 
unsigned vendorGroupCounter = 1
 
int _nextId = -1
 
VendorMatch _vendorMatch
 

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

◆ VendorMap

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

Definition at line 66 of file VendorAttr.cc.

◆ VendorMatchEntry

Definition at line 71 of file VendorAttr.cc.

◆ VendorMatch

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

Definition at line 72 of file VendorAttr.cc.

Member Function Documentation

◆ legacySetup()

void zypp::VendorAttr::Impl::legacySetup ( )
inline

bsc#1030686: The legacy default equivalence of 'suse' and 'opensuse' has been removed.

Unless they are mentioned in a custom rule, create separate classes for them.

Definition at line 48 of file VendorAttr.cc.

◆ addVendorList()

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

Add a new equivalent vendor set.

Definition at line 139 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 62 of file VendorAttr.cc.

◆ vendorMatchIdReset()

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

Reset match cache if global VendorMap was changed.

Definition at line 77 of file VendorAttr.cc.

◆ vendorMatchId()

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

Helper mapping vendor string to 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 VendorMap (id>0), otherwise create a new ID (<0)).

Definition at line 100 of file VendorAttr.cc.

◆ clone()

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

clone for RWCOW_pointer

Definition at line 96 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 188 of file VendorAttr.cc.

Member Data Documentation

◆ _vendorMap

VendorMap zypp::VendorAttr::Impl::_vendorMap
mutableprivate

Definition at line 67 of file VendorAttr.cc.

◆ vendorGroupCounter

unsigned zypp::VendorAttr::Impl::vendorGroupCounter = 1
private

Definition at line 68 of file VendorAttr.cc.

◆ _nextId

int zypp::VendorAttr::Impl::_nextId = -1
mutableprivate

Definition at line 73 of file VendorAttr.cc.

◆ _vendorMatch

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

Definition at line 74 of file VendorAttr.cc.


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