SUMO - Simulation of Urban MObility
UtilExceptions.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Exceptions for used by some utility classes
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef UtilExceptions_h
24 #define UtilExceptions_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include <stdexcept>
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48 class InvalidArgument : public std::runtime_error {
49 public:
51  InvalidArgument(const std::string& message)
52  : std::runtime_error(message) {}
53 
54 };
55 
56 
63 class ProcessError : public std::runtime_error {
64 public:
67  : std::runtime_error("Process Error") {}
68 
70  ProcessError(const std::string& msg)
71  : std::runtime_error(msg) {}
72 
73 };
74 
75 
80 class EmptyData : public std::runtime_error {
81 public:
84  : std::runtime_error("Empty Data") {}
85 
86 };
87 
88 
94 class FormatException : public std::runtime_error {
95 public:
97  FormatException(const std::string& msg)
98  : std::runtime_error(msg) {}
99 
100 };
101 
102 
110 public:
113  : FormatException("Number Format") {}
114 
115 };
116 
117 
124 public:
127  : FormatException("Bool Format") {}
128 
129 };
130 
131 
137 class OutOfBoundsException : public std::runtime_error {
138 public:
141  : std::runtime_error("Out Of Bounds") {}
142 
143 };
144 
145 
151 class UnknownElement : public std::runtime_error {
152 public:
155  : std::runtime_error("Unknown Element") {}
156 
158  UnknownElement(const std::string& msg)
159  : std::runtime_error(msg) {}
160 
161 };
162 
163 
164 class IOError : public ProcessError {
165 public:
167  IOError(const std::string& message)
168  : ProcessError(message) {}
169 
170 };
171 
172 
173 #endif
174 
175 /****************************************************************************/
ProcessError(const std::string &msg)
InvalidArgument(const std::string &message)
IOError(const std::string &message)
UnknownElement(const std::string &msg)
FormatException(const std::string &msg)