PackageSet
-
class PackageSet
libdnf:sack/packageset.hpp:struct:PackageSet
Subclassed by libdnf::rpm::PackageQuery
Public Functions
-
explicit PackageSet(const libdnf::BaseWeakPtr &base)
libdnf:hy-packageset.h:function:dnf_packageset_new(DnfSack * sack)
-
PackageSet(const PackageSet &pset)
libdnf:hy-packageset.h:function:dnf_packageset_clone(DnfPackageSet * pset)
-
~PackageSet()
libdnf:hy-packageset.h:function:dnf_packageset_free(DnfPackageSet * pset)
-
inline void update(const PackageSet &other)
Set union: elements that are in the current set or in the
other
set.- Since
5.0
- Parameters
other – The set to unify with.
- Throws
UsedDifferentSack – When the sets entering the operation do not share the same PackageSack.
-
inline void intersection(const PackageSet &other)
Set intersection: elements in the current set that are also in the
other
set.- Since
5.0
- Parameters
other – The set to intersect with.
- Throws
UsedDifferentSack – When the sets entering the operation do not share the same PackageSack.
-
inline void difference(const PackageSet &other)
Set difference: elements in the current set that are not in the
other
set.- Since
5.0
- Parameters
other – The set to check for differences in.
- Throws
UsedDifferentSack – When the sets entering the operation do not share the same PackageSack.
-
void clear() noexcept
Remove all packages from the set.
- Since
5.0
-
bool empty() const noexcept
- Since
5.0
- Returns
true
if the set is empty,false
otherwise.
-
void add(const Package &pkg)
Add
pkg
to the set.- Since
5.0
- Parameters
pkg – Package to be added to the set.
-
bool contains(const Package &pkg) const noexcept
- Since
5.0
- Parameters
pkg – Package that is tested for presence.
- Returns
true
if a package is in the set,false
otherwise.
-
void remove(const Package &pkg)
Remove
pkg
from the set.- Since
5.0
- Parameters
pkg – Package to be removed from the set.
-
size_t size() const noexcept
- Returns
Number of elements in the set.
-
explicit PackageSet(const libdnf::BaseWeakPtr &base)