SoPlex
Toggle main menu visibility
Loading...
Searching...
No Matches
src
soplex
exceptions.h
Go to the documentation of this file.
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2
/* */
3
/* This file is part of the class library */
4
/* SoPlex --- the Sequential object-oriented simPlex. */
5
/* */
6
/* Copyright (c) 1996-2026 Zuse Institute Berlin (ZIB) */
7
/* */
8
/* Licensed under the Apache License, Version 2.0 (the "License"); */
9
/* you may not use this file except in compliance with the License. */
10
/* You may obtain a copy of the License at */
11
/* */
12
/* http://www.apache.org/licenses/LICENSE-2.0 */
13
/* */
14
/* Unless required by applicable law or agreed to in writing, software */
15
/* distributed under the License is distributed on an "AS IS" BASIS, */
16
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17
/* See the License for the specific language governing permissions and */
18
/* limitations under the License. */
19
/* */
20
/* You should have received a copy of the Apache-2.0 license */
21
/* along with SoPlex; see the file LICENSE. If not email to soplex@zib.de. */
22
/* */
23
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25
/**@file exceptions.h
26
* @brief Exception classes for SoPlex.
27
*/
28
#ifndef _EXCEPTIONS_H_
29
#define _EXCEPTIONS_H_
30
31
#include <string.h>
32
33
namespace
soplex
34
{
35
/**@brief Exception base class.
36
* @ingroup Elementary
37
*
38
* This class implements a base class for our SoPlex exceptions
39
* We provide a what() function which returns the exception message.
40
*/
41
class
SPxException
42
{
43
private
:
44
//----------------------------------------
45
/**@name Private data */
46
///@{
47
/// Exception message.
48
std::string
msg
;
49
///@}
50
public
:
51
//----------------------------------------
52
/**@name Construction / destruction */
53
///@{
54
/// constructor
55
/** The constructor receives an optional string as an exception message.
56
*/
57
SPxException
(
const
std::string& m =
""
) :
msg
(m) {}
58
SPxException
(
const
SPxException
&) =
default
;
59
SPxException
(
SPxException
&&) =
default
;
60
/// destructor
61
virtual
~SPxException
() =
default
;
62
///@}
63
64
//----------------------------------------
65
/**@name Access / modification */
66
///@{
67
/// returns exception message
68
virtual
const
std::string&
what
()
const
69
{
70
return
msg
;
71
}
72
///@}
73
};
74
75
/**@brief Exception class for out of memory exceptions.
76
* @ingroup Elementary
77
*
78
* This class is derived from the SoPlex exception base class.
79
* It does not provide any new functionality.
80
*/
81
class
SPxMemoryException
:
public
SPxException
82
{
83
public
:
84
//----------------------------------------
85
/**@name Construction / destruction */
86
///@{
87
/// constructor
88
/** The constructor receives an optional string as an exception message.
89
*/
90
SPxMemoryException
(
const
std::string& m =
""
) :
SPxException
(m) {}
91
///@}
92
};
93
94
/**@brief Exception class for status exceptions during the computations
95
* @ingroup Elementary
96
*
97
* This class is derived from the SoPlex exception base class.
98
* It does not provide any new functionality.
99
*/
100
class
SPxStatusException
:
public
SPxException
101
{
102
public
:
103
//----------------------------------------
104
/**@name Construction / destruction */
105
///@{
106
/// constructor
107
/** The constructor receives an optional string as an exception message.
108
*/
109
SPxStatusException
(
const
std::string& m =
""
) :
SPxException
(m) {}
110
///@}
111
};
112
113
/**@brief Exception class for things that should NEVER happen.
114
* @ingroup Elementary
115
*
116
* This class is derived from the SoPlex exception base class.
117
* It does not provide any new functionality. Most often it is used to replace
118
* assert(false) terms in earlier code.
119
*/
120
class
SPxInternalCodeException
:
public
SPxException
121
{
122
public
:
123
//----------------------------------------
124
/**@name Construction / destruction */
125
///@{
126
/// constructor
127
/** The constructor receives an optional string as an exception message.
128
*/
129
SPxInternalCodeException
(
const
std::string& m =
""
) :
SPxException
(m) {}
130
///@}
131
};
132
133
134
/**@brief Exception class for incorrect usage of interface methods.
135
* @ingroup Elementary
136
*/
137
class
SPxInterfaceException
:
public
SPxException
138
{
139
public
:
140
//----------------------------------------
141
/**@name Construction / destruction */
142
///@{
143
/// constructor
144
/** The constructor receives an optional string as an exception message.
145
*/
146
SPxInterfaceException
(
const
std::string& m =
""
) :
SPxException
(m) {}
147
///@}
148
};
149
150
}
//namespace soplex
151
152
#endif
// _EXCEPTIONS_H_
soplex::SPxException::msg
std::string msg
Exception message.
Definition
exceptions.h:48
soplex::SPxException::~SPxException
virtual ~SPxException()=default
destructor
soplex::SPxException::SPxException
SPxException(const std::string &m="")
constructor
Definition
exceptions.h:57
soplex::SPxException::SPxException
SPxException(SPxException &&)=default
soplex::SPxException::what
virtual const std::string & what() const
returns exception message
Definition
exceptions.h:68
soplex::SPxException::SPxException
SPxException(const SPxException &)=default
soplex::SPxInterfaceException::SPxInterfaceException
SPxInterfaceException(const std::string &m="")
constructor
Definition
exceptions.h:146
soplex::SPxInternalCodeException::SPxInternalCodeException
SPxInternalCodeException(const std::string &m="")
constructor
Definition
exceptions.h:129
soplex::SPxMemoryException::SPxMemoryException
SPxMemoryException(const std::string &m="")
constructor
Definition
exceptions.h:90
soplex::SPxStatusException::SPxStatusException
SPxStatusException(const std::string &m="")
constructor
Definition
exceptions.h:109
soplex
Everything should be within this namespace.
Generated by
1.17.0