Cupt
Classes | Public Member Functions
cupt::system::Worker Class Reference

performs system modifications More...

#include <cupt/system/worker.hpp>

List of all members.

Classes

struct  Action
 action types More...
struct  ActionsPreview

Public Member Functions

 Worker (const shared_ptr< const Config > &config, const shared_ptr< const Cache > &cache)
 constructor
void setDesiredState (const Resolver::Offer &offer)
shared_ptr< const ActionsPreviewgetActionsPreview () const
map< string, ssize_t > getUnpackedSizesPreview () const
pair< size_t, size_t > getDownloadSizesPreview () const
void setAutomaticallyInstalledFlag (const string &packageName, bool value)
void changeSystem (const shared_ptr< download::Progress > &progress)
void updateReleaseAndIndexData (const shared_ptr< download::Progress > &progress)
vector< pair< string,
shared_ptr< const
BinaryVersion > > > 
getArchivesInfo () const
 gets available archives of binary versions
void deleteArchive (const string &path)
void saveSnapshot (const Snapshots &, const string &name)
void renameSnapshot (const Snapshots &, const string &previousName, const string &newName)
void removeSnapshot (const Snapshots &, const string &name)

Detailed Description

performs system modifications


Constructor & Destructor Documentation

cupt::system::Worker::Worker ( const shared_ptr< const Config > &  config,
const shared_ptr< const Cache > &  cache 
)

constructor

Parameters:
config
cache

Member Function Documentation

void cupt::system::Worker::changeSystem ( const shared_ptr< download::Progress > &  progress)

Modifies the system to achieve the desired state set by setDesiredState.

Parameters:
progress
void cupt::system::Worker::deleteArchive ( const string &  path)

Deletes an archive file (it may be a symlink). Verifies that deleted file is located under archives path directory.

Parameters:
pathabsolute (i.e., not relative) path to file
shared_ptr< const ActionsPreview > cupt::system::Worker::getActionsPreview ( ) const

Shouldn't be called before setDesiredState.

Returns:
a set of actions to get the desired system state divided by action types
vector< pair< string, shared_ptr< const BinaryVersion > > > cupt::system::Worker::getArchivesInfo ( ) const

gets available archives of binary versions

Gets paths of all '.deb' archives in the archives directory and matches them to available binary versions. Not matched paths with be paired with an empty pointer.

Returns:
array of pairs < package name, pointer to binary version >
pair< size_t, size_t > cupt::system::Worker::getDownloadSizesPreview ( ) const

Shouldn't be called before setDesiredState.

Returns:
pair: total amount of needed binary archives (in bytes), amount to download (in bytes)
map< string, ssize_t > cupt::system::Worker::getUnpackedSizesPreview ( ) const

Shouldn't be called before setDesiredState.

Returns:
map: package name -> unpacked size change (in bytes)
void cupt::system::Worker::removeSnapshot ( const Snapshots ,
const string &  name 
)

Removes a system snapshot.

Parameters:
namename of the snapshot
void cupt::system::Worker::renameSnapshot ( const Snapshots ,
const string &  previousName,
const string &  newName 
)

Renames a system snapshot.

Parameters:
previousNameprevious snasphot name
newNamenew snapshot name
void cupt::system::Worker::saveSnapshot ( const Snapshots ,
const string &  name 
)

Makes a system snapshot with a name name.

Parameters:
namethe snapshot name.
void cupt::system::Worker::setAutomaticallyInstalledFlag ( const string &  packageName,
bool  value 
)

Marks a package as automatically or manually installed.

Parameters:
packageName
valueif true, marks as automatically installed, if false, marks as manually installed
void cupt::system::Worker::setDesiredState ( const Resolver::Offer offer)

Sets the desired system state.

May be called several times for examining different possible system states.

Parameters:
offer
void cupt::system::Worker::updateReleaseAndIndexData ( const shared_ptr< download::Progress > &  progress)

Downloads latest Release and Packages/Sources files from repository sources.

Parameters:
progress

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator