#include <Locks.h>
Classes | |
class | Impl |
Public Types | |
typedef std::list< PoolQuery > | LockList |
typedef LockList::const_iterator | const_iterator |
typedef LockList::size_type | size_type |
Public Member Functions | |
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. | |
Static Public Member Functions | |
static Locks & | instance () |
Gets instance of this class. | |
Private Member Functions | |
Locks () | |
Private Attributes | |
RW_pointer< Impl, rw_pointer::Scoped< Impl > > | _pimpl |
for user information about locksfile and its format see http://en.opensuse.org/Libzypp/Locksfile
Definition at line 18 of file Locks.h.
typedef std::list<PoolQuery> zypp::Locks::LockList |
typedef LockList::const_iterator zypp::Locks::const_iterator |
typedef LockList::size_type zypp::Locks::size_type |
Locks & zypp::Locks::instance | ( | ) | [static] |
Locks::const_iterator zypp::Locks::begin | ( | ) | const |
Locks::const_iterator zypp::Locks::end | ( | ) | const |
Locks::LockList::size_type zypp::Locks::size | ( | ) | 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.
References _pimpl, zypp::PoolQuery::begin(), DBG, zypp::PoolQuery::end(), for_, MIL, zypp::ResStatus::setLock(), zypp::PoolItem::status(), and zypp::ResStatus::USER.
Referenced by addLock().
void zypp::Locks::addLock | ( | const IdString & | ident_r | ) |
add lock by name and kind and add this lock as toAdd
Definition at line 174 of file Locks.cc.
References zypp::PoolQuery::addAttribute(), zypp::PoolQuery::addKind(), addLock(), zypp::IdString::asString(), DBG, zypp::sat::SolvAttr::name, zypp::PoolQuery::setCaseSensitive(), and zypp::PoolQuery::setMatchExact().
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.
References _pimpl, zypp::PoolQuery::begin(), DBG, zypp::PoolQuery::end(), for_, MIL, zypp::ResStatus::setLock(), zypp::PoolItem::status(), and zypp::ResStatus::USER.
Referenced by removeLock().
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.
References removeLock().
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.
References zypp::PoolQuery::addAttribute(), zypp::PoolQuery::addKind(), zypp::IdString::asString(), DBG, zypp::sat::SolvAttr::name, removeLock(), zypp::PoolQuery::requireAll(), zypp::PoolQuery::setCaseSensitive(), and zypp::PoolQuery::setMatchExact().
void zypp::Locks::readAndApply | ( | const Pathname & | file = ZConfig::instance().locksFile() |
) |
void zypp::Locks::read | ( | 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.
References _pimpl, MIL, and zypp::readPoolQueriesFromFile().
void zypp::Locks::apply | ( | ) | const |
void zypp::Locks::save | ( | const Pathname & | file = ZConfig::instance().locksFile() |
) |
Merges toAdd and ToRemove list to stable list and save that stable list to file.
Definition at line 435 of file Locks.cc.
References _pimpl, zypp::SavingLocksReport::ABORTED, DBG, zypp::SavingLocksReport::NO_ERROR, report, and zypp::writePoolQueriesToFile().
void zypp::Locks::merge | ( | ) |
Merges toAdd and ToRemove list to stable list.
Definition at line 416 of file Locks.cc.
References _pimpl, zypp::SavingLocksReport::ABORTED, DBG, zypp::SavingLocksReport::NO_ERROR, and report.
bool zypp::Locks::existEmpty | ( | ) | const |
void zypp::Locks::removeEmpty | ( | ) |
Call callback for each empty lock.
Definition at line 289 of file Locks.cc.
References _pimpl, zypp::CleanEmptyLocksReport::ABORTED, zypp::LocksCleanPredicate::aborted(), MIL, zypp::CleanEmptyLocksReport::NO_ERROR, and report.
void zypp::Locks::removeDuplicates | ( | ) |
RW_pointer<Impl, rw_pointer::Scoped<Impl> > zypp::Locks::_pimpl [private] |
Definition at line 148 of file Locks.h.
Referenced by addLock(), begin(), empty(), end(), existEmpty(), merge(), read(), readAndApply(), removeDuplicates(), removeEmpty(), removeLock(), save(), and size().