AdvisorySet
-
class AdvisorySet
Subclassed by libdnf5::advisory::AdvisoryQuery
Public Types
-
using iterator = AdvisorySetIterator
Public Functions
-
explicit AdvisorySet(const libdnf5::BaseWeakPtr &base)
-
AdvisorySet(const AdvisorySet &aset)
-
AdvisorySet(AdvisorySet &&aset) noexcept
-
~AdvisorySet()
-
AdvisorySet &operator=(const AdvisorySet &src)
-
AdvisorySet &operator=(AdvisorySet &&src)
-
AdvisorySet &operator|=(const AdvisorySet &other)
-
AdvisorySet &operator-=(const AdvisorySet &other)
-
AdvisorySet &operator&=(const AdvisorySet &other)
-
inline void update(const AdvisorySet &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 AdvisorySack.
-
inline void intersection(const AdvisorySet &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 AdvisorySack.
-
inline void difference(const AdvisorySet &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 AdvisorySack.
-
void clear() noexcept
Remove all advisories 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 Advisory &adv)
Add
adv
to the set.- Since
5.0
- Parameters:
adv – Advisory to be added to the set.
-
bool contains(const Advisory &adv) const noexcept
- Since
5.0
- Parameters:
adv – Advisory that is tested for presence.
- Returns:
true
if an advisory is in the set,false
otherwise.
-
void remove(const Advisory &adv)
Remove
adv
from the set.- Since
5.0
- Parameters:
adv – Advisory 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(AdvisorySet &other) noexcept
-
std::vector<AdvisoryPackage> get_advisory_packages_sorted_by_name_arch_evr(bool only_applicable = false) const
Gather AdvisoryPackages for each Advisory in the set. The AdvisoryPackages are sorted by libsolv
id
s of name, arch and evr. This is a different sorting than sorting by the strings of AdvisoryPackages names, architectures and evrs.- Since
5.0
- Parameters:
only_applicable – Whether to return only AdvisoryPackages from applicable AdvisoryCollections.
-
using iterator = AdvisorySetIterator