LibPkg
|
A class for mapping package name and version to binary control record. More...
#include <binary_control_table.h>
Classes | |
class | commit_error |
An exception class for reporting failure to commit table. More... | |
class | key_type |
A class for specifying the name and version of a package. More... | |
Public Types | |
typedef binary_control | mapped_type |
typedef std::map< key_type, mapped_type >::const_iterator | const_iterator |
Public Member Functions | |
binary_control_table (const string &pathname) | |
Construct binary control table. More... | |
virtual | ~binary_control_table () |
Destroy binary control table. More... | |
const mapped_type & | operator[] (const key_type &key) const |
Get control record for package given package name and version. More... | |
const mapped_type & | operator[] (const string &pkgname) const |
Get control record for latest version 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... | |
void | insert (const mapped_type &ctrl) |
Insert control record into table. More... | |
void | commit () |
Commit changes. More... | |
void | update () |
Re-read the underlying package index file. 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 and version to binary control record.
typedef std::map<key_type,mapped_type>::const_iterator pkg::binary_control_table::const_iterator |
pkg::binary_control_table::binary_control_table | ( | const string & | pathname | ) |
Construct binary control table.
pathname | the pathname of the underlying package index file. |
References update().
|
virtual |
Destroy binary control table.
const binary_control_table::mapped_type & pkg::binary_control_table::operator[] | ( | const key_type & | key | ) | const |
Get control record for package given package name and version.
key | the package name and version |
const binary_control_table::mapped_type & pkg::binary_control_table::operator[] | ( | const string & | pkgname | ) | const |
Get control record for latest version of package.
pkgname | the package name |
|
inline |
|
inline |
void pkg::binary_control_table::insert | ( | const mapped_type & | ctrl | ) |
Insert control record into table.
The inserted control record will disappear when the table is next updated.
ctrl | the control record |
References pkg::table::notify(), pkg::control::pkgname(), and pkg::control::version().
void pkg::binary_control_table::commit | ( | ) |
Commit changes.
Any changes since the last call to commit() or update() are committed to disc. They will remain there until the next call to update(), at which point they will be overwritten.
References dst_pathname, pkg::force_delete(), pkg::force_move(), and pkg::object_type().
void pkg::binary_control_table::update | ( | ) |
Re-read the underlying package index file.
References pkg::table::notify(), pkg::control::pkgname(), and pkg::version::version().
Referenced by binary_control_table().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |