mixmod  3.2.0
Mixture models for clustering and classification
 All Classes Namespaces Files Functions Variables Enumerations Friends
DCVException.h
1 /***************************************************************************
2  SRC/mixmod/Utilities/exceptions/DCVException.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_DCVEXCEPTION_H
31 #define XEM_DCVEXCEPTION_H
32 
33 #include "mixmod/Utilities/exceptions/Exception.h"
34 
35 namespace XEM {
36 
37 class DCVException : public Exception {
38 
39 public:
40 
41  DCVException(std::string, int, DCVError) throw ();
42  Exception * clone() throw ();
43  DCVException(DCVError) 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 ~DCVException() throw () {
49  }
50 
51  static std::map<DCVError, const char*> create_map()
52  {
53  std::map<DCVError, const char*> m;
54  m.insert(std::make_pair(wrongDCVinitBlocks, "DCV error : wrong init block specification, must be either RANDOM or DIAG"));
55  m.insert(std::make_pair(wrongDCVnumberOfBlocks, "DCV error : wrong number of blocks, must be between 2 and the number of samples"));
56  m.insert(std::make_pair(DCVmustBeDIAG, "DCV error : in this situation DCV init block specification must be DIAG"));
57  m.insert(std::make_pair(forbiddenCallToGetBestCVModel, "DCV error : call to getBestCVModel is forbidden in the current context"));
58 
59  return m;
60  }
61 
62  static std::map<DCVError, const char*> mapErrorMsg;
63 
64 protected:
65 
66  DCVError _errorType;
67 };
68 
69 }
70 
71 #endif /* XEMDCVEXCEPTION_H_ */
Definition: DCVException.h:37
Definition: Exception.h:42
virtual bool operator==(const Exception &) const
Definition: DCVException.cpp:56
virtual const char * what() const
Definition: DCVException.cpp:48
virtual void run(std::ostream &flux=std::cout) const
Definition: DCVException.cpp:62