SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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.dlr.de/
13 // Copyright (C) 2001-2016 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 // ===========================================================================
49 class ProcessError : public std::runtime_error {
50 public:
53  : std::runtime_error("Process Error") {}
54 
56  ProcessError(const std::string& msg)
57  : std::runtime_error(msg) {}
58 };
59 
60 
66 class InvalidArgument : public ProcessError {
67 public:
69  InvalidArgument(const std::string& message)
70  : ProcessError(message) {}
71 };
72 
73 
78 class EmptyData : public std::runtime_error {
79 public:
82  : std::runtime_error("Empty Data") {}
83 };
84 
85 
91 class FormatException : public std::runtime_error {
92 public:
94  FormatException(const std::string& msg)
95  : std::runtime_error(msg) {}
96 };
97 
98 
106 public:
109  : FormatException("Number Format") {}
110 };
111 
112 
119 public:
122  : FormatException("Bool Format") {}
123 };
124 
125 
131 class OutOfBoundsException : public std::runtime_error {
132 public:
135  : std::runtime_error("Out Of Bounds") {}
136 };
137 
138 
144 class UnknownElement : public std::runtime_error {
145 public:
148  : std::runtime_error("Unknown Element") {}
149 
151  UnknownElement(const std::string& msg)
152  : std::runtime_error(msg) {}
153 };
154 
155 
156 class IOError : public ProcessError {
157 public:
159  IOError(const std::string& message)
160  : ProcessError(message) {}
161 };
162 
163 
164 #endif
165 
166 /****************************************************************************/
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