libzypp 17.37.10

SelFilters.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_UI_SELFILTERS_H
13#define ZYPP_UI_SELFILTERS_H
14
15#include <string>
16#include <utility>
17
18#include <zypp/base/Functional.h>
19#include <zypp/ui/Selectable.h>
20
22 namespace zypp
23{
25 namespace ui
26 {
28 namespace selfilter
29 {
30
32 struct ByKind
33 {
34 ByKind( ResKind kind_r )
35 : _kind(std::move( kind_r ))
36 {}
37
38 bool operator()( const Selectable::constPtr & obj ) const
39 {
40 return obj && obj->kind() == _kind;
41 }
42
43 ResKind _kind;
44 };
45
47 struct ByName
48 {
49 ByName( std::string name_r )
50 : _name(std::move( name_r ))
51 {}
52
53 bool operator()( const ui::Selectable::constPtr & obj ) const
54 { return obj && obj->name() == _name; }
55
56 std::string _name;
57 };
58
60 struct ByHasInstalledObj
61 {
62 bool operator()( const ui::Selectable::constPtr & obj ) const
63 { return obj && !obj->installedEmpty(); }
64 };
65
67 struct ByHasCandidateObj
68 {
69 bool operator()( const ui::Selectable::constPtr & obj ) const
70 { return obj && obj->hasCandidateObj(); }
71 };
72
73 struct ByStatus
75 {
76 ByStatus( Status status_r )
77 : _status( status_r )
78 {}
79
80 bool operator()( const ui::Selectable::constPtr & obj ) const
81 { return obj && obj->status() == _status; }
82
83 Status _status;
84 };
85
87 } // namespace selfilter
88
90 } // namespace ui
93} // namespace zypp
95#endif // ZYPP_UI_SELFILTERS_H
Functional.h
Selectable.h
zypp::ResKind
Resolvable kinds.
Definition ResKind.h:33
zypp::ui::Selectable::constPtr
intrusive_ptr< const Selectable > constPtr
Definition Selectable.h:59
std
Definition Arch.h:364
zypp::ui::selfilter
Definition SelFilters.h:29
zypp::ui
Definition SolvIterMixin.cc:57
zypp::ui::Status
Status
UI status Status values calculated by Selectable.
Definition Status.h:36
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::ui::selfilter::ByHasCandidateObj
Definition SelFilters.h:68
zypp::ui::selfilter::ByHasCandidateObj::operator()
bool operator()(const ui::Selectable::constPtr &obj) const
Definition SelFilters.h:69
zypp::ui::selfilter::ByHasInstalledObj
Definition SelFilters.h:61
zypp::ui::selfilter::ByHasInstalledObj::operator()
bool operator()(const ui::Selectable::constPtr &obj) const
Definition SelFilters.h:62
zypp::ui::selfilter::ByKind::ByKind
ByKind(ResKind kind_r)
Definition SelFilters.h:34
zypp::ui::selfilter::ByKind::operator()
bool operator()(const Selectable::constPtr &obj) const
Definition SelFilters.h:38
zypp::ui::selfilter::ByKind::_kind
ResKind _kind
Definition SelFilters.h:43
zypp::ui::selfilter::ByName::operator()
bool operator()(const ui::Selectable::constPtr &obj) const
Definition SelFilters.h:53
zypp::ui::selfilter::ByName::_name
std::string _name
Definition SelFilters.h:56
zypp::ui::selfilter::ByName::ByName
ByName(std::string name_r)
Definition SelFilters.h:49
zypp::ui::selfilter::ByStatus::_status
Status _status
Definition SelFilters.h:83
zypp::ui::selfilter::ByStatus::ByStatus
ByStatus(Status status_r)
Definition SelFilters.h:76
zypp::ui::selfilter::ByStatus::operator()
bool operator()(const ui::Selectable::constPtr &obj) const
Definition SelFilters.h:80