libzypp 17.31.23
ResTraits.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_RESTRAITS_H
13#define ZYPP_RESTRAITS_H
14
15#include <zypp/base/PtrTypes.h>
16#include <zypp/ResKind.h>
17
19namespace zypp
20{
21
23 namespace traits
24 {
25
28 inline bool isPseudoInstalled( ResKind kind_r )
29 { return( kind_r == ResKind::patch ); }
30
32 } // namespace traits
34
65
73
75 class PoolItem;
76
78 template<typename TRes>
79 struct ResTraits
80 {
82 typedef intrusive_ptr<TRes> PtrType;
83 typedef intrusive_ptr<const TRes> constPtrType;
84
85 static const ResKind kind;
86
90 };
91
92 // Defined in ResKind.cc
99
103 template<>
105 {
107 typedef intrusive_ptr<Resolvable> PtrType;
108 typedef intrusive_ptr<const Resolvable> constPtrType;
109 };
110
114 template<>
116 {
118 typedef intrusive_ptr<ResObject> PtrType;
119 typedef intrusive_ptr<const ResObject> constPtrType;
120 };
121
128 template<typename TRes>
130
139 template<typename TRes>
140 inline bool isKind( const ResKind & val_r )
141 { return( resKind<TRes>() == val_r ); }
143 template<typename TRes>
144 inline bool isKind( const std::string & val_r )
145 { return( resKind<TRes>() == val_r ); }
147 template<typename TRes>
148 inline bool isKind( const char * val_r )
149 { return( resKind<TRes>() == val_r ); }
150
151
153} // namespace zypp
155#endif // ZYPP_RESTRAITS_H
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
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:51
Product interface.
Definition: Product.h:33
Resolvable kinds.
Definition: ResKind.h:33
static const ResKind patch
Definition: ResKind.h:41
Base for resolvable objects.
Definition: ResObject.h:38
Base for resolvable objects.
Definition: Resolvable.h:51
SrcPackage interface.
Definition: SrcPackage.h:30
bool isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
Definition: ResTraits.h:28
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
bool isKind(const ResKind &val_r)
Convenient test for ResKinds.
Definition: ResTraits.h:140
ResKind resKind()
Convenient access to well known ResKinds.
Definition: ResTraits.h:129
intrusive_ptr< const ResObject > constPtrType
Definition: ResTraits.h:119
intrusive_ptr< ResObject > PtrType
Definition: ResTraits.h:118
intrusive_ptr< Resolvable > PtrType
Definition: ResTraits.h:107
intrusive_ptr< const Resolvable > constPtrType
Definition: ResTraits.h:108
ResTraits.
Definition: ResTraits.h:80
intrusive_ptr< const TRes > constPtrType
Definition: ResTraits.h:83
ResKind KindType
Definition: ResTraits.h:81
static const ResKind kind
Defined in ResKind.cc.
Definition: ResTraits.h:85
intrusive_ptr< TRes > PtrType
Definition: ResTraits.h:82
static bool isPseudoInstalled()
Those are denoted to be installed, if the solver verifies them as being satisfied.
Definition: ResTraits.h:89
#define DEFINE_PTR_TYPE(NAME)
Forward declaration of Ptr types.
Definition: PtrTypes.h:623