Deepsolver
Public Member Functions
Deepsolver::OperationCore Class Reference

The main class for package managing. More...

Inheritance diagram for Deepsolver::OperationCore:
Deepsolver::AutoReleaseStrings

List of all members.

Public Member Functions

void closure (const UserTaskItemToInstallVector &toInstall, PkgVector &res)
 Restores all dependencies for specified package set.
void fetchMetadata (AbstractFetchListener &listener, const AbstractOperationContinueRequest &continueRequest)
 Fetchs fresh metadata of attached repositories.
void generateSat (AbstractTransactionListener &listener, const UserTask &task, std::ostream &s)
 Generates SAT and saves it as a string.
void getPkgNames (bool withInstalled, StringVector &res)
 Fills the string vector with the list of all known packages (names only, without provides)
 OperationCore (const ConfigCenter &conf)
 The constructor.
void printPackagesByRequire (const NamedPkgRel &rel, std::ostream &s)
 Print to stream the list of packages matching to a require.
void printSnapshot (bool withInstalled, bool withIds, std::ostream &s)
 Dumps the current package snapshot to stream in a string form.
TransactionIterator::Ptr transaction (AbstractTransactionListener &listener, const UserTask &task)
 INitiates new transaction.
virtual ~OperationCore ()
 The destructor.

Detailed Description

The OperationCore class is the central class of Deepsolver project. It allows every client to perform various manipulations with packages, including installation, removing and upgrading. In addition, this class takes care of information gathered about attached repositories.

Be careful, each method of the OperationCore class throws a number of exceptions. Their exact set depends on particular method purpose.

The main structure used for configuring is a ConfigCenter class instance provided by a reference to constructor.

According to accepted project design, there are two additional classes purposed for direct usage by clients. They are IndexCore and InfoCore. The former takes care about repository metadata construction and the second provides various information about known packages. OperationCore, IndexCore and InfoCore are the main classes a end-user should be interested in.

See also:
IndexCore InfoCore OperationException

Constructor & Destructor Documentation

Deepsolver::OperationCore::OperationCore ( const ConfigCenter conf) [inline]
Parameters:
[in]confThe reference to a configuration data

Member Function Documentation

void OperationCore::closure ( const UserTaskItemToInstallVector &  toInstall,
PkgVector &  res 
)

This method returns the changes needed for the installation of the specified package set into initially empty system. Obviously, this situation is artificial and never happens in practise. None changes are actually made and this method just returns the list of the packages to fill the empty system with.

Parameters:
[in]toInstallThe list of the packages to "install" into an empty system
[out]resThe constructed list of packages with all necessary dependencies
Exceptions:
OperationCoreExceptionTaskException SystemException InternalProblemException
void OperationCore::fetchMetadata ( AbstractFetchListener listener,
const AbstractOperationContinueRequest continueRequest 
)
Parameters:
[in]listenerThe reference to a listener to follow fetching progress
[in]continueRequestThe reference to an object for fetching interruption by user request
Exceptions:
OperationExceptionCurlException SystemException InternalException
void OperationCore::generateSat ( AbstractTransactionListener listener,
const UserTask task,
std::ostream &  s 
)
Parameters:
[in]listenerThe reference to an object to follow calculation progress
[in]taskThe reference to task object to generate SAT for
[in]sThe reference to a stream to save generated SAT in
Exceptions:
OperationExceptionTaskException SystemException InternalException
void OperationCore::getPkgNames ( bool  withInstalled,
StringVector &  res 
)
Parameters:
[in]withInstalledWhether to include installed packages or not
[out]resThe string list to save names of known packages to
Exceptions:
OperationCoreExceptionSystemException InternalProblemException
void OperationCore::printPackagesByRequire ( const NamedPkgRel rel,
std::ostream &  s 
)
Parameters:
[in]relThe require entry to search packages for
[in]sThe stream to print to
Exceptions:
OperationCoreExceptionSystemException InternalProblemException
void OperationCore::printSnapshot ( bool  withInstalled,
bool  withIds,
std::ostream &  s 
)
Parameters:
[in]withInstalledWhether to include installed packages to dump or not
[in]withIdsWhether print internal package IDs or not
[in]Thestream to dump to
Exceptions:
OperationCoreExceptionSystemException InternalProblemException
TransactionIterator::Ptr Deepsolver::OperationCore::transaction ( AbstractTransactionListener listener,
const UserTask task 
)

Transaction here does not imply that client application really wants some changes in OS. This method only initiates the process and allows to understand what changes reflect particular user task, but following process can be interrupted at any stage.

Parameters:
[in]listenerThe reference to an object to following calculation progress
[in]taskThe desirable changes
Returns:
Smart pointer to transaction iterator
Exceptions:
OperationExceptionTaskException SystemException InternalException