mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
OtherException.h
1 /***************************************************************************
2  SRC/mixmod/Utilities/exceptions/OtherException.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_OTHEREXCEPTION_H
31 #define XEM_OTHEREXCEPTION_H
32 
33 #include "mixmod/Utilities/exceptions/Exception.h"
34 
35 namespace XEM {
36 
37 class OtherException : public Exception {
38 
39 public:
40 
41  OtherException(std::string file, int line, OtherError error) throw ();
42  OtherException(OtherError) throw ();
43  Exception * clone() throw ();
44  virtual const char* what() const throw ();
45  virtual bool operator==(const Exception&) const throw ();
46  virtual void run(std::ostream & flux = std::cout) const throw ();
47 
48  virtual ~OtherException() throw () {
49  }
50 
51 
52  static std::map<OtherError, const char*> create_map()
53  {
54  std::map<OtherError, const char*> m;
55 
56  m.insert(std::make_pair(badFormat, "Bad Format"));
57  m.insert(std::make_pair(nullPointerError, "Internal error (Null pointer)"));
58  m.insert(std::make_pair(wrongMatrixType, "Error : trying to apply a method on a wrong matrix type "));
59  m.insert(std::make_pair(wrongConstructorType, "Error : when constructing an object by default"));
60  m.insert(std::make_pair(nonImplementedMethod, "non implemented method"));
61  m.insert(std::make_pair(badBinaryParameterClass, "Internal Mixmod Error: bad XEMBinrayParameter Class"));
62  m.insert(std::make_pair(UnknownReason, "Error occurred due to unknown reason."));
63  m.insert(std::make_pair(internalMixmodError, "Internal error in mixmod sofware"));
64  m.insert(std::make_pair(FunctionNotYetImplemented, "Function that is called is not yet implemented"));
65  m.insert(std::make_pair(AllModelsGotErros, "All models got errors"));
66  m.insert(std::make_pair(AllTriesGotErros, "All tries got errors"));
67 
68  return m;
69  }
70 
71  static std::map<OtherError, const char*> mapErrorMsg;
72 
73 protected:
74 
75  OtherError _errorType;
76 };
77 
78 }
79 
80 #endif /* XEMOTHEREXCEPTION_H_ */
virtual const char * what() const
Definition: OtherException.cpp:48
Definition: OtherException.h:37
Definition: Exception.h:42
virtual void run(std::ostream &flux=std::cout) const
Definition: OtherException.cpp:58
virtual bool operator==(const Exception &) const
Definition: OtherException.cpp:52