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

A class for managing the updating of package components. More...

#include <component_update.h>

Classes

class  commit_error
 An exception class for reporting failure to commit table. More...
 

Public Types

typedef std::vector< component >
::const_iterator 
const_iterator
 

Public Member Functions

 component_update (const string &pathname=string())
 Construct component update. More...
 
virtual ~component_update ()
 Destroy component update. More...
 
const componentoperator[] (const std::string &name) const
 Get component details for a component name The updates cannot be modified using this operator. More...
 
const_iterator begin () const
 Get const iterator for start of the updates. More...
 
const_iterator end () const
 Get const iterator for end of the updates. More...
 
const_iterator find (const std::string &name) const
 Find const iterator for a component name. More...
 
void insert (const component &value)
 Add a component. More...
 
void insert (const component_update &table)
 Insert contents of another table into this one, overwriting any existing items. More...
 
void clear ()
 Clear status of all components. More...
 
void commit ()
 Commit changes. More...
 
void rollback ()
 Roll back changes. More...
 
void done ()
 The updates have been completed, so remove the file. More...
 

Detailed Description

A class for managing the updating of package components.

Member Typedef Documentation

Constructor & Destructor Documentation

pkg::component_update::component_update ( const string &  pathname = string())

Construct component update.

Parameters
pathnamethe pathname of the underlying component update file

References rollback().

pkg::component_update::~component_update ( )
virtual

Destroy component update.

Member Function Documentation

const component & pkg::component_update::operator[] ( const std::string &  name) const

Get component details for a component name The updates cannot be modified using this operator.

Parameters
keythe package name
Returns
the status of the package
const_iterator pkg::component_update::begin ( ) const
inline

Get const iterator for start of the updates.

Returns
the const iterator

References _data.

Referenced by insert().

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

Get const iterator for end of the updates.

Returns
the const iterator

References _data.

Referenced by insert().

component_update::const_iterator pkg::component_update::find ( const std::string &  name) const

Find const iterator for a component name.

Parameters
namethe component name
Returns
the const iterator, or end() if not found
void pkg::component_update::insert ( const component value)

Add a component.

The underlying updates file will not be modified until the change is committed.

Parameters
valuethe new component

References pkg::component::name().

Referenced by insert().

void pkg::component_update::insert ( const component_update table)

Insert contents of another table into this one, overwriting any existing items.

References begin(), end(), and insert().

void pkg::component_update::clear ( )

Clear status of all components.

void pkg::component_update::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().

void pkg::component_update::rollback ( )

Roll back changes.

Any changes since the last call to commit() or rollback() are discarded.

References done().

Referenced by component_update().

void pkg::component_update::done ( )

The updates have been completed, so remove the file.

References pkg::force_delete(), and pkg::object_type().

Referenced by rollback().


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

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)