Localsolver  5.5
localsolver::LSException Class Reference

Detailed Description

LocalSolver exception.

If an error occurred, LocalSolver throws a specific exception which contains useful info for debugging purposes.

Public Member Functions

 LSException (LSErrorCode errorCode, const std::string &fileName, int lineNumber, const std::string &functionName, const std::string &explanation)
 Constructor.
virtual ~LSException () throw ()
 Destructor.
const std::string & getFileName () const
 Gets the name of the LocalSolver source file where the exception is thrown.
int getLineNumber () const
 Gets the line number in the LocalSolver source file where the exception is thrown.
const std::string & getFunctionName () const
 Gets the name of the function where the exception is thrown.
const std::string & getExplanation () const
 Gets the explanation about the exception.
const std::string & getMessage () const
 Returns a string message with all useful info about the current exception.
LSErrorCode getErrorCode () const
 Returns the error code associated to this exception.
const char * what () const throw ()
 Returns a C-style string explanation about the current exception.
const std::string & toString () const
 Same as getMessage().

Constructor & Destructor Documentation

localsolver::LSException::LSException ( LSErrorCode  errorCode,
const std::string &  fileName,
int  lineNumber,
const std::string &  functionName,
const std::string &  explanation 
)
inline

Constructor.

Parameters
errorCodeThe code associated to this exception.
fileNameName of the LocalSolver source file where the exception is thrown.
lineNumberLine number in the LocalSolver source file where the exception is thrown.
functionNameName of the function where the exception is thrown.
explanationAn explanation about the exception.
virtual localsolver::LSException::~LSException ( ) throw ()
inlinevirtual

Destructor.

Member Function Documentation

const std::string& localsolver::LSException::getFileName ( ) const
inline

Gets the name of the LocalSolver source file where the exception is thrown.

Only useful for LocalSolver's maintenance team.

Returns
File name.
int localsolver::LSException::getLineNumber ( ) const
inline

Gets the line number in the LocalSolver source file where the exception is thrown.

Only useful for LocalSolver's maintenance team.

Returns
Line number.
const std::string& localsolver::LSException::getFunctionName ( ) const
inline

Gets the name of the function where the exception is thrown.

Returns
Function name.
const std::string& localsolver::LSException::getExplanation ( ) const
inline

Gets the explanation about the exception.

Returns
Explanation.
const std::string& localsolver::LSException::getMessage ( ) const
inline

Returns a string message with all useful info about the current exception.

Returns
Exception message.
LSErrorCode localsolver::LSException::getErrorCode ( ) const
inline

Returns the error code associated to this exception.

Returns
Error code.
const char* localsolver::LSException::what ( ) const throw ()
inline

Returns a C-style string explanation about the current exception.

Returns
Exception message.
const std::string& localsolver::LSException::toString ( ) const
inline

Same as getMessage().