libzypp  17.25.0
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 
18 namespace 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 
41 namespace 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 );
54  OUTS( SrcPackage );
55  OUTS( Application );
56 #undef OUTS
57  // unknow => return a plain ResObject
58  return new ResObject( solvable_r );
59  }
60 } // namespace zypp
zypp::ResObject::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Helper for stream output.
Definition: ResObject.cc:30
zypp::Resolvable::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Helper for stream output.
Definition: Resolvable.cc:31
zypp::sat::Solvable
A Solvable object within the sat Pool.
Definition: Solvable.h:53
zypp::sat::Solvable::kind
ResKind kind() const
The Solvables ResKind.
Definition: Solvable.cc:274
zypp::ResObject::Ptr
TraitsType::PtrType Ptr
Definition: ResObject.h:42
ResObject.h
zypp::Application
Class representing an application (appdata.xml)
Definition: Application.h:27
zypp::makeResObject
ResObject::Ptr makeResObject(const sat::Solvable &solvable_r)
Create ResObject from sat::Solvable.
Definition: ResObject.cc:43
zypp::Pattern
Pattern interface.
Definition: Pattern.h:31
OUTS
#define OUTS(X)
zypp::Package
Package interface.
Definition: Package.h:32
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::SrcPackage
SrcPackage interface.
Definition: SrcPackage.h:29
zypp::IMPL_PTR_TYPE
IMPL_PTR_TYPE(Application)
zypp::Resolvable
Base for resolvable objects.
Definition: Resolvable.h:49
zypp::ResObject::~ResObject
virtual ~ResObject()
Dtor.
Definition: ResObject.cc:27
zypp::ResObject::ResObject
ResObject(const sat::Solvable &solvable_r)
Ctor.
Definition: ResObject.cc:23
ResObjects.h
str
String related utilities and Regular expression matching.
zypp::ResKind
Resolvable kinds. A lowercased string and used as identification. Comparison against string values is...
Definition: ResKind.h:32
zypp::ResObject
Base for resolvable objects.
Definition: ResObject.h:37
zypp::Patch
Class representing a patch.
Definition: Patch.h:37
zypp::Product
Product interface.
Definition: Product.h:32