zypp::Arch Class Reference

Architecture. More...

#include <Arch.h>

List of all members.

Classes

struct  CompatEntry
 Holds an architecture ID and it's compatible relation. More...

Public Types

typedef std::set< Arch,
CompareByGT< Arch > > 
CompatSet
 Reversed arch order, best Arch first.

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)
bool isBuiltIn () const
 Whether this is a buitin (or known) architecture.
bool compatibleWith (const Arch &targetArch_r) const
 Compatibility relation.
int compare (const Arch &rhs) const
 Arch comparison.
IdStringType like interface.
We can't use the complete IdStringType mixin until _doCompare can be redefined on any level, not just as char*.

IdString idStr () const
 String representation of Arch.
const std::string & asString () const
const char * c_str () const
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.

Static Public Member Functions

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)

Private Member Functions

 Arch (const CompatEntry &)

Private Attributes

const CompatEntry_entry

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Arch &obj)
template<>
bool operator() (const zypp::Arch &lhs, const zypp::Arch &rhs) const
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
const Arch Arch_noarch
const Arch Arch_pentium4
const Arch Arch_pentium3
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_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_sparcv9v
const Arch Arch_sparc64
const Arch Arch_sparcv9
const Arch Arch_sparcv8
const Arch Arch_sparc
const Arch Arch_armv7l
const Arch Arch_armv6l
const Arch Arch_armv5tejl
const Arch Arch_armv5tel
const Arch Arch_armv5l
const Arch Arch_armv4tl
const Arch Arch_armv4l
const Arch Arch_armv3l
const Arch Arch_sh3
const Arch Arch_sh4
const Arch Arch_sh4a
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)


Detailed Description

Architecture.

Definition at line 36 of file Arch.h.


Member Typedef Documentation

Reversed arch order, best Arch first.

Definition at line 107 of file Arch.h.


Constructor & Destructor Documentation

zypp::Arch::Arch (  ) 

Default ctor Arc_noarch.

Definition at line 445 of file Arch.cc.

Referenced by compatSet().

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

Ctor taking Arch as string.

Definition at line 449 of file Arch.cc.

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

Definition at line 453 of file Arch.cc.

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

Definition at line 457 of file Arch.cc.

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

Definition at line 461 of file Arch.cc.

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

Definition at line 465 of file Arch.cc.


Member Function Documentation

IdString zypp::Arch::idStr (  )  const

String representation of Arch.

Definition at line 474 of file Arch.cc.

References _entry, and zypp::Arch::CompatEntry::_idStr.

Referenced by id().

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 482 of file Arch.cc.

References zypp::Arch::CompatEntry::_archStr, and _entry.

Referenced by asString(), c_str(), empty(), zypp::solver::detail::helixXML(), zypp::repo::RepoVariablesStringReplacer::operator()(), operator<<(), operator==(), zypp::sat::detail::PoolImpl::prepare(), and size().

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.

References asString().

Referenced by zypp::InstanceId::getIdFor(), and zypp::parser::operator<<().

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.

References asString().

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

Size of the string representation.

Definition at line 67 of file Arch.h.

References asString().

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

Expert backdoor.

Definition at line 71 of file Arch.h.

References zypp::IdString::id(), and idStr().

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 490 of file Arch.cc.

References _entry, and zypp::Arch::CompatEntry::isBuiltIn().

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;
 Arch_i686.compatibleWith( Arch_x86_64 ) ==> true;
 Arch_x86_64.compatibleWith( Arch_i686 ) ==> false;

Definition at line 498 of file Arch.cc.

References _entry, and zypp::Arch::CompatEntry::compatibleWith().

Referenced by zypp::repo::susetags::Downloader::download(), and zypp::ArchCompatibleWith::operator()().

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

Arch comparison.

Primary key is the number of compatible Archs, then the string representation. Thus Arch_noarch is the least Arch.

Definition at line 506 of file Arch.cc.

References _entry, and zypp::Arch::CompatEntry::compare().

Referenced by compare(), and operator()().

static int zypp::Arch::compare ( const Arch lhs,
const Arch rhs 
) [inline, static]

Arch comparison (static version).

Definition at line 102 of file Arch.h.

References compare().

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.
 Arch::CompatSet cset( Arch::compatSet( Arch_x86_64 ) );

 cout << str::join( make_transform_iterator( cset.begin(), std::mem_fun_ref(&Arch::asString) ),
                    make_transform_iterator( cset.end(), std::mem_fun_ref(&Arch::asString) ) )
      << endl;

 // Prints: x86_64 athlon i686 i586 i486 i386 noarch

Definition at line 514 of file Arch.cc.

References _entry, and Arch().

Referenced by zypp::sat::detail::PoolImpl::_postRepoAdd(), and zypp::repo::RepoVariablesStringReplacer::operator()().

static std::string zypp::Arch::asString ( const CompatSet cset  )  [inline, static]

Definition at line 125 of file Arch.h.

References asString(), and zypp::str::join().


Friends And Related Function Documentation

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 152 of file Arch.h.

const Arch Arch_noarch [related]

Definition at line 155 of file Arch.h.

const Arch Arch_pentium4 [related]

Definition at line 158 of file Arch.h.

const Arch Arch_pentium3 [related]

Definition at line 160 of file Arch.h.

const Arch Arch_x86_64 [related]

Definition at line 163 of file Arch.h.

const Arch Arch_athlon [related]

Definition at line 165 of file Arch.h.

const Arch Arch_i686 [related]

Definition at line 167 of file Arch.h.

const Arch Arch_i586 [related]

Definition at line 169 of file Arch.h.

const Arch Arch_i486 [related]

Definition at line 171 of file Arch.h.

const Arch Arch_i386 [related]

Definition at line 173 of file Arch.h.

const Arch Arch_s390x [related]

Definition at line 176 of file Arch.h.

const Arch Arch_s390 [related]

Definition at line 178 of file Arch.h.

const Arch Arch_ppc64 [related]

Definition at line 181 of file Arch.h.

const Arch Arch_ppc [related]

Definition at line 183 of file Arch.h.

const Arch Arch_ia64 [related]

Definition at line 186 of file Arch.h.

const Arch Arch_alphaev67 [related]

Definition at line 189 of file Arch.h.

const Arch Arch_alphaev6 [related]

Definition at line 191 of file Arch.h.

const Arch Arch_alphapca56 [related]

Definition at line 193 of file Arch.h.

const Arch Arch_alphaev56 [related]

Definition at line 195 of file Arch.h.

const Arch Arch_alphaev5 [related]

Definition at line 197 of file Arch.h.

const Arch Arch_alpha [related]

Definition at line 199 of file Arch.h.

const Arch Arch_sparc64v [related]

Definition at line 202 of file Arch.h.

const Arch Arch_sparcv9v [related]

Definition at line 204 of file Arch.h.

const Arch Arch_sparc64 [related]

Definition at line 206 of file Arch.h.

const Arch Arch_sparcv9 [related]

Definition at line 208 of file Arch.h.

const Arch Arch_sparcv8 [related]

Definition at line 210 of file Arch.h.

const Arch Arch_sparc [related]

Definition at line 212 of file Arch.h.

const Arch Arch_armv7l [related]

Definition at line 215 of file Arch.h.

const Arch Arch_armv6l [related]

Definition at line 217 of file Arch.h.

const Arch Arch_armv5tejl [related]

Definition at line 219 of file Arch.h.

const Arch Arch_armv5tel [related]

Definition at line 221 of file Arch.h.

const Arch Arch_armv5l [related]

Definition at line 223 of file Arch.h.

const Arch Arch_armv4tl [related]

Definition at line 225 of file Arch.h.

const Arch Arch_armv4l [related]

Definition at line 227 of file Arch.h.

const Arch Arch_armv3l [related]

Definition at line 229 of file Arch.h.

const Arch Arch_sh3 [related]

Definition at line 232 of file Arch.h.

const Arch Arch_sh4 [related]

Definition at line 235 of file Arch.h.

const Arch Arch_sh4a [related]

Definition at line 237 of file Arch.h.

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

stream output.

Definition at line 243 of file Arch.h.

References asString().

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

Definition at line 249 of file Arch.h.

References asString().

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

Definition at line 253 of file Arch.h.

References asString().

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

Definition at line 257 of file Arch.h.

References asString().

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

Definition at line 261 of file Arch.h.

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

Definition at line 265 of file Arch.h.

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

Definition at line 269 of file Arch.h.

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

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

Definition at line 300 of file Arch.h.

References compare().


Member Data Documentation

const CompatEntry* zypp::Arch::_entry [private]

Definition at line 135 of file Arch.h.

Referenced by asString(), compare(), compatibleWith(), compatSet(), idStr(), and isBuiltIn().


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

doxygen