SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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.sourceforge.net/
13 // Copyright (C) 2001-2012 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 
95 class NumberFormatException : public std::runtime_error {
96 public:
99  : std::runtime_error("Number Format") {}
100 
101 };
102 
103 
109 class BoolFormatException : public std::runtime_error {
110 public:
113  : std::runtime_error("Bool Format") {}
114 
115 };
116 
117 
123 class OutOfBoundsException : public std::runtime_error {
124 public:
127  : std::runtime_error("Out Of Bounds") {}
128 
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 
150 class IOError : public ProcessError {
151 public:
153  IOError(const std::string& message)
154  : ProcessError(message) {}
155 
156 };
157 
158 
159 #endif
160 
161 /****************************************************************************/