All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roboptim::SolverError Class Reference

Base exception class for solving errors. More...

#include <roboptim/core/solver-error.hh>

Inheritance diagram for roboptim::SolverError:

Public Member Functions

 SolverError (const std::string &arg)
 Instantiate an error from an error message. More...
 
 SolverError (const std::string &arg, const Result &res)
 Instantiate an error from an error message. More...
 
 SolverError (const SolverError &error)
 Copy constructor. More...
 
 ~SolverError () throw ()
 Trivial destructor. More...
 
virtual std::ostream & print (std::ostream &) const
 Display the error on the specified output stream. More...
 
const boost::optional< Result > & lastState () const
 Retrieve the (optional) last state of the solver. More...
 
boost::optional< Result > & lastState ()
 Retrieve the (optional) last state of the solver. More...
 

Detailed Description

Base exception class for solving errors.

All other exceptions classes concerning the optimization process should inherits this class.

Constructor & Destructor Documentation

roboptim::SolverError::SolverError ( const std::string &  arg)
explicit

Instantiate an error from an error message.

Parameters
argerror message.
roboptim::SolverError::SolverError ( const std::string &  arg,
const Result res 
)

Instantiate an error from an error message.

Parameters
argerror message.
reslast state of the solver.
roboptim::SolverError::SolverError ( const SolverError error)

Copy constructor.

Parameters
errorother error to copy.
roboptim::SolverError::~SolverError ( ) throw ()

Trivial destructor.

Member Function Documentation

const boost::optional< Result > & roboptim::SolverError::lastState ( ) const

Retrieve the (optional) last state of the solver.

Returns
last state of the solver.
boost::optional< Result > & roboptim::SolverError::lastState ( )

Retrieve the (optional) last state of the solver.

Returns
last state of the solver.
std::ostream & roboptim::SolverError::print ( std::ostream &  o) const
virtual

Display the error on the specified output stream.

Parameters
ooutput stream used for display
Returns
output stream

References roboptim::decindent(), roboptim::fg::fail(), roboptim::iendl(), roboptim::incindent(), roboptim::fg::reset(), and roboptim::split().

Referenced by roboptim::operator<<().