PackageSet

class PackageSet

Subclassed by libdnf5::rpm::PackageQuery

Public Types

using iterator = PackageSetIterator

Public Functions

explicit PackageSet(const libdnf5::BaseWeakPtr &base)
explicit PackageSet(libdnf5::Base &base)
PackageSet(const PackageSet &pset)
PackageSet(PackageSet &&pset) noexcept
~PackageSet()
PackageSet &operator=(const PackageSet &src)
PackageSet &operator=(PackageSet &&src)
inline iterator begin() const
inline iterator end() const
PackageSet &operator|=(const PackageSet &other)
PackageSet &operator-=(const PackageSet &other)
PackageSet &operator&=(const PackageSet &other)
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:

pkgPackage to be added to the set.

bool contains(const Package &pkg) const noexcept

Since

5.0

Parameters:

pkgPackage 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:

pkgPackage to be removed from the set.

libdnf5::BaseWeakPtr get_base() const
size_t size() const noexcept
Returns:

Number of elements in the set.

void swap(PackageSet &other) noexcept

Friends

friend class libdnf5::base::Transaction
friend class libdnf5::advisory::AdvisoryPackage