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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
18 // Exceptions for used by some utility classes
19 /****************************************************************************/
20 #ifndef UtilExceptions_h
21 #define UtilExceptions_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <stdexcept>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
42 class ProcessError : public std::runtime_error {
43 public:
46  : std::runtime_error("Process Error") {}
47 
49  ProcessError(const std::string& msg)
50  : std::runtime_error(msg) {}
51 };
52 
53 
59 class InvalidArgument : public ProcessError {
60 public:
62  InvalidArgument(const std::string& message)
63  : ProcessError(message) {}
64 };
65 
66 
71 class EmptyData : public std::runtime_error {
72 public:
75  : std::runtime_error("Empty Data") {}
76 };
77 
78 
84 class FormatException : public std::runtime_error {
85 public:
87  FormatException(const std::string& msg)
88  : std::runtime_error(msg) {}
89 };
90 
91 
99 public:
102  : FormatException("Number Format") {}
103 };
104 
105 
112 public:
115  : FormatException("Bool Format") {}
116 };
117 
118 
124 class OutOfBoundsException : public std::runtime_error {
125 public:
128  : std::runtime_error("Out Of Bounds") {}
129 };
130 
131 
137 class UnknownElement : public std::runtime_error {
138 public:
141  : std::runtime_error("Unknown Element") {}
142 
144  UnknownElement(const std::string& msg)
145  : std::runtime_error(msg) {}
146 };
147 
148 
149 class IOError : public ProcessError {
150 public:
152  IOError(const std::string& message)
153  : ProcessError(message) {}
154 };
155 
156 
157 #endif
158 
159 /****************************************************************************/
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