Parasol Planning Library (PPL)
PMPLExceptions.h
Go to the documentation of this file.
1 #ifndef PMPL_EXCEPTIONS_H_
2 #define PMPL_EXCEPTIONS_H_
3 
5 
6 #include "nonstd/exception.h"
7 
8 #include <string>
9 #include <sstream>
10 
11 
21 struct PMPLException : public nonstd::exception {
22 
23  PMPLException(const std::string& _type, const std::string& _where,
24  const std::string& _message) {
25  *this << "\nError:\n\t" << _type
26  << "\nWhere:\n\t" << _where
27  << "\nWhy:\n\t" << _message
28  << "\n";
29  }
30 
31 };
32 
33 
38 struct ParseException : public PMPLException {
39 
40  ParseException(const std::string& _where, const std::string& _message = "") :
41  PMPLException("Parse Exception", _where, _message) {}
42 
43 };
44 
45 
50 struct WriteException : public PMPLException {
51 
52  WriteException(const std::string& _where, const std::string& _message = "") :
53  PMPLException("Write Exception", _where, _message) {}
54 
55 };
56 
57 
63 
64  RunTimeException(const std::string& _where, const std::string& _message = "") :
65  PMPLException("Runtime Exception", _where, _message) {}
66 
67 };
68 
69 
75 
76  NotImplementedException(const std::string& _where) :
77  PMPLException("Not Implemented Exception", _where,
78  "This feature is not implemented. ") {}
79 
80 };
81 
82 #endif
Definition: PMPLExceptions.h:74
NotImplementedException(const std::string &_where)
Definition: PMPLExceptions.h:76
Definition: PMPLExceptions.h:21
PMPLException(const std::string &_type, const std::string &_where, const std::string &_message)
Definition: PMPLExceptions.h:23
Definition: PMPLExceptions.h:38
ParseException(const std::string &_where, const std::string &_message="")
Definition: PMPLExceptions.h:40
Definition: PMPLExceptions.h:62
RunTimeException(const std::string &_where, const std::string &_message="")
Definition: PMPLExceptions.h:64
Definition: PMPLExceptions.h:50
WriteException(const std::string &_where, const std::string &_message="")
Definition: PMPLExceptions.h:52