libzypp 17.31.23
|
Track added/removed set items based on an initial set. More...
#include <base/SetTracker.h>
Public Types | |
typedef TSet | set_type |
typedef TSet::key_type | key_type |
typedef TSet::value_type | value_type |
Public Member Functions | |
SetTracker () | |
Default Ctor: empty set. | |
SetTracker (set_type initial_r) | |
Ctor taking an initial set. | |
Tracking API | |
bool | setInitial () |
(Re-)Start tracking the current set (discards previously tracked changes). | |
bool | setInitial (set_type new_r) |
Start tracking a new set (discards previously tracked changes). | |
bool | set (set_type new_r) |
Set a new_r set and track changes. | |
bool | add (const value_type &val_r) |
Add an element to the set and track changes. | |
bool | remove (const value_type &val_r) |
Remove an element from the set and track changes. | |
Query and retrieval | |
bool | contains (const key_type &key_r) const |
Whether val_r is in the set. | |
bool | wasAdded (const key_type &key_r) const |
Whether val_r is tracked as added. | |
bool | wasRemoved (const key_type &key_r) const |
Whether val_r is tracked as removed. | |
const set_type & | current () const |
Return the current set. | |
const set_type & | added () const |
Return the set of added items. | |
const set_type & | removed () const |
Return the set of removed items. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class TSet > | |
std::ostream & | operator<< (std::ostream &str, const SetTracker< TSet > &obj) |
Stream output. | |
Direct manipulation | |
set_type | _current |
set_type | _added |
set_type | _removed |
set_type & | current () |
Return the current set. | |
set_type & | added () |
Return the set of added items. | |
set_type & | removed () |
Return the set of removed items. | |
static bool | find (const set_type &set_r, const key_type &key_r) |
template<class TORDERED_SET , typename enable_if = typename TORDERED_SET::key_compare> | |
static void | setDifference (const TORDERED_SET &lhs, const TORDERED_SET &rhs, TORDERED_SET &result_r) |
template<class TUNORDERED_SET , typename enable_if = typename TUNORDERED_SET::hasher, typename = void> | |
static void | setDifference (const TUNORDERED_SET &lhs, const TUNORDERED_SET &rhs, TUNORDERED_SET &result_r) |
Track added/removed set items based on an initial set.
The class maintains the current set of items and also records the changes compared to the initial set (added and removed items) if you use the tracking API.
It is also possible to directly manipulate the three sets.
Definition at line 37 of file SetTracker.h.
typedef TSet zypp::base::SetTracker< TSet >::set_type |
Definition at line 39 of file SetTracker.h.
typedef TSet::key_type zypp::base::SetTracker< TSet >::key_type |
Definition at line 40 of file SetTracker.h.
typedef TSet::value_type zypp::base::SetTracker< TSet >::value_type |
Definition at line 41 of file SetTracker.h.
|
inline |
Default Ctor: empty set.
Definition at line 44 of file SetTracker.h.
|
inline |
Ctor taking an initial set.
Definition at line 48 of file SetTracker.h.
|
inline |
(Re-)Start tracking the current set (discards previously tracked changes).
False
(set did not change) Definition at line 57 of file SetTracker.h.
|
inline |
Start tracking a new set (discards previously tracked changes).
Definition at line 63 of file SetTracker.h.
|
inline |
Set a new_r set and track changes.
Definition at line 78 of file SetTracker.h.
|
inline |
Add an element to the set and track changes.
Definition at line 100 of file SetTracker.h.
|
inline |
Remove an element from the set and track changes.
Definition at line 114 of file SetTracker.h.
|
inline |
Whether val_r is in the set.
Definition at line 129 of file SetTracker.h.
|
inline |
Whether val_r is tracked as added.
Definition at line 132 of file SetTracker.h.
|
inline |
Whether val_r is tracked as removed.
Definition at line 135 of file SetTracker.h.
|
inline |
Return the current set.
Definition at line 139 of file SetTracker.h.
|
inline |
Return the set of added items.
Definition at line 142 of file SetTracker.h.
|
inline |
Return the set of removed items.
Definition at line 145 of file SetTracker.h.
|
inline |
Return the current set.
Definition at line 151 of file SetTracker.h.
|
inline |
Return the set of added items.
Definition at line 154 of file SetTracker.h.
|
inline |
Return the set of removed items.
Definition at line 157 of file SetTracker.h.
|
inlinestaticprivate |
Definition at line 162 of file SetTracker.h.
|
inlinestaticprivate |
Definition at line 166 of file SetTracker.h.
|
inlinestaticprivate |
Definition at line 175 of file SetTracker.h.
|
related |
Stream output.
Definition at line 190 of file SetTracker.h.
|
private |
Definition at line 183 of file SetTracker.h.
|
private |
Definition at line 184 of file SetTracker.h.
|
private |
Definition at line 185 of file SetTracker.h.