Eclipse SUMO - Simulation of Urban MObility
UtilExceptions.h
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3
// Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials
5
// are made available under the terms of the Eclipse Public License v2.0
6
// which accompanies this distribution, and is available at
7
// http://www.eclipse.org/legal/epl-v20.html
8
// SPDX-License-Identifier: EPL-2.0
9
/****************************************************************************/
18
// Exceptions for used by some utility classes
19
/****************************************************************************/
20
#ifndef UtilExceptions_h
21
#define UtilExceptions_h
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
28
#include <string>
29
#include <stdexcept>
30
31
32
// ===========================================================================
33
// class definitions
34
// ===========================================================================
40
class
ProcessError
:
public
std::runtime_error {
41
public
:
43
ProcessError
()
44
: std::runtime_error(
"Process Error"
) {}
45
47
ProcessError
(
const
std::string& msg)
48
: std::runtime_error(msg) {}
49
};
50
51
57
class
InvalidArgument
:
public
ProcessError
{
58
public
:
60
InvalidArgument
(
const
std::string& message)
61
:
ProcessError
(message) {}
62
};
63
64
69
class
EmptyData
:
public
ProcessError
{
70
public
:
72
EmptyData
()
73
:
ProcessError
(
"Empty Data"
) {}
74
};
75
76
82
class
FormatException
:
public
ProcessError
{
83
public
:
85
FormatException
(
const
std::string& msg)
86
:
ProcessError
(msg) {}
87
};
88
89
96
class
NumberFormatException
:
public
FormatException
{
97
public
:
99
NumberFormatException
(
const
std::string& data)
100
:
FormatException
(
"Invalid Number Format '"
+ data +
"'"
) {}
101
};
102
103
109
class
BoolFormatException
:
public
FormatException
{
110
public
:
112
BoolFormatException
(
const
std::string& data)
113
:
FormatException
(
"Invalid Bool Format '"
+ data +
"'"
) {}
114
};
115
116
122
class
OutOfBoundsException
:
public
ProcessError
{
123
public
:
125
OutOfBoundsException
()
126
:
ProcessError
(
"Out Of Bounds"
) {}
127
};
128
129
135
class
UnknownElement
:
public
ProcessError
{
136
public
:
138
UnknownElement
()
139
:
ProcessError
(
"Unknown Element"
) {}
140
142
UnknownElement
(
const
std::string& msg)
143
:
ProcessError
(msg) {}
144
};
145
146
147
class
IOError
:
public
ProcessError
{
148
public
:
150
IOError
(
const
std::string& message)
151
:
ProcessError
(message) {}
152
};
153
155
#ifdef MSVC_TEST_SERVER
156
#ifdef _DEBUG
157
#define SOFT_ASSERT(expr) if (!(expr)) {throw ProcessError("should not happen");}
158
#else
159
#define SOFT_ASSERT(expr)
160
#endif
161
#else
162
#define SOFT_ASSERT(expr) assert(expr);
163
#endif
164
165
#endif
166
167
/****************************************************************************/
NumberFormatException::NumberFormatException
NumberFormatException(const std::string &data)
constructor
Definition:
UtilExceptions.h:99
UnknownElement::UnknownElement
UnknownElement()
constructor
Definition:
UtilExceptions.h:138
EmptyData
Definition:
UtilExceptions.h:69
NumberFormatException
Definition:
UtilExceptions.h:96
InvalidArgument::InvalidArgument
InvalidArgument(const std::string &message)
constructor
Definition:
UtilExceptions.h:60
ProcessError
Definition:
UtilExceptions.h:40
OutOfBoundsException
Definition:
UtilExceptions.h:122
ProcessError::ProcessError
ProcessError(const std::string &msg)
constructor
Definition:
UtilExceptions.h:47
BoolFormatException::BoolFormatException
BoolFormatException(const std::string &data)
constructor
Definition:
UtilExceptions.h:112
FormatException
Definition:
UtilExceptions.h:82
FormatException::FormatException
FormatException(const std::string &msg)
constructor
Definition:
UtilExceptions.h:85
BoolFormatException
Definition:
UtilExceptions.h:109
ProcessError::ProcessError
ProcessError()
constructor
Definition:
UtilExceptions.h:43
UnknownElement
Definition:
UtilExceptions.h:135
OutOfBoundsException::OutOfBoundsException
OutOfBoundsException()
constructor
Definition:
UtilExceptions.h:125
InvalidArgument
Definition:
UtilExceptions.h:57
UnknownElement::UnknownElement
UnknownElement(const std::string &msg)
constructor
Definition:
UtilExceptions.h:142
IOError
Definition:
UtilExceptions.h:147
IOError::IOError
IOError(const std::string &message)
constructor
Definition:
UtilExceptions.h:150
EmptyData::EmptyData
EmptyData()
constructor
Definition:
UtilExceptions.h:72
src
utils
common
UtilExceptions.h
Generated on Wed Jan 15 2020 15:04:13 for Eclipse SUMO - Simulation of Urban MObility by
1.8.16