Statismo  0.10.1
 All Classes Namespaces Functions Typedefs
Exceptions.h
1 /*
2  * This file is part of the statismo library.
3  *
4  * Author: Marcel Luethi (marcel.luethi@unibas.ch)
5  *
6  * Copyright (c) 2011 University of Basel
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in the
18  * documentation and/or other materials provided with the distribution.
19  *
20  * Neither the name of the project's author nor the names of its
21  * contributors may be used to endorse or promote products derived from
22  * this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
30  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 
39 #ifndef __COME_SSM_EXCEPTIONS__
40 #define __COME_SSM_EXCEPTIONS__
41 
42 #include <exception>
43 #include <string>
44 
45 namespace statismo {
46 
50 class NotImplementedException : public std::exception {
51  public:
52  NotImplementedException(const char* classname, const char* methodname)
53  :m_classname(classname), m_methodname(methodname) {
54  }
55  virtual ~NotImplementedException() throw() {}
56 
57  const char* what() const throw() {
58  return (m_classname + "::" +m_methodname).c_str();
59  }
60  private:
61  std::string m_classname;
62  std::string m_methodname;
63 };
64 
68 class StatisticalModelException : public std::exception {
69  public:
70  StatisticalModelException(const char* message) : m_message(message) {}
71  virtual ~StatisticalModelException() throw() {}
72  const char* what() const throw() {
73  return m_message.c_str();
74  }
75 
76  private:
77  std::string m_message;
78 };
79 
80 }
81 
82 #endif
Used to indicate that a method has not yet been implemented.
Definition: Exceptions.h:50
Generic Exception class for the statismo Library.
Definition: Exceptions.h:68