Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
UtilExceptions.h
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
21
// Exceptions for used by some utility classes
22
/****************************************************************************/
23
#pragma once
24
#include <config.h>
25
26
#include <cassert>
27
#include <string>
28
#include <stdexcept>
29
30
// ===========================================================================
31
// class definitions
32
// ===========================================================================
38
class
ProcessError
:
public
std::runtime_error {
39
40
public
:
42
ProcessError
();
43
45
ProcessError
(
const
std::string& msg);
46
48
const
std::string&
getTrace
()
const
;
49
50
private
:
52
std::string
myTrace
;
53
55
void
processTrace
();
56
};
57
58
64
class
InvalidArgument
:
public
ProcessError
{
65
66
public
:
68
InvalidArgument
(
const
std::string& message);
69
};
70
71
76
class
EmptyData
:
public
ProcessError
{
77
78
public
:
80
EmptyData
();
81
};
82
83
89
class
FormatException
:
public
ProcessError
{
90
91
public
:
93
FormatException
(
const
std::string& msg);
94
};
95
96
103
class
NumberFormatException
:
public
FormatException
{
104
105
public
:
107
NumberFormatException
(
const
std::string& data);
108
};
109
110
116
class
TimeFormatException
:
public
FormatException
{
117
118
public
:
120
TimeFormatException
(
const
std::string& data);
121
};
122
123
129
class
BoolFormatException
:
public
FormatException
{
130
131
public
:
133
BoolFormatException
(
const
std::string& data);
134
};
135
136
142
class
OutOfBoundsException
:
public
ProcessError
{
143
144
public
:
146
OutOfBoundsException
();
147
149
OutOfBoundsException
(
const
std::string& msg);
150
};
151
152
158
class
UnknownElement
:
public
ProcessError
{
159
160
public
:
162
UnknownElement
();
163
165
UnknownElement
(
const
std::string& msg);
166
};
167
171
class
IOError
:
public
ProcessError
{
172
173
public
:
175
IOError
(
const
std::string& message);
176
};
177
179
#ifdef MSVC_TEST_SERVER
180
#ifdef _DEBUG
181
#define SOFT_ASSERT(expr) if (!(expr)) {throw ProcessError("should not happen");}
182
#else
183
#define SOFT_ASSERT(expr)
184
#endif
185
#else
186
#define SOFT_ASSERT(expr) assert(expr);
187
#endif
BoolFormatException
Definition
UtilExceptions.h:129
EmptyData
Definition
UtilExceptions.h:76
EmptyData::EmptyData
EmptyData()
constructor
Definition
UtilExceptions.cpp:100
FormatException
Definition
UtilExceptions.h:89
IOError
Definition
UtilExceptions.h:171
InvalidArgument
Definition
UtilExceptions.h:64
NumberFormatException
Definition
UtilExceptions.h:103
OutOfBoundsException
Definition
UtilExceptions.h:142
OutOfBoundsException::OutOfBoundsException
OutOfBoundsException()
constructor (default message: "Out Of Bounds")
Definition
UtilExceptions.cpp:140
ProcessError
Definition
UtilExceptions.h:38
ProcessError::ProcessError
ProcessError()
constructor
Definition
UtilExceptions.cpp:55
ProcessError::myTrace
std::string myTrace
exception trace
Definition
UtilExceptions.h:52
ProcessError::processTrace
void processTrace()
process trace
Definition
UtilExceptions.cpp:76
ProcessError::getTrace
const std::string & getTrace() const
get trace
Definition
UtilExceptions.cpp:70
TimeFormatException
Definition
UtilExceptions.h:116
UnknownElement
Definition
UtilExceptions.h:158
UnknownElement::UnknownElement
UnknownElement()
constructor
Definition
UtilExceptions.cpp:154
src
utils
common
UtilExceptions.h
Generated on Wed Jun 24 2026 00:10:28 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8