STK++
0.9.13
STK_Exceptions.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------*/
2
/* Copyright (C) 2004-2016 Serge Iovleff
3
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU Lesser General Public License as
6
published by the Free Software Foundation; either version 2 of the
7
License, or (at your option) any later version.
8
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU Lesser General Public License for more details.
13
14
You should have received a copy of the GNU Lesser General Public
15
License along with this program; if not, write to the
16
Free Software Foundation, Inc.,
17
59 Temple Place,
18
Suite 330,
19
Boston, MA 02111-1307
20
USA
21
22
Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23
*/
24
25
/*
26
* Project: stkpp::STKernel
27
* created on: 6 janv. 2012
28
* Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29
**/
30
35
#ifndef STK_EXCEPTIONS_H
36
#define STK_EXCEPTIONS_H
37
38
#include <exception>
39
40
namespace
STK
41
{
50
class
Exception
51
{
52
String
_M_msg
;
53
54
public
:
55
Exception
()
throw
();
57
explicit
Exception
(
String
const
&
__arg
)
throw
();
58
virtual
~
Exception
()
throw
();
59
62
virtual
const
String
error
()
const
throw
();
63
};
64
65
72
class
logic_error
:
public
Exception
73
{
74
public
:
76
explicit
logic_error
(
String
const
&
__arg
);
77
virtual
~logic_error
()
throw
();
78
};
79
83
class
domain_error
:
public
logic_error
84
{
85
public
:
86
explicit
domain_error
(
String
const
&
__arg
);
87
virtual
~domain_error
()
throw
();
88
};
89
92
class
invalid_argument
:
public
logic_error
93
{
94
public
:
95
explicit
invalid_argument
(
String
const
&
__arg
);
96
virtual
~invalid_argument
()
throw
();
97
};
98
102
class
length_error
:
public
logic_error
103
{
104
public
:
105
explicit
length_error
(
String
const
&
__arg
);
106
virtual
~length_error
()
throw
();
107
};
108
112
class
out_of_range
:
public
logic_error
113
{
114
public
:
115
explicit
out_of_range
(
String
const
&
__arg
);
116
virtual
~out_of_range
()
throw
();
117
};
118
125
class
runtime_error
:
public
Exception
126
{
127
public
:
129
explicit
runtime_error
(
String
const
&
__arg
);
130
virtual
~runtime_error
()
throw
();
131
};
132
135
class
range_error
:
public
runtime_error
136
{
137
public
:
138
explicit
range_error
(
String
const
&
__arg
);
139
virtual
~range_error
()
throw
();
140
};
141
142
// base exception
143
inline
Exception::Exception
()
throw
() {
_M_msg
=
_T
(
"Exception error."
); }
144
inline
Exception::Exception
(
String
const
&
__arg
)
throw
() {
_M_msg
=
__arg
;}
145
inline
Exception::~Exception
()
throw
() {}
146
inline
const
String
Exception::error
()
const
throw
() {
return
_M_msg
;}
147
148
// logic_error
149
inline
logic_error::logic_error
(
String
const
&
__arg
):
Exception
(
__arg
) {}
150
inline
logic_error::~logic_error
()
throw
() {}
151
152
// domain_error
153
inline
domain_error::domain_error
(
String
const
&
__arg
):
logic_error
(
__arg
) {}
154
inline
domain_error::~domain_error
()
throw
() {}
155
156
// invalid_argument
157
inline
invalid_argument::invalid_argument
(
String
const
&
__arg
):
logic_error
(
__arg
) {}
158
inline
invalid_argument::~invalid_argument
()
throw
() {}
159
160
// length_error
161
inline
length_error::length_error
(
String
const
&
__arg
):
logic_error
(
__arg
) {}
162
inline
length_error::~length_error
()
throw
() {}
163
164
// out_of_range
165
inline
out_of_range::out_of_range
(
String
const
&
__arg
):
logic_error
(
__arg
) {}
166
inline
out_of_range::~out_of_range
()
throw
() {}
167
168
// runtime error
169
inline
runtime_error::runtime_error
(
String
const
&
__arg
):
Exception
(
__arg
) {}
170
inline
runtime_error::~runtime_error
()
throw
() {}
171
172
// range_error
173
inline
range_error::range_error
(
String
const
&
__arg
):
runtime_error
(
__arg
) {}
174
inline
range_error::~range_error
()
throw
() {}
175
176
}
// namespace STK
177
178
#endif
/* STK_EXCEPTIONS_H */
_T
#define _T(x)
Let x unmodified.
Definition
STK_Typedefs.h:71
STK::Exception
Sdk class for all library Exceptions.
Definition
STK_Exceptions.h:51
STK::Exception::_M_msg
String _M_msg
Definition
STK_Exceptions.h:52
STK::Exception::Exception
Exception()
Definition
STK_Exceptions.h:143
STK::Exception::error
virtual const String error() const
Returns a C-style character string describing the general cause of the current error.
Definition
STK_Exceptions.h:146
STK::Exception::~Exception
virtual ~Exception()
Definition
STK_Exceptions.h:145
STK::MultidimRegression
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Definition
STK_MultidimRegression.h:52
STK::domain_error
Thrown by the library, or by you, to report domain errors (domain in the mathematical sense).
Definition
STK_Exceptions.h:84
STK::domain_error::domain_error
domain_error(String const &__arg)
Definition
STK_Exceptions.h:153
STK::domain_error::~domain_error
virtual ~domain_error()
Definition
STK_Exceptions.h:154
STK::invalid_argument
Thrown to report invalid arguments to functions.
Definition
STK_Exceptions.h:93
STK::invalid_argument::~invalid_argument
virtual ~invalid_argument()
Definition
STK_Exceptions.h:158
STK::invalid_argument::invalid_argument
invalid_argument(String const &__arg)
Definition
STK_Exceptions.h:157
STK::length_error
Thrown when an object is constructed that would exceed its maximum permitted size (e....
Definition
STK_Exceptions.h:103
STK::length_error::~length_error
virtual ~length_error()
Definition
STK_Exceptions.h:162
STK::length_error::length_error
length_error(String const &__arg)
Definition
STK_Exceptions.h:161
STK::logic_error
Logic errors represent problems in the internal logic of a program; in theory, these are preventable,...
Definition
STK_Exceptions.h:73
STK::logic_error::logic_error
logic_error(String const &__arg)
Takes a character String describing the error.
Definition
STK_Exceptions.h:149
STK::logic_error::~logic_error
virtual ~logic_error()
Definition
STK_Exceptions.h:150
STK::out_of_range
This represents an argument whose value is not within the expected range (e.g., boundary checks in ba...
Definition
STK_Exceptions.h:113
STK::out_of_range::out_of_range
out_of_range(String const &__arg)
Definition
STK_Exceptions.h:165
STK::out_of_range::~out_of_range
virtual ~out_of_range()
Definition
STK_Exceptions.h:166
STK::range_error
Thrown to indicate range errors in internal computations.
Definition
STK_Exceptions.h:136
STK::range_error::~range_error
virtual ~range_error()
Definition
STK_Exceptions.h:174
STK::range_error::range_error
range_error(String const &__arg)
Definition
STK_Exceptions.h:173
STK::runtime_error
Runtime errors represent problems outside the scope of a program; they cannot be easily predicted and...
Definition
STK_Exceptions.h:126
STK::runtime_error::~runtime_error
virtual ~runtime_error()
Definition
STK_Exceptions.h:170
STK::runtime_error::runtime_error
runtime_error(String const &__arg)
Takes a character String describing the error.
Definition
STK_Exceptions.h:169
STK::String
std::basic_string< Char > String
STK fundamental type of a String.
Definition
STK_Typedefs.h:89
STK
The namespace STK is the main domain space of the Statistical ToolKit project.
projects
Sdk
include
STK_Exceptions.h
Generated on Sat Feb 15 2025 12:07:17 for STK++ by
1.9.8