Singleton class which manipulate with locks file and apply locks on pool.
More...
#include <Locks.h>
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
LockList::size_type | size () const |
|
bool | empty () const |
|
void | addLock (const PoolQuery &query) |
| TODO add: toBeAdded{Begin,End,Size,Empty} toBeRemoved{Begin,End,Size,Empty}.
|
|
void | addLock (const IdString &ident_r) |
| add lock by identifier (e.g.
|
|
void | addLock (const ResKind &kind_r, const IdString &name_r) |
| add lock by name and kind and add this lock as toAdd
|
|
void | addLock (const ResKind &kind_r, const C_Str &name_r) |
| add lock by name and kind and add this lock as toAdd
|
|
void | removeLock (const PoolQuery &query) |
| unlocks by result of query and add to toRemove.
|
|
void | removeLock (const IdString &ident_r) |
| remove lock by identifier (e.g.
|
|
void | removeLock (const ResKind &kind_r, const IdString &name_r) |
| remove lock by name and kind
|
|
void | removeLock (const ResKind &kind_r, const C_Str &name_r) |
|
void | readAndApply (const Pathname &file=ZConfig::instance().locksFile()) |
| Optimalized version of read and apply.
|
|
void | read (const Pathname &file=ZConfig::instance().locksFile()) |
| Read locks from file to list of stable locks (locks which is not changed during session)
|
|
void | apply () const |
| Applies locks in stable list (locks which is not changed during session).
|
|
void | save (const Pathname &file=ZConfig::instance().locksFile()) |
| Merges toAdd and ToRemove list to stable list and save that stable list to file.
|
|
void | merge () |
| Merges toAdd and ToRemove list to stable list.
|
|
bool | existEmpty () const |
| Gets true if some lock doesn't lock any object in pool This can happen e.g.
|
|
void | removeEmpty () |
| Call callback for each empty lock.
|
|
void | removeDuplicates () |
| Delete all query duplicate in loaded locks.
|
|
Singleton class which manipulate with locks file and apply locks on pool.
for user information about locksfile and its format see http://en.opensuse.org/Libzypp/Locksfile
Definition at line 18 of file Locks.h.
◆ LockList
◆ const_iterator
◆ size_type
◆ Locks()
◆ instance()
Locks & zypp::Locks::instance |
( |
| ) |
|
|
static |
Gets instance of this class.
Singleton method.
Definition at line 36 of file Locks.cc.
◆ begin()
◆ end()
◆ size()
Locks::LockList::size_type zypp::Locks::size |
( |
| ) |
const |
◆ empty()
bool zypp::Locks::empty |
( |
| ) |
const |
◆ addLock() [1/4]
void zypp::Locks::addLock |
( |
const PoolQuery & |
query | ) |
|
TODO add: toBeAdded{Begin,End,Size,Empty} toBeRemoved{Begin,End,Size,Empty}.
locks result of query and add this lock as toAdd
Definition at line 180 of file Locks.cc.
◆ addLock() [2/4]
void zypp::Locks::addLock |
( |
const IdString & |
ident_r | ) |
|
add lock by identifier (e.g.
Selectable->ident() and add this lock as toAdd
Definition at line 199 of file Locks.cc.
◆ addLock() [3/4]
void zypp::Locks::addLock |
( |
const ResKind & |
kind_r, |
|
|
const IdString & |
name_r |
|
) |
| |
add lock by name and kind and add this lock as toAdd
Definition at line 210 of file Locks.cc.
◆ addLock() [4/4]
void zypp::Locks::addLock |
( |
const ResKind & |
kind_r, |
|
|
const C_Str & |
name_r |
|
) |
| |
add lock by name and kind and add this lock as toAdd
Definition at line 205 of file Locks.cc.
◆ removeLock() [1/4]
void zypp::Locks::removeLock |
( |
const PoolQuery & |
query | ) |
|
unlocks by result of query and add to toRemove.
If unlock non-saved lock (so it is in toAdd list) then both is deleted and nothing happens during save
Definition at line 221 of file Locks.cc.
◆ removeLock() [2/4]
void zypp::Locks::removeLock |
( |
const IdString & |
ident_r | ) |
|
remove lock by identifier (e.g.
Selectable->ident()
If unlock non-saved lock (so it is in toAdd list) then both is deleted and nothing happens during save
Definition at line 241 of file Locks.cc.
◆ removeLock() [3/4]
void zypp::Locks::removeLock |
( |
const ResKind & |
kind_r, |
|
|
const IdString & |
name_r |
|
) |
| |
remove lock by name and kind
If unlock non-saved lock (so it is in toAdd list) then both is deleted and nothing happens during save
Definition at line 252 of file Locks.cc.
◆ removeLock() [4/4]
void zypp::Locks::removeLock |
( |
const ResKind & |
kind_r, |
|
|
const C_Str & |
name_r |
|
) |
| |
◆ readAndApply()
◆ read()
Read locks from file to list of stable locks (locks which is not changed during session)
Definition at line 162 of file Locks.cc.
◆ apply()
void zypp::Locks::apply |
( |
| ) |
const |
Applies locks in stable list (locks which is not changed during session).
Definition at line 173 of file Locks.cc.
◆ save()
Merges toAdd and ToRemove list to stable list and save that stable list to file.
- See also
- SavingLocksReport
Definition at line 466 of file Locks.cc.
◆ merge()
void zypp::Locks::merge |
( |
| ) |
|
Merges toAdd and ToRemove list to stable list.
- Note
- Can call callback if problem during merging occure
- See also
- SavingLocksReport
Definition at line 447 of file Locks.cc.
◆ existEmpty()
bool zypp::Locks::existEmpty |
( |
| ) |
const |
Gets true if some lock doesn't lock any object in pool This can happen e.g.
if package is removed or due to user bad definition of lock
Definition at line 263 of file Locks.cc.
◆ removeEmpty()
void zypp::Locks::removeEmpty |
( |
| ) |
|
◆ removeDuplicates()
void zypp::Locks::removeDuplicates |
( |
| ) |
|
Delete all query duplicate in loaded locks.
- Note
- you must call save to write cleaned locks to file
Definition at line 492 of file Locks.cc.
◆ _pimpl
The documentation for this class was generated from the following files: