128 {
return ! ( lhs == rhs ); }
155 #define DEF_BUILTIN(A) static inline const IdString & _##A () { static IdString __str(#A); return __str; }
225 typedef Arch::CompatEntry CompatEntry;
228 typedef std::tr1::unordered_set<CompatEntry> Set;
229 typedef Set::iterator iterator;
230 typedef Set::const_iterator const_iterator;
233 static ArchCompatSet & instance()
235 static ArchCompatSet _instance;
242 const Arch::CompatEntry & assertDef(
const std::string & archStr_r )
243 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
245 const Arch::CompatEntry & assertDef( IdString archStr_r )
246 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r ) ).first; }
248 const_iterator begin()
const
251 const_iterator end()
const
256 int operator()(
const CompatEntry & lhs,
const CompatEntry & rhs )
const
257 {
return lhs._idBit.value() < rhs._idBit.value(); }
260 std::ostream &
dumpOn( std::ostream & str )
const
262 str <<
"ArchCompatSet:";
264 ov.sort( DumpOnCompare() );
265 for_( it, ov.begin(), ov.end() )
267 str << endl <<
' ' << *it;
279 _compatSet.insert( Arch::CompatEntry( _noarch(), 0 ) );
286 defCompatibleWith( _i386(), _noarch() );
287 defCompatibleWith( _i486(), _noarch(),_i386() );
288 defCompatibleWith( _i586(), _noarch(),_i386(),_i486() );
289 defCompatibleWith( _i686(), _noarch(),_i386(),_i486(),_i586() );
290 defCompatibleWith( _athlon(), _noarch(),_i386(),_i486(),_i586(),_i686() );
291 defCompatibleWith( _x86_64(), _noarch(),_i386(),_i486(),_i586(),_i686(),_athlon() );
293 defCompatibleWith( _pentium3(), _noarch(),_i386(),_i486(),_i586(),_i686() );
294 defCompatibleWith( _pentium4(), _noarch(),_i386(),_i486(),_i586(),_i686(),_pentium3() );
296 defCompatibleWith( _ia64(), _noarch(),_i386(),_i486(),_i586(),_i686() );
298 defCompatibleWith( _s390(), _noarch() );
299 defCompatibleWith( _s390x(), _noarch(),_s390() );
301 defCompatibleWith( _ppc(), _noarch() );
302 defCompatibleWith( _ppc64(), _noarch(),_ppc() );
303 defCompatibleWith( _ppc64p7(), _noarch(),_ppc(),_ppc64() );
305 defCompatibleWith( _alpha(), _noarch() );
306 defCompatibleWith( _alphaev5(), _noarch(),_alpha() );
307 defCompatibleWith( _alphaev56(), _noarch(),_alpha(),_alphaev5() );
308 defCompatibleWith( _alphapca56(), _noarch(),_alpha(),_alphaev5(),_alphaev56() );
309 defCompatibleWith( _alphaev6(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56() );
310 defCompatibleWith( _alphaev67(), _noarch(),_alpha(),_alphaev5(),_alphaev56(),_alphapca56(),_alphaev6() );
312 defCompatibleWith( _sparc(), _noarch() );
313 defCompatibleWith( _sparcv8(), _noarch(),_sparc() );
314 defCompatibleWith( _sparcv9(), _noarch(),_sparc(),_sparcv8() );
315 defCompatibleWith( _sparcv9v(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
317 defCompatibleWith( _sparc64(), _noarch(),_sparc(),_sparcv8(),_sparcv9() );
318 defCompatibleWith( _sparc64v(), _noarch(),_sparc(),_sparcv8(),_sparcv9(),_sparcv9v(),_sparc64() );
320 defCompatibleWith( _armv3l(), _noarch() );
321 defCompatibleWith( _armv4l(), _noarch(),_armv3l() );
322 defCompatibleWith( _armv4tl(), _noarch(),_armv3l(),_armv4l() );
323 defCompatibleWith( _armv5l(), _noarch(),_armv3l(),_armv4l(),_armv4tl() );
324 defCompatibleWith( _armv5tel(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l() );
325 defCompatibleWith( _armv5tejl(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel() );
326 defCompatibleWith( _armv6l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl() );
327 defCompatibleWith( _armv6hl(), _noarch() );
328 defCompatibleWith( _armv7l(), _noarch(),_armv3l(),_armv4l(),_armv4tl(),_armv5l(),_armv5tel(),_armv5tejl(),_armv6l() );
329 defCompatibleWith( _armv7hl(), _noarch(),_armv6hl() );
330 defCompatibleWith( _armv7nhl(), _noarch(),_armv7hl() );
331 defCompatibleWith( _armv7thl(), _noarch(),_armv7hl() );
332 defCompatibleWith( _armv7tnhl(), _noarch(),_armv7hl(),_armv7nhl(),_armv7thl() );
333 defCompatibleWith( _aarch64(), _noarch() );
335 defCompatibleWith( _sh3(), _noarch() );
337 defCompatibleWith( _sh4(), _noarch() );
338 defCompatibleWith( _sh4a(), _noarch(),_sh4() );
356 ZYPP_THROW( Exception(
"Need more bits to encode architectures.") );
365 const CompatEntry & assertCompatSetEntry( IdString archStr_r )
366 {
return *
_compatSet.insert( Arch::CompatEntry( archStr_r, nextIdBit() ) ).first; }
370 void defCompatibleWith( IdString targetArch_r,
372 IdString arch1_r = IdString(),
373 IdString arch2_r = IdString(),
374 IdString arch3_r = IdString(),
375 IdString arch4_r = IdString(),
376 IdString arch5_r = IdString(),
377 IdString arch6_r = IdString(),
378 IdString arch7_r = IdString(),
379 IdString arch8_r = IdString(),
380 IdString arch9_r = IdString() )
382 const CompatEntry & target( assertCompatSetEntry( targetArch_r ) );
383 target.addCompatBit( assertCompatSetEntry( arch0_r )._idBit );
384 #define _SETARG(N) if ( arch##N##_r.empty() ) return; target.addCompatBit( assertCompatSetEntry( arch##N##_r )._idBit )
466 : _entry( &ArchCompatSet::instance().assertDef( _noarch() ) )
470 : _entry( &ArchCompatSet::instance().assertDef(
IdString(id_r) ) )
474 : _entry( &ArchCompatSet::instance().assertDef( idstr_r ) )
478 : _entry( &ArchCompatSet::instance().assertDef( str_r ) )
482 : _entry( &ArchCompatSet::instance().assertDef( cstr_r ) )
551 if ( cset.size() > 2 )
553 return *(++cset.rbegin());
575 for ( ArchCompatSet::const_iterator it = ArchCompatSet::instance().begin();
576 it != ArchCompatSet::instance().end(); ++it )
578 if ( it->compatibleWith( *targetArch_r.
_entry ) )
580 ret.insert(
Arch(*it) );
const Arch Arch_sh3(_sh3())
const Arch Arch_armv3l(_armv3l())
_IntT value() const
Return the value.
const Arch Arch_armv5l(_armv5l())
const Arch Arch_sparcv9(_sparcv9())
const Arch Arch_s390x(_s390x())
bool compatibleWith(const Arch &targetArch_r) const
Compatibility relation.
int compare(const CompatEntry &rhs) const
compare by score, then archStr.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
const std::string & asString() const
IdType id() const
Expert backdoor.
const Arch Arch_i686(_i686())
const Arch Arch_alphaev67(_alphaev67())
std::set< Arch, CompareByGT< Arch > > CompatSet
Reversed arch order, best Arch first.
const Arch Arch_ia64(_ia64())
const Arch Arch_empty(IdString::Empty)
const Arch Arch_ppc64(_ppc64())
const Arch Arch_armv5tel(_armv5tel())
const Arch Arch_sparcv8(_sparcv8())
const Arch Arch_aarch64(_aarch64())
IdString idStr() const
String representation of Arch.
Access to the sat-pools string space.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
const Arch Arch_ppc(_ppc())
const Arch Arch_armv7hl(_armv7hl())
const Arch Arch_noarch(_noarch())
CompatEntry(const std::string &archStr_r, CompatBits::IntT idBit_r=1)
const Arch Arch_sparc64v(_sparc64v())
const Arch Arch_armv5tejl(_armv5tejl())
const Arch Arch_sparcv9v(_sparcv9v())
const Arch Arch_sh4a(_sh4a())
int compare(const Arch &rhs) const
Arch comparison.
const Arch Arch_sh4(_sh4())
const Arch Arch_i586(_i586())
const CompatEntry * _entry
const Arch Arch_armv6l(_armv6l())
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
static const IdString Empty
Empty string.
const Arch Arch_armv7tnhl(_armv7tnhl())
const Arch Arch_sparc64(_sparc64())
sat::detail::IdType IdType
const Arch Arch_s390(_s390())
std::ostream & operator<<(std::ostream &str, const Arch::CompatEntry &obj)
const Arch Arch_pentium3(_pentium3())
const Arch Arch_armv7nhl(_armv7nhl())
#define ZYPP_DEFINE_ID_HASHABLE(C)
Define hash function for id based classes.
const Arch Arch_athlon(_athlon())
const Arch Arch_alphapca56(_alphapca56())
void addCompatBit(const CompatBits &idBit_r) const
const Arch Arch_i386(_i386())
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
const Arch Arch_x86_64(_x86_64())
bit::BitField< uint64_t > CompatBits
Bitfield for architecture IDs and compatBits relation.
std::string numstring(char n, int w=0)
static CompatSet compatSet(const Arch &targetArch_r)
Return a set of all Arch's compatibleWith a targetArch_r.
const Arch Arch_armv6hl(_armv6hl())
const Arch Arch_armv7thl(_armv7thl())
std::string form(const char *format,...)
Printf style construction of std::string.
const Arch Arch_alphaev6(_alphaev6())
bool operator!=(const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
const Arch Arch_armv7l(_armv7l())
Arch()
Default ctor Arc_noarch.
const Arch Arch_armv4tl(_armv4tl())
bool compatibleWith(const CompatEntry &targetEntry_r) const
Return whether this is compatible with targetEntry_r.
IdString::IdType id() const
const Arch Arch_sparc(_sparc())
const Arch Arch_alphaev5(_alphaev5())
bool isBuiltIn() const
Whether this is a buitin (or known) architecture.
const Arch Arch_alpha(_alpha())
const Arch Arch_alphaev56(_alphaev56())
const Arch Arch_i486(_i486())
bool operator==(const Arch::CompatEntry &lhs, const Arch::CompatEntry &rhs)
static const unsigned size
CompatEntry(IdString archStr_r, CompatBits::IntT idBit_r=1)
const Arch Arch_armv4l(_armv4l())
const Arch Arch_pentium4(_pentium4())
const Arch Arch_ppc64p7(_ppc64p7())
Holds an architecture ID and it's compatible relation.