2012-02-06 16:44:09 +01:00
|
|
|
/*
|
2013-05-29 18:43:35 +02:00
|
|
|
* This file is part of the Owl Positioning System (OwlPS) project.
|
|
|
|
* It is subject to the copyright notice and license terms in the
|
|
|
|
* COPYRIGHT.t2t file found in the top-level directory of this
|
|
|
|
* distribution and at
|
2016-11-03 05:10:34 +01:00
|
|
|
* https://code.lm7.fr/mcy/owlps/src/master/COPYRIGHT.t2t
|
2013-05-29 18:43:35 +02:00
|
|
|
* No part of the OwlPS Project, including this file, may be copied,
|
|
|
|
* modified, propagated, or distributed except according to the terms
|
|
|
|
* contained in the COPYRIGHT.t2t file; the COPYRIGHT.t2t file must be
|
|
|
|
* distributed along with this file, either separately or by replacing
|
2013-06-22 23:30:17 +02:00
|
|
|
* this notice by the COPYRIGHT.t2t file's contents.
|
2012-02-06 16:44:09 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2010-02-11 17:24:21 +01:00
|
|
|
#ifndef _OWLPS_POSITIONING_POSEXCEPT_HH_
|
|
|
|
#define _OWLPS_POSITIONING_POSEXCEPT_HH_
|
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
|
2012-02-06 17:17:25 +01:00
|
|
|
/// Super-class of all exceptions defined in OwlPS Positioner
|
2010-04-01 17:51:59 +02:00
|
|
|
class posexcept: public std::exception
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
std::string explanation ;
|
|
|
|
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit posexcept(const std::string &_explanation = "") throw():
|
2010-04-01 17:51:59 +02:00
|
|
|
explanation(_explanation) {}
|
|
|
|
|
|
|
|
~posexcept(void) throw() {}
|
|
|
|
|
|
|
|
const char* what(void) const throw()
|
|
|
|
{
|
|
|
|
return explanation.c_str() ;
|
|
|
|
}
|
|
|
|
} ;
|
2010-03-05 10:57:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Miscellaneous exceptions *** */
|
2010-02-18 12:23:05 +01:00
|
|
|
|
|
|
|
|
2010-06-02 12:37:43 +02:00
|
|
|
class cannot_merge: public posexcept
|
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit cannot_merge(const std::string &_explanation) throw();
|
2010-06-02 12:37:43 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2013-10-02 23:33:02 +02:00
|
|
|
class element_already_exists: public posexcept
|
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit element_already_exists(const std::string &_explanation) throw();
|
2013-10-02 23:33:02 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-03-05 10:57:45 +01:00
|
|
|
class element_not_found: public posexcept
|
2010-02-11 18:33:45 +01:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit element_not_found(const std::string &_explanation) throw();
|
2010-02-11 18:33:45 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2012-04-27 17:36:22 +02:00
|
|
|
class autocalibration_error: public posexcept
|
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit autocalibration_error(const std::string &_explanation) throw();
|
2012-04-27 17:36:22 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Configuration *** */
|
2010-04-02 15:49:22 +02:00
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
class missing_configuration: public posexcept
|
2010-04-02 15:49:22 +02:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit missing_configuration(const std::string &_explanation) throw();
|
2010-04-02 15:49:22 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
class bad_configuration: public posexcept
|
2010-04-02 15:49:22 +02:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit bad_configuration(const std::string &_explanation) throw();
|
2010-04-02 15:49:22 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
/* *** Input *** */
|
|
|
|
|
|
|
|
|
2010-06-23 16:38:39 +02:00
|
|
|
class malformed_input_data: public posexcept
|
2010-02-11 17:24:21 +01:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit malformed_input_data(const std::string &_explanation) throw();
|
2010-02-11 17:24:21 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
class bad_direction: public posexcept
|
2010-02-11 17:24:21 +01:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit bad_direction(const char direction) throw();
|
2010-02-11 17:24:21 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-06-23 17:32:35 +02:00
|
|
|
class bad_channel: public posexcept
|
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit bad_channel(const unsigned long channel) throw();
|
2010-06-23 17:32:35 +02:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-03-05 10:57:45 +01:00
|
|
|
class null_input_medium: public posexcept
|
2010-02-11 17:24:21 +01:00
|
|
|
{
|
|
|
|
public:
|
2010-04-01 17:51:59 +02:00
|
|
|
null_input_medium(void) throw() ;
|
2010-02-11 17:24:21 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-02-11 18:33:45 +01:00
|
|
|
|
2010-04-20 15:59:27 +02:00
|
|
|
/* *** Files *** */
|
2010-02-16 16:19:39 +01:00
|
|
|
|
|
|
|
|
2010-03-05 10:57:45 +01:00
|
|
|
class error_opening_input_file: public posexcept
|
2010-02-11 18:33:45 +01:00
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit error_opening_input_file(const std::string &file_name) throw();
|
2010-02-11 18:33:45 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-03-22 14:14:44 +01:00
|
|
|
class error_opening_output_file: public posexcept
|
|
|
|
{
|
|
|
|
public:
|
2016-11-04 15:30:03 +01:00
|
|
|
explicit error_opening_output_file(const std::string &file_name) throw();
|
2010-03-22 14:14:44 +01:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
2010-03-04 11:59:17 +01:00
|
|
|
|
2010-02-11 17:24:21 +01:00
|
|
|
#endif // _OWLPS_POSITIONING_POSEXCEPT_HH_
|