libzypp 17.31.23
ResObject.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
13#include <zypp/ResObject.h>
14
15using namespace zypp;
16
18namespace zypp
19{
20
22
23 ResObject::ResObject( const sat::Solvable & solvable_r )
24 : Resolvable( solvable_r )
25 {}
26
28 {}
29
30 std::ostream & ResObject::dumpOn( std::ostream & str ) const
31 {
32 return Resolvable::dumpOn( str );
33 }
34
35} // namespace zypp
37
38#include <zypp/ResObjects.h>
39
41namespace zypp
42{
44 {
45 if ( ! solvable_r )
46 return 0;
47
48 ResKind kind( solvable_r.kind() );
49#define OUTS(X) if ( kind == ResTraits<X>::kind ) return make<X>( solvable_r );
50 OUTS( Package );
51 OUTS( Patch );
52 OUTS( Pattern );
53 OUTS( Product );
56#undef OUTS
57 // unknow => return a plain ResObject
58 return new ResObject( solvable_r );
59 }
60} // namespace zypp
#define OUTS(V)
Class representing an application (appdata.xml)
Definition: Application.h:28
Package interface.
Definition: Package.h:33
Class representing a patch.
Definition: Patch.h:38
Pattern interface.
Definition: Pattern.h:32
Product interface.
Definition: Product.h:33
Resolvable kinds.
Definition: ResKind.h:33
Base for resolvable objects.
Definition: ResObject.h:38
virtual std::ostream & dumpOn(std::ostream &str) const
Helper for stream output.
Definition: ResObject.cc:30
virtual ~ResObject()
Dtor.
Definition: ResObject.cc:27
ResObject(const sat::Solvable &solvable_r)
Ctor.
Definition: ResObject.cc:23
TraitsType::PtrType Ptr
Definition: ResObject.h:42
Base for resolvable objects.
Definition: Resolvable.h:51
virtual std::ostream & dumpOn(std::ostream &str) const
Helper for stream output.
Definition: Resolvable.cc:31
SrcPackage interface.
Definition: SrcPackage.h:30
A Solvable object within the sat Pool.
Definition: Solvable.h:54
ResKind kind() const
The Solvables ResKind.
Definition: Solvable.cc:275
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
ResObject::Ptr makeResObject(const sat::Solvable &solvable_r)
Create ResObject from sat::Solvable.
Definition: ResObject.cc:43
#define IMPL_PTR_TYPE(NAME)