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