libzypp 17.31.23
zypp::Arch Class Reference

Architecture. More...

#include <Arch.h>

Classes

struct  CompatEntry
 Holds an architecture ID and its compatible relation. More...
 

Public Member Functions

 Arch ()
 Default ctor Arc_noarch.
 
 Arch (IdString::IdType id_r)
 Ctor taking Arch as string.
 
 Arch (const IdString &idstr_r)
 
 Arch (const std::string &str_r)
 
 Arch (const char *cstr_r)
 

Related Functions

(Note that these are not member functions.)

template<>
bool operator() (const zypp::Arch &lhs, const zypp::Arch &rhs) const
 Default order for std::container based Arch::compare.
 
Builtin architecture constants.

Defined outside Arch as e.g.

Arch_i386, because some names, like i388, are used as #define, thus unusable as identifier like Arch::i386.

const Arch Arch_empty
 This is an empty Arch represented by an empty string.
 
const Arch Arch_noarch
 
const Arch Arch_pentium4
 
const Arch Arch_pentium3
 
const Arch Arch_x86_64_v4
 
const Arch Arch_x86_64_v3
 
const Arch Arch_x86_64_v2
 
const Arch Arch_x86_64
 
const Arch Arch_athlon
 
const Arch Arch_i686
 
const Arch Arch_i586
 
const Arch Arch_i486
 
const Arch Arch_i386
 
const Arch Arch_s390x
 
const Arch Arch_s390
 
const Arch Arch_ppc64le
 
const Arch Arch_ppc64p7
 
const Arch Arch_ppc64
 
const Arch Arch_ppc
 
const Arch Arch_ia64
 
const Arch Arch_alphaev67
 
const Arch Arch_alphaev6
 
const Arch Arch_alphapca56
 
const Arch Arch_alphaev56
 
const Arch Arch_alphaev5
 
const Arch Arch_alpha
 
const Arch Arch_sparc64v
 
const Arch Arch_sparc64
 
const Arch Arch_sparcv9v
 
const Arch Arch_sparcv9
 
const Arch Arch_sparcv8
 
const Arch Arch_sparc
 
const Arch Arch_aarch64
 
const Arch Arch_armv7tnhl
 
const Arch Arch_armv7thl
 
const Arch Arch_armv7hnl
 
const Arch Arch_armv7hl
 
const Arch Arch_armv6hl
 
const Arch Arch_armv8hl
 
const Arch Arch_armv8l
 
const Arch Arch_armv7l
 
const Arch Arch_armv6l
 
const Arch Arch_armv5tejl
 
const Arch Arch_armv5tel
 
const Arch Arch_armv5tl
 
const Arch Arch_armv5l
 
const Arch Arch_armv4tl
 
const Arch Arch_armv4l
 
const Arch Arch_armv3l
 
const Arch Arch_riscv64
 
const Arch Arch_sh3
 
const Arch Arch_sh4
 
const Arch Arch_sh4a
 
const Arch Arch_m68k
 
const Arch Arch_mips
 
const Arch Arch_mipsel
 
const Arch Arch_mips64
 
const Arch Arch_mips64el
 
std::ostream & operator<< (std::ostream &str, const Arch &obj)
 stream output.
 
std::ostream & dumpAsXmlOn (std::ostream &str, const Arch &obj)
 XML output.
 
Equality based on string value.
bool operator== (const Arch &lhs, const Arch &rhs)
 
bool operator== (const Arch &lhs, const std::string &rhs)
 
bool operator== (const std::string &lhs, const Arch &rhs)
 
bool operator!= (const Arch &lhs, const Arch &rhs)
 
bool operator!= (const Arch &lhs, const std::string &rhs)
 
bool operator!= (const std::string &lhs, const Arch &rhs)
 

IdStringType like interface.

We can't use the complete IdStringType mixin until _doCompare can be redefined on any level, not just as char*.

typedef std::set< Arch, CompareByGT< Arch > > CompatSet
 Reversed arch order, best Arch first.
 
const CompatEntry_entry
 
IdString idStr () const
 String representation of Arch.
 
const std::string & asString () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const char * c_str () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
bool empty () const
 Test for an empty Arch (this is Arch_epmty, not Arch_noarch ).
 
unsigned size () const
 Size of the string representation.
 
IdString::IdType id () const
 Expert backdoor.
 
bool isBuiltIn () const
 Whether this is a buitin (or known) architecture.
 
bool compatibleWith (const Arch &targetArch_r) const
 Compatibility relation.
 
Arch baseArch () const
 
int compare (const Arch &rhs) const
 Arch comparison.
 
static Arch baseArch (const Arch &targetArch_r)
 
static int compare (const Arch &lhs, const Arch &rhs)
 Arch comparison (static version).
 
static CompatSet compatSet (const Arch &targetArch_r)
 Return a set of all Arch's compatibleWith a targetArch_r.
 
static std::string asString (const CompatSet &cset)
 
 Arch (const CompatEntry &)
 

Detailed Description

Architecture.

Definition at line 36 of file Arch.h.

Member Typedef Documentation

◆ CompatSet

Reversed arch order, best Arch first.

Definition at line 117 of file Arch.h.

Constructor & Destructor Documentation

◆ Arch() [1/6]

zypp::Arch::Arch ( )

Default ctor Arc_noarch.

Definition at line 458 of file Arch.cc.

◆ Arch() [2/6]

zypp::Arch::Arch ( IdString::IdType  id_r)
explicit

Ctor taking Arch as string.

Definition at line 462 of file Arch.cc.

◆ Arch() [3/6]

zypp::Arch::Arch ( const IdString idstr_r)
explicit

Definition at line 466 of file Arch.cc.

◆ Arch() [4/6]

zypp::Arch::Arch ( const std::string &  str_r)
explicit

Definition at line 470 of file Arch.cc.

◆ Arch() [5/6]

zypp::Arch::Arch ( const char *  cstr_r)
explicit

Definition at line 474 of file Arch.cc.

◆ Arch() [6/6]

zypp::Arch::Arch ( const CompatEntry rhs)
private

Definition at line 478 of file Arch.cc.

Member Function Documentation

◆ idStr()

IdString zypp::Arch::idStr ( ) const

String representation of Arch.

Definition at line 487 of file Arch.cc.

◆ asString() [1/2]

const std::string & zypp::Arch::asString ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 495 of file Arch.cc.

◆ c_str()

const char * zypp::Arch::c_str ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 59 of file Arch.h.

◆ empty()

bool zypp::Arch::empty ( ) const
inline

Test for an empty Arch (this is Arch_epmty, not Arch_noarch ).

Definition at line 63 of file Arch.h.

◆ size()

unsigned zypp::Arch::size ( ) const
inline

Size of the string representation.

Definition at line 67 of file Arch.h.

◆ id()

IdString::IdType zypp::Arch::id ( ) const
inline

Expert backdoor.

Definition at line 71 of file Arch.h.

◆ isBuiltIn()

bool zypp::Arch::isBuiltIn ( ) const

Whether this is a buitin (or known) architecture.

Used e.g. in Capability to determine whether some trailing ".string" is part ot the name or restriction to an architecture.

Definition at line 503 of file Arch.cc.

◆ compatibleWith()

bool zypp::Arch::compatibleWith ( const Arch targetArch_r) const

Compatibility relation.

Returns
True iff this is compatible with targetArch_r.
Arch_noarch.compatibleWith( ... ) ==> always true;
const Arch Arch_i686
Definition: Arch.h:186
const Arch Arch_noarch
Definition: Arch.h:168
bool compatibleWith(const Arch &targetArch_r) const
Compatibility relation.
Definition: Arch.cc:511
const Arch Arch_x86_64
Definition: Arch.h:182

Definition at line 511 of file Arch.cc.

◆ baseArch() [1/2]

Arch zypp::Arch::baseArch ( ) const
Returns
the arch before noarch if it's not a multilib arch (e.g. x86_64,sparc64v,sparc64,ppc64,s390x).

Definition at line 519 of file Arch.cc.

◆ baseArch() [2/2]

static Arch zypp::Arch::baseArch ( const Arch targetArch_r)
inlinestatic

Definition at line 101 of file Arch.h.

◆ compare() [1/2]

int zypp::Arch::compare ( const Arch rhs) const

Arch comparison.

Compatible architectures are treated as less (i.e. i686>i386>noarch). So Arch_noarch is the least Arch. Equivalent architectures (compatible in both directions) are ordered arbitrary.

Definition at line 556 of file Arch.cc.

◆ compare() [2/2]

static int zypp::Arch::compare ( const Arch lhs,
const Arch rhs 
)
inlinestatic

Arch comparison (static version).

Definition at line 112 of file Arch.h.

◆ compatSet()

Arch::CompatSet zypp::Arch::compatSet ( const Arch targetArch_r)
static

Return a set of all Arch's compatibleWith a targetArch_r.

Note
The set is ordered according to compare, thus iterating will start at targetArch_r and end with Arch_noarch.
cout << str::join( make_transform_iterator( cset.begin(), std::mem_fn(&Arch::asString) ),
make_transform_iterator( cset.end(), std::mem_fn(&Arch::asString) ) )
<< endl;
// Prints: x86_64 athlon i686 i586 i486 i386 noarch
std::set< Arch, CompareByGT< Arch > > CompatSet
Reversed arch order, best Arch first.
Definition: Arch.h:117
static CompatSet compatSet(const Arch &targetArch_r)
Return a set of all Arch's compatibleWith a targetArch_r.
Definition: Arch.cc:564
const std::string & asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: Arch.cc:495
std::string join(TIterator begin, TIterator end, const C_Str &sep_r=" ")
Join strings using separator sep_r (defaults to BLANK).
Definition: String.h:776

Definition at line 564 of file Arch.cc.

◆ asString() [2/2]

static std::string zypp::Arch::asString ( const CompatSet cset)
inlinestatic

Definition at line 135 of file Arch.h.

Friends And Related Function Documentation

◆ Arch_empty

const Arch Arch_empty
related

This is an empty Arch represented by an empty string.

Sometimes used to indicate an any or an unknown Arch. Don't confuse this with Arch_noarch, which is in fact an architecture.

Definition at line 165 of file Arch.h.

◆ Arch_noarch

const Arch Arch_noarch
related

Definition at line 168 of file Arch.h.

◆ Arch_pentium4

const Arch Arch_pentium4
related

Definition at line 171 of file Arch.h.

◆ Arch_pentium3

const Arch Arch_pentium3
related

Definition at line 173 of file Arch.h.

◆ Arch_x86_64_v4

const Arch Arch_x86_64_v4
related

Definition at line 176 of file Arch.h.

◆ Arch_x86_64_v3

const Arch Arch_x86_64_v3
related

Definition at line 178 of file Arch.h.

◆ Arch_x86_64_v2

const Arch Arch_x86_64_v2
related

Definition at line 180 of file Arch.h.

◆ Arch_x86_64

const Arch Arch_x86_64
related

Definition at line 182 of file Arch.h.

◆ Arch_athlon

const Arch Arch_athlon
related

Definition at line 184 of file Arch.h.

◆ Arch_i686

const Arch Arch_i686
related

Definition at line 186 of file Arch.h.

◆ Arch_i586

const Arch Arch_i586
related

Definition at line 188 of file Arch.h.

◆ Arch_i486

const Arch Arch_i486
related

Definition at line 190 of file Arch.h.

◆ Arch_i386

const Arch Arch_i386
related

Definition at line 192 of file Arch.h.

◆ Arch_s390x

const Arch Arch_s390x
related

Definition at line 195 of file Arch.h.

◆ Arch_s390

const Arch Arch_s390
related

Definition at line 197 of file Arch.h.

◆ Arch_ppc64le

const Arch Arch_ppc64le
related

Definition at line 200 of file Arch.h.

◆ Arch_ppc64p7

const Arch Arch_ppc64p7
related

Definition at line 203 of file Arch.h.

◆ Arch_ppc64

const Arch Arch_ppc64
related

Definition at line 205 of file Arch.h.

◆ Arch_ppc

const Arch Arch_ppc
related

Definition at line 207 of file Arch.h.

◆ Arch_ia64

const Arch Arch_ia64
related

Definition at line 210 of file Arch.h.

◆ Arch_alphaev67

const Arch Arch_alphaev67
related

Definition at line 213 of file Arch.h.

◆ Arch_alphaev6

const Arch Arch_alphaev6
related

Definition at line 215 of file Arch.h.

◆ Arch_alphapca56

const Arch Arch_alphapca56
related

Definition at line 217 of file Arch.h.

◆ Arch_alphaev56

const Arch Arch_alphaev56
related

Definition at line 219 of file Arch.h.

◆ Arch_alphaev5

const Arch Arch_alphaev5
related

Definition at line 221 of file Arch.h.

◆ Arch_alpha

const Arch Arch_alpha
related

Definition at line 223 of file Arch.h.

◆ Arch_sparc64v

const Arch Arch_sparc64v
related

Definition at line 226 of file Arch.h.

◆ Arch_sparc64

const Arch Arch_sparc64
related

Definition at line 228 of file Arch.h.

◆ Arch_sparcv9v

const Arch Arch_sparcv9v
related

Definition at line 230 of file Arch.h.

◆ Arch_sparcv9

const Arch Arch_sparcv9
related

Definition at line 232 of file Arch.h.

◆ Arch_sparcv8

const Arch Arch_sparcv8
related

Definition at line 234 of file Arch.h.

◆ Arch_sparc

const Arch Arch_sparc
related

Definition at line 236 of file Arch.h.

◆ Arch_aarch64

const Arch Arch_aarch64
related

Definition at line 239 of file Arch.h.

◆ Arch_armv7tnhl

const Arch Arch_armv7tnhl
related

Definition at line 242 of file Arch.h.

◆ Arch_armv7thl

const Arch Arch_armv7thl
related

Definition at line 244 of file Arch.h.

◆ Arch_armv7hnl

const Arch Arch_armv7hnl
related

Definition at line 247 of file Arch.h.

◆ Arch_armv7hl

const Arch Arch_armv7hl
related

Definition at line 249 of file Arch.h.

◆ Arch_armv6hl

const Arch Arch_armv6hl
related

Definition at line 251 of file Arch.h.

◆ Arch_armv8hl

const Arch Arch_armv8hl
related

Definition at line 254 of file Arch.h.

◆ Arch_armv8l

const Arch Arch_armv8l
related

Definition at line 256 of file Arch.h.

◆ Arch_armv7l

const Arch Arch_armv7l
related

Definition at line 258 of file Arch.h.

◆ Arch_armv6l

const Arch Arch_armv6l
related

Definition at line 260 of file Arch.h.

◆ Arch_armv5tejl

const Arch Arch_armv5tejl
related

Definition at line 262 of file Arch.h.

◆ Arch_armv5tel

const Arch Arch_armv5tel
related

Definition at line 264 of file Arch.h.

◆ Arch_armv5tl

const Arch Arch_armv5tl
related

Definition at line 266 of file Arch.h.

◆ Arch_armv5l

const Arch Arch_armv5l
related

Definition at line 268 of file Arch.h.

◆ Arch_armv4tl

const Arch Arch_armv4tl
related

Definition at line 270 of file Arch.h.

◆ Arch_armv4l

const Arch Arch_armv4l
related

Definition at line 272 of file Arch.h.

◆ Arch_armv3l

const Arch Arch_armv3l
related

Definition at line 274 of file Arch.h.

◆ Arch_riscv64

const Arch Arch_riscv64
related

Definition at line 277 of file Arch.h.

◆ Arch_sh3

const Arch Arch_sh3
related

Definition at line 280 of file Arch.h.

◆ Arch_sh4

const Arch Arch_sh4
related

Definition at line 283 of file Arch.h.

◆ Arch_sh4a

const Arch Arch_sh4a
related

Definition at line 285 of file Arch.h.

◆ Arch_m68k

const Arch Arch_m68k
related

Definition at line 288 of file Arch.h.

◆ Arch_mips

const Arch Arch_mips
related

Definition at line 291 of file Arch.h.

◆ Arch_mipsel

const Arch Arch_mipsel
related

Definition at line 293 of file Arch.h.

◆ Arch_mips64

const Arch Arch_mips64
related

Definition at line 295 of file Arch.h.

◆ Arch_mips64el

const Arch Arch_mips64el
related

Definition at line 297 of file Arch.h.

◆ operator<<()

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

stream output.

Definition at line 303 of file Arch.h.

◆ dumpAsXmlOn()

std::ostream & dumpAsXmlOn ( std::ostream &  str,
const Arch obj 
)
related

XML output.

Definition at line 307 of file Arch.h.

◆ operator==() [1/3]

bool operator== ( const Arch lhs,
const Arch rhs 
)
related

Definition at line 313 of file Arch.h.

◆ operator==() [2/3]

bool operator== ( const Arch lhs,
const std::string &  rhs 
)
related

Definition at line 317 of file Arch.h.

◆ operator==() [3/3]

bool operator== ( const std::string &  lhs,
const Arch rhs 
)
related

Definition at line 321 of file Arch.h.

◆ operator!=() [1/3]

bool operator!= ( const Arch lhs,
const Arch rhs 
)
related

Definition at line 325 of file Arch.h.

◆ operator!=() [2/3]

bool operator!= ( const Arch lhs,
const std::string &  rhs 
)
related

Definition at line 329 of file Arch.h.

◆ operator!=() [3/3]

bool operator!= ( const std::string &  lhs,
const Arch rhs 
)
related

Definition at line 333 of file Arch.h.

◆ operator()()

bool operator() ( const zypp::Arch lhs,
const zypp::Arch rhs 
) const
related

Default order for std::container based Arch::compare.

Definition at line 367 of file Arch.h.

Member Data Documentation

◆ _entry

const CompatEntry* zypp::Arch::_entry
private

Definition at line 148 of file Arch.h.


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