Libzypp/Design/Resolvable/Kind
About Resolvable::Kind
The type of a Resolvables Kind is now available as
Resolvable::Kind
The former class ResKind was removed.
ResTraits<Resolvable> (in case you use them) provides it (the type)
as ResTraits<Resolvable>::KindType. The sole definition of a resolvables
kind as string is ResTraits<RESOLVABLETYPE>::_kind. Of course ther's no
ResTraits<Resolvable>::_kind nor ResTraits<ResObject>::_kind, as they are
just base classes. Classes derived from ResObject have _kind defined.
Resolvable::Kind is to be used like ResKind was. Just the conversion
operator into std::string was removed. If you happen to need the
string representation, use the asString() method.
Why?
We have (and will have) several other Kinds: Kind of Resolvable, Kind of Capability; Kind of Source ..
The implementation as KindOf<type> takes care that all Kind types behave the same way, although they are different types.
Implementation will be refined to associate a number with each Kind string. The numerical value will allow to use switches on kinds, instead of if/elseif/else cascades doing string comparison.
The numerical value might become a bit. This would enable us to OR the kind values:
ResTraits<Package>::_kind | ResTraits<Patch>::_kind
(maybe a bit more convenient syntax)
~ ResTraits<Source>::_kind
This might be usefull in queries like 'search patch or package providing Foo' or 'search for ... but not as Product' or 'get capabilities except FileCaps '.
Last edit in Trac '11/22/05 11:23:10' by 'kkaempf'
Last edit in Trac '11/22/05 11:23:10' by 'kkaempf'
Last edit in Trac '11/22/05 11:23:10' by 'kkaempf'
Last edit in Trac '11/22/05 11:23:10' by 'kkaempf'