SUMO - Simulation of Urban MObility
UtilExceptions.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
20 // Exceptions for used by some utility classes
21 /****************************************************************************/
22 #ifndef UtilExceptions_h
23 #define UtilExceptions_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <stdexcept>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
48 class ProcessError : public std::runtime_error {
49 public:
52  : std::runtime_error("Process Error") {}
53 
55  ProcessError(const std::string& msg)
56  : std::runtime_error(msg) {}
57 };
58 
59 
65 class InvalidArgument : public ProcessError {
66 public:
68  InvalidArgument(const std::string& message)
69  : ProcessError(message) {}
70 };
71 
72 
77 class EmptyData : public std::runtime_error {
78 public:
81  : std::runtime_error("Empty Data") {}
82 };
83 
84 
90 class FormatException : public std::runtime_error {
91 public:
93  FormatException(const std::string& msg)
94  : std::runtime_error(msg) {}
95 };
96 
97 
105 public:
108  : FormatException("Number Format") {}
109 };
110 
111 
118 public:
121  : FormatException("Bool Format") {}
122 };
123 
124 
130 class OutOfBoundsException : public std::runtime_error {
131 public:
134  : std::runtime_error("Out Of Bounds") {}
135 };
136 
137 
143 class UnknownElement : public std::runtime_error {
144 public:
147  : std::runtime_error("Unknown Element") {}
148 
150  UnknownElement(const std::string& msg)
151  : std::runtime_error(msg) {}
152 };
153 
154 
155 class IOError : public ProcessError {
156 public:
158  IOError(const std::string& message)
159  : ProcessError(message) {}
160 };
161 
162 
163 #endif
164 
165 /****************************************************************************/
ProcessError(const std::string &msg)
constructor
OutOfBoundsException()
constructor
InvalidArgument(const std::string &message)
constructor
IOError(const std::string &message)
constructor
UnknownElement(const std::string &msg)
constructor
EmptyData()
constructor
FormatException(const std::string &msg)
constructor
NumberFormatException()
constructor
ProcessError()
constructor
BoolFormatException()
constructor
UnknownElement()
constructor