Bayes++ Bayesian Filtering Classes  Release 2014.5 - Copyright (c) 2003,2004,2005,2006,2011,2012,2014 Michael Stevens
bayesException.hpp
Go to the documentation of this file.
1 #ifndef _BAYES_FILTER_EXCEPTION
2 #define _BAYES_FILTER_EXCEPTION
3 
4 /*
5  * Bayes++ the Bayesian Filtering Library
6  * Copyright (c) 2002 Michael Stevens
7  * See accompanying Bayes++.htm for terms and conditions of use.
8  *
9  * $Id$
10  */
11 
12 /*
13  * Exception types: Exception hierarchy for Bayesian filtering
14  */
15 
16 // Common headers required for declerations
17 #include <exception>
18 
19 /* Filter namespace */
20 namespace Bayesian_filter
21 {
22 
23 
24 class Filter_exception : virtual public std::exception
25 /*
26  * Base class for all exception produced by filter hierarchy
27  */
28 {
29 public:
30  const char *what() const throw()
31  { return error_description;
32  }
33 protected:
34  Filter_exception (const char* description)
35  { error_description = description;
36  }
37 private:
38  const char* error_description;
39 };
40 
41 class Logic_exception : virtual public Filter_exception
42 /*
43  * Logic Exception
44  */
45 {
46 public:
47  Logic_exception (const char* description) :
48  Filter_exception (description)
49  {}
50 };
51 
52 class Numeric_exception : virtual public Filter_exception
53 /*
54  * Numeric Exception
55  */
56 {
57 public:
58  Numeric_exception (const char* description) :
59  Filter_exception (description)
60  {}
61 };
62 
63 
64 }//namespace
65 #endif
Numeric_exception(const char *description)
Definition: bayesException.hpp:58
Definition: bayesException.hpp:52
Definition: bayesException.hpp:20
const char * what() const
Definition: bayesException.hpp:30
Definition: bayesException.hpp:24
Filter_exception(const char *description)
Definition: bayesException.hpp:34
Definition: bayesException.hpp:41
Logic_exception(const char *description)
Definition: bayesException.hpp:47