mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
Exception.h
1 /***************************************************************************
2  SRC/mixmod/Utilities/exceptions/Exception.h description
3  copyright : (C) MIXMOD Team - 2001-2016
4  email : contact@mixmod.org
5  ***************************************************************************/
6 
7 /***************************************************************************
8  This file is part of MIXMOD
9 
10  MIXMOD is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MIXMOD is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with MIXMOD. If not, see <http://www.gnu.org/licenses/>.
22 
23  All informations available on : http://www.mixmod.org
24 ***************************************************************************/
30 #ifndef XEM_EXCEPTION_H
31 #define XEM_EXCEPTION_H
32 
33 #include <exception>
34 #include <string.h>
35 #include <map>
36 #include <iostream>
37 #include <typeinfo>
39 
40 namespace XEM {
41 
42 class Exception : public std::exception {
43 
44 public:
45 
46  Exception() {
47  }
48  Exception(const std::string& what_arg) throw ();
49  Exception(const std::string& msg, const std::string& file, int line) throw ();
50  Exception(const Exception & exception);
51  virtual Exception* clone() throw ();
52 
54  virtual const char* what() const throw ();
55 
57  virtual Exception const& getError() const throw () {
58  return *this;
59  }
61  virtual bool operator==(const Exception&) const throw ();
62 
64  virtual bool operator!=(const Exception& other) const throw () {
65  return !(*this == other);
66  }
69  virtual void run(std::ostream & flux = std::cout) const throw ();
70 
71  virtual ~Exception() throw () {
72  }
73 
74 protected:
75 
76  std::string _errorMsg;
77  std::string _filename;
78  int _linenumber;
79 };
80 
81 }
82 
83 #endif /* XEMEXCEPTION_H_ */
Enumerations for various types of errors.
virtual const char * what() const
Definition: Exception.cpp:47
virtual bool operator==(const Exception &) const
Definition: Exception.cpp:55
Definition: Exception.h:42
virtual void run(std::ostream &flux=std::cout) const
Definition: Exception.cpp:63
virtual Exception const & getError() const
Definition: Exception.h:57