LibPkg
Classes | Public Types | Public Member Functions | List of all members
pkg::binary_control_table Class Reference

A class for mapping package name and version to binary control record. More...

#include <binary_control_table.h>

Inheritance diagram for pkg::binary_control_table:
pkg::table

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_typeoperator[] (const key_type &key) const
 Get control record for package given package name and version. More...
 
bool contains (const key_type &key) const
 Check if a key has a corresponding control record. More...
 
const mapped_typeoperator[] (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...
 
- Public Member Functions inherited from pkg::table
 table ()
 Construct table. More...
 
virtual ~table ()
 Destroy table. More...
 

Additional Inherited Members

- Protected Member Functions inherited from pkg::table
void notify ()
 Notify watchers that a change has occurred. More...
 

Detailed Description

A class for mapping package name and version to binary control record.

Member Typedef Documentation

◆ mapped_type

◆ const_iterator

Constructor & Destructor Documentation

◆ binary_control_table()

pkg::binary_control_table::binary_control_table ( const string &  pathname)

Construct binary control table.

Parameters
pathnamethe pathname of the underlying package index file.

References update().

◆ ~binary_control_table()

pkg::binary_control_table::~binary_control_table ( )
virtual

Destroy binary control table.

Member Function Documentation

◆ operator[]() [1/2]

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.

Parameters
keythe package name, version and environment
Returns
the control record

◆ contains()

bool pkg::binary_control_table::contains ( const key_type key) const

Check if a key has a corresponding control record.

Parameters
keythe package name, version and environment
Returns
true if the control record exists

◆ operator[]() [2/2]

const binary_control_table::mapped_type & pkg::binary_control_table::operator[] ( const string &  pkgname) const

Get control record for latest version of package.

Parameters
pkgnamethe package name
Returns
the control record

◆ begin()

const_iterator pkg::binary_control_table::begin ( ) const
inline

Get const iterator for start of table.

Returns
the const iterator

◆ end()

const_iterator pkg::binary_control_table::end ( ) const
inline

Get const iterator for end of table.

Returns
the const iterator

References commit(), insert(), pkg::operator<(), and update().

◆ insert()

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.

Parameters
ctrlthe control record

References pkg::binary_control::environment_id(), pkg::table::notify(), pkg::control::pkgname(), and pkg::control::version().

Referenced by end(), and pkg::unpack::poll().

◆ commit()

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().

Referenced by end(), and pkg::unpack::poll().

◆ update()

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(), end(), and pkg::update::poll().


The documentation for this class was generated from the following files:

Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)