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-2025 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 <string>
27
#include <stdexcept>
28
29
#include "
Translation.h
"
30
31
// ===========================================================================
32
// class definitions
33
// ===========================================================================
39
class
ProcessError
:
public
std::runtime_error {
40
41
public
:
43
ProcessError
();
44
46
ProcessError
(
const
std::string& msg);
47
49
const
std::string&
getTrace
()
const
;
50
51
private
:
53
std::string
myTrace
;
54
56
void
processTrace
();
57
};
58
59
65
class
InvalidArgument
:
public
ProcessError
{
66
67
public
:
69
InvalidArgument
(
const
std::string& message);
70
};
71
72
77
class
EmptyData
:
public
ProcessError
{
78
79
public
:
81
EmptyData
();
82
};
83
84
90
class
FormatException
:
public
ProcessError
{
91
92
public
:
94
FormatException
(
const
std::string& msg);
95
};
96
97
104
class
NumberFormatException
:
public
FormatException
{
105
106
public
:
108
NumberFormatException
(
const
std::string& data);
109
};
110
111
117
class
TimeFormatException
:
public
FormatException
{
118
119
public
:
121
TimeFormatException
(
const
std::string& data);
122
};
123
124
130
class
BoolFormatException
:
public
FormatException
{
131
132
public
:
134
BoolFormatException
(
const
std::string& data);
135
};
136
137
143
class
OutOfBoundsException
:
public
ProcessError
{
144
145
public
:
147
OutOfBoundsException
(
const
std::string& msg =
TL
(
"Out Of Bounds"
));
148
};
149
150
156
class
UnknownElement
:
public
ProcessError
{
157
158
public
:
160
UnknownElement
();
161
163
UnknownElement
(
const
std::string& msg);
164
};
165
169
class
IOError
:
public
ProcessError
{
170
171
public
:
173
IOError
(
const
std::string& message);
174
};
175
177
#ifdef MSVC_TEST_SERVER
178
#ifdef _DEBUG
179
#define SOFT_ASSERT(expr) if (!(expr)) {throw ProcessError(TL("should not happen"));}
180
#else
181
#define SOFT_ASSERT(expr)
182
#endif
183
#else
184
#define SOFT_ASSERT(expr) assert(expr);
185
#endif
TL
#define TL(string)
Definition
MsgHandler.h:304
Translation.h
BoolFormatException
Definition
UtilExceptions.h:130
EmptyData
Definition
UtilExceptions.h:77
EmptyData::EmptyData
EmptyData()
constructor
Definition
UtilExceptions.cpp:99
FormatException
Definition
UtilExceptions.h:90
IOError
Definition
UtilExceptions.h:169
InvalidArgument
Definition
UtilExceptions.h:65
NumberFormatException
Definition
UtilExceptions.h:104
OutOfBoundsException
Definition
UtilExceptions.h:143
ProcessError
Definition
UtilExceptions.h:39
ProcessError::ProcessError
ProcessError()
constructor
Definition
UtilExceptions.cpp:54
ProcessError::myTrace
std::string myTrace
exception trace
Definition
UtilExceptions.h:53
ProcessError::processTrace
void processTrace()
process trace
Definition
UtilExceptions.cpp:75
ProcessError::getTrace
const std::string & getTrace() const
get trace
Definition
UtilExceptions.cpp:69
TimeFormatException
Definition
UtilExceptions.h:117
UnknownElement
Definition
UtilExceptions.h:156
UnknownElement::UnknownElement
UnknownElement()
constructor
Definition
UtilExceptions.cpp:148
src
utils
common
UtilExceptions.h
Generated on Tue Oct 28 2025 00:11:04 for Eclipse SUMO - Simulation of Urban MObility by
1.9.8