LibPkg
|
A class for mapping package name to package status. More...
#include <status_table.h>
Classes | |
class | commit_error |
An exception class for reporting failure to commit table. More... | |
Public Types | |
typedef string | key_type |
typedef status | mapped_type |
typedef std::map< key_type, mapped_type >::const_iterator | const_iterator |
Public Member Functions | |
status_table (const string &pathname=string()) | |
Construct status table. More... | |
virtual | ~status_table () |
Destroy status table. More... | |
const mapped_type & | operator[] (const key_type &key) const |
Get status of package. More... | |
const_iterator | begin () const |
Get const iterator for start of table. More... | |
const_iterator | end () const |
Get const iterator for end of table. More... | |
const_iterator | find (const key_type &key) const |
Find const iterator for package. More... | |
void | insert (const key_type &key, const mapped_type &value) |
Set status of package. More... | |
void | insert (const status_table &table) |
Set status of packages. More... | |
void | clear () |
Clear status of all packages. More... | |
void | commit () |
Commit changes. More... | |
void | rollback () |
Roll back changes. More... | |
![]() | |
table () | |
Construct table. More... | |
virtual | ~table () |
Destroy table. More... | |
Additional Inherited Members | |
![]() | |
void | notify () |
Notify watchers that a change has occurred. More... | |
A class for mapping package name to package status.
typedef string pkg::status_table::key_type |
typedef status pkg::status_table::mapped_type |
typedef std::map<key_type,mapped_type>::const_iterator pkg::status_table::const_iterator |
pkg::status_table::status_table | ( | const string & | pathname = string() | ) |
Construct status table.
pathname | the pathname of the underlying status file |
References rollback().
|
virtual |
Destroy status table.
const status_table::mapped_type & pkg::status_table::operator[] | ( | const key_type & | key | ) | const |
Get status of package.
The table cannot be modified using this operator.
key | the package name |
|
inline |
Get const iterator for start of table.
Referenced by pkg::pkgbase::fix_dependencies(), insert(), pkg::update::poll(), and pkg::pkgbase::remove_auto().
|
inline |
Get const iterator for end of table.
References clear(), commit(), find(), insert(), and rollback().
Referenced by pkg::pkgbase::fix_dependencies(), insert(), pkg::update::poll(), and pkg::pkgbase::remove_auto().
status_table::const_iterator pkg::status_table::find | ( | const key_type & | key | ) | const |
void pkg::status_table::insert | ( | const key_type & | key, |
const mapped_type & | value | ||
) |
Set status of package.
The underlying status file will not be modified until the change is committed, but watchers are notified immediately.
key | the package name |
value | the required status |
References pkg::table::notify().
Referenced by pkg::commit::commit(), end(), pkg::pkgbase::fix_dependencies(), pkg::unpack::poll(), and pkg::pkgbase::remove_auto().
void pkg::status_table::insert | ( | const status_table & | table | ) |
Set status of packages.
table | the table from which the values are copied |
References begin(), end(), and pkg::table::notify().
void pkg::status_table::clear | ( | ) |
Clear status of all packages.
References pkg::table::notify().
Referenced by pkg::commit::commit(), and end().
void pkg::status_table::commit | ( | ) |
Commit changes.
Any changes since the last call to commit() or rollback() are committed to disc.
References dst_pathname, pkg::force_delete(), pkg::force_move(), and pkg::object_type().
Referenced by pkg::commit::commit(), end(), pkg::unpack::poll(), and pkg::pkgbase::remove_auto().
void pkg::status_table::rollback | ( | ) |
Roll back changes.
Any changes since the last call to commit() or rollback() are discarded.
Referenced by end(), pkg::unpack::poll(), and status_table().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |