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}. More...
|
|
void | addLock (const IdString &ident_r) |
| add lock by identifier (e.g. More...
|
|
void | addLock (const ResKind &kind_r, const IdString &name_r) |
| add lock by name and kind and add this lock as toAdd More...
|
|
void | addLock (const ResKind &kind_r, const C_Str &name_r) |
| add lock by name and kind and add this lock as toAdd More...
|
|
void | removeLock (const PoolQuery &query) |
| unlocks by result of query and add to toRemove. More...
|
|
void | removeLock (const IdString &ident_r) |
| remove lock by identifier (e.g. More...
|
|
void | removeLock (const ResKind &kind_r, const IdString &name_r) |
| remove lock by name and kind More...
|
|
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. More...
|
|
void | read (const Pathname &file=ZConfig::instance().locksFile()) |
| Read locks from file to list of stable locks (locks which is not changed during session) More...
|
|
void | apply () const |
| Applies locks in stable list (locks which is not changed during session). More...
|
|
void | save (const Pathname &file=ZConfig::instance().locksFile()) |
| Merges toAdd and ToRemove list to stable list and save that stable list to file. More...
|
|
void | merge () |
| Merges toAdd and ToRemove list to stable list. More...
|
|
bool | existEmpty () const |
| Gets true if some lock doesn't lock any object in pool This can happen e.g. More...
|
|
void | removeEmpty () |
| Call callback for each empty lock. More...
|
|
void | removeDuplicates () |
| Delete all query duplicate in loaded locks. More...
|
|
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.
Locks & zypp::Locks::instance |
( |
| ) |
|
|
static |
Gets instance of this class.
Singleton method.
Definition at line 39 of file Locks.cc.
Locks::LockList::size_type zypp::Locks::size |
( |
| ) |
const |
bool zypp::Locks::empty |
( |
| ) |
const |
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 141 of file Locks.cc.
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 163 of file Locks.cc.
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 174 of file Locks.cc.
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 169 of file Locks.cc.
void zypp::Locks::removeLock |
( |
const PoolQuery & |
query | ) |
|
unlocks by result of query and add to toRemove.
If unlock non-saved lock (so he is in toAdd list) then both is deleted and nathing happen during save
Definition at line 185 of file Locks.cc.
void zypp::Locks::removeLock |
( |
const IdString & |
ident_r | ) |
|
remove lock by identifier (e.g.
Selectable->ident()
If unlock non-saved lock (so he is in toAdd list) then both is deleted and nathing happen during save
Definition at line 208 of file Locks.cc.
void zypp::Locks::removeLock |
( |
const ResKind & |
kind_r, |
|
|
const IdString & |
name_r |
|
) |
| |
remove lock by name and kind
If unlock non-saved lock (so he is in toAdd list) then both is deleted and nathing happen during save
Definition at line 219 of file Locks.cc.
void zypp::Locks::removeLock |
( |
const ResKind & |
kind_r, |
|
|
const C_Str & |
name_r |
|
) |
| |
void zypp::Locks::readAndApply |
( |
const Pathname & |
file = ZConfig::instance().locksFile() | ) |
|
Read locks from file to list of stable locks (locks which is not changed during session)
Definition at line 122 of file Locks.cc.
void zypp::Locks::apply |
( |
| ) |
const |
Applies locks in stable list (locks which is not changed during session).
Definition at line 134 of file Locks.cc.
Merges toAdd and ToRemove list to stable list and save that stable list to file.
- See Also
- SavingLocksReport
Definition at line 435 of file Locks.cc.
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 416 of file Locks.cc.
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 231 of file Locks.cc.
void zypp::Locks::removeEmpty |
( |
| ) |
|
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 461 of file Locks.cc.
The documentation for this class was generated from the following files: