owlps/owlps-positioning/src/posexcept.hh

137 lines
2.1 KiB
C++
Raw Normal View History

#ifndef _OWLPS_POSITIONING_POSEXCEPT_HH_
#define _OWLPS_POSITIONING_POSEXCEPT_HH_
#include <exception>
#include <string>
/// Super-class of all exceptions defined in OWLPS-Positioning
class posexcept: public std::exception
{
protected:
std::string explanation ;
public:
posexcept(const std::string &_explanation = "") throw():
explanation(_explanation) {}
~posexcept(void) throw() {}
const char* what(void) const throw()
{
return explanation.c_str() ;
}
} ;
/* *** Other exceptions *** */
class bad_direction: public posexcept
{
public:
bad_direction(const char direction) throw() ;
} ;
class element_not_found: public posexcept
{
public:
element_not_found(const std::string &_explanation) throw() ;
} ;
/* *** Input *** */
class input_medium_type_unknown: public posexcept
{
public:
input_medium_type_unknown(const std::string &medium_name) throw() ;
} ;
class no_input_medium: public posexcept
{
public:
no_input_medium(void) throw() ;
} ;
class null_input_medium: public posexcept
{
public:
null_input_medium(void) throw() ;
} ;
class no_input_csv_file: public posexcept
{
public:
no_input_csv_file(void) throw() ;
} ;
class no_log_csv_file: public posexcept
{
public:
no_log_csv_file(void) throw() ;
} ;
class error_opening_input_file: public posexcept
{
public:
error_opening_input_file(const std::string &file_name) throw() ;
} ;
/* *** Output *** */
class output_medium_type_unknown: public posexcept
{
public:
output_medium_type_unknown(const std::string &medium_name) throw() ;
} ;
class no_output_csv_file: public posexcept
{
public:
no_output_csv_file(void) throw() ;
} ;
class error_opening_output_file: public posexcept
{
public:
error_opening_output_file(const std::string &file_name) throw() ;
} ;
/* *** Algorithms *** */
class no_positioning_algorithm: public posexcept
{
public:
no_positioning_algorithm(void) throw() ;
} ;
class positioning_algorithm_unknown: public posexcept
{
public:
positioning_algorithm_unknown(const std::string &algo_name) throw() ;
} ;
#endif // _OWLPS_POSITIONING_POSEXCEPT_HH_