Deepsolver
Public Types | Public Member Functions
Deepsolver::TaskException Class Reference

The exception class for notifications the user task is not solvable. More...

Inheritance diagram for Deepsolver::TaskException:
Deepsolver::AbstractException

List of all members.

Public Types

enum  {
  UnknownPkg, Contradiction, UnsolvableSat, Unmet,
  CodeCount
}

Public Member Functions

void accept (ExceptionVisitor &visitor) const
 Calls appropriate visitor method.
int getCode () const
 Returns the error code.
std::string getMessage () const
 Returns a single line error description.
const std::string & getParam () const
 Returns an optional string parameter of the error.
std::string getType () const
 Returns a string with short error type designation.
 TaskException (int code, const std::string &param)
 The constructor with error type and string parameter.
 TaskException (int code)
 The constructor with error code only.
virtual ~TaskException ()
 The destructor.

Detailed Description

This exception notifies there is a problem occurred during user task solving. The main its distinction is that problem can be caused only by impossible user request. That means there is no any other implied reasons, neither in package database nor in solver environment.

This exception can be one of the several types designating various invalid situations: an unknown package to install, the same package is considered to install and to remove simultaneously, no packages to satisfy a Require entry etc. An exception instance takes one string parameter with additional information, which purpose depends on exception type. For example, if the problem is an unknown package to install the parameter contains its name and so on.

See also:
OperationCoreException

Constructor & Destructor Documentation

Deepsolver::TaskException::TaskException ( int  code,
const std::string &  param 
) [inline]
Parameters:
[in]codeAn error code
[in]paramAn additional string parameter
Deepsolver::TaskException::TaskException ( int  code) [inline]
Parameters:
[in]codeThe error code

Member Function Documentation

void Deepsolver::TaskException::accept ( ExceptionVisitor visitor) const [inline, virtual]

This method performs invocation of corresponding visit() method of the visitor, provided by the reference. You should use it each time, when you want to make particular handling action for various exception types, as it suggested by design pattern "visitor".

Parameters:
[in]visitorThe reference to the visitor

Implements Deepsolver::AbstractException.

int Deepsolver::TaskException::getCode ( ) const [inline]
Returns:
The code of the error
std::string Deepsolver::TaskException::getMessage ( ) const [virtual]

This method returns a single line string value with error description. Usually it is the value printed to user in the error message. The value should not include error type, since it can be obtained through getType() method.

Returns:
A single line error description

Implements Deepsolver::AbstractException.

const std::string& Deepsolver::TaskException::getParam ( ) const [inline]
Returns:
The optional string parameter
std::string Deepsolver::TaskException::getType ( ) const [inline, virtual]

This method returns a short string with one or two words describing the error type. For example, this method can return values like "system", "back-end" etc. A value returned by this method usually is used for error message construction.

Returns:
A short string with error type designation

Implements Deepsolver::AbstractException.