zypp::Arch Class Reference

Architecture. More...

#include <Arch.h>

List of all members.

Public Types

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

Public Member Functions

 Arch ()
 Default ctor 'noarch'.
 Arch (const std::string &rhs)
 Ctor from string.
const std::string & asString () const
 String representation of Arch.
bool empty () const
 Test for an empty Arch (this is "", not Arch_noarch).
bool compatibleWith (const Arch &targetArch_r) const
 Compatibility relation.
int compare (const Arch &rhs) const
 Arch comparison.

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)
 stream output.
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_noarch
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
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)

Classes

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


Detailed Description

Architecture.

Definition at line 34 of file Arch.h.


Member Typedef Documentation

typedef std::set<Arch,CompareByGT<Arch> > zypp::Arch::CompatSet

Reversed arch order, best Arch first.

Definition at line 74 of file Arch.h.


Constructor & Destructor Documentation

zypp::Arch::Arch (  ) 

Default ctor 'noarch'.

Definition at line 361 of file Arch.cc.

References _entry.

Referenced by compatSet().

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

Ctor from string.

Definition at line 370 of file Arch.cc.

References _entry.

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

Definition at line 379 of file Arch.cc.

References _entry.


Member Function Documentation

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

String representation of Arch.

Definition at line 388 of file Arch.cc.

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

Referenced by asString(), empty(), zypp::solver::detail::helixXML(), zypp::parser::susetags::makeSharedIdent(), zypp::repo::RepoVariablesStringReplacer::operator()(), operator<<(), operator==(), zypp::parser::susetags::ContentFileReader::parse(), and zypp::storage::toXML().

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

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

Definition at line 48 of file Arch.h.

References asString().

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

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

Referenced by zypp::repo::susetags::Downloader::download(), zypp::ArchCompatibleWith::operator()(), zypp::parser::susetags::ContentFileReader::parse(), and zypp::parser::susetags::RepoParser::Impl::parse().

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

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

Referenced by zypp::NVRA::compare(), compare(), operator()(), zypp::parser::susetags::ContentFileReader::parse(), and zypp::solver::detail::QueueItemRequire::process().

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

Arch comparison (static version).

Definition at line 69 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 412 of file Arch.cc.

References _entry, and Arch().

Referenced by zypp::repo::RepoVariablesStringReplacer::operator()().

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

Definition at line 92 of file Arch.h.

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


Friends And Related Function Documentation

const Arch Arch_noarch [related]

Definition at line 114 of file Arch.h.

const Arch Arch_x86_64 [related]

Definition at line 117 of file Arch.h.

const Arch Arch_athlon [related]

Definition at line 119 of file Arch.h.

const Arch Arch_i686 [related]

Definition at line 121 of file Arch.h.

const Arch Arch_i586 [related]

Definition at line 123 of file Arch.h.

const Arch Arch_i486 [related]

Definition at line 125 of file Arch.h.

const Arch Arch_i386 [related]

Definition at line 127 of file Arch.h.

const Arch Arch_s390x [related]

Definition at line 130 of file Arch.h.

const Arch Arch_s390 [related]

Definition at line 132 of file Arch.h.

const Arch Arch_ppc64 [related]

Definition at line 135 of file Arch.h.

const Arch Arch_ppc [related]

Definition at line 137 of file Arch.h.

const Arch Arch_ia64 [related]

Definition at line 140 of file Arch.h.

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

stream output.

Definition at line 146 of file Arch.h.

References asString().

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

Definition at line 152 of file Arch.h.

References asString().

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

Definition at line 156 of file Arch.h.

References asString().

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

Definition at line 160 of file Arch.h.

References asString().

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

Definition at line 164 of file Arch.h.

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

Definition at line 168 of file Arch.h.

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

Definition at line 172 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 203 of file Arch.h.

References compare().


Member Data Documentation

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

Definition at line 102 of file Arch.h.

Referenced by Arch(), asString(), compare(), compatibleWith(), and compatSet().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:13 2007 for libzypp by  doxygen 1.5.3