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
40namespace STK
41{
64
65
73{
74 public:
76 explicit logic_error( String const& __arg);
77 virtual ~logic_error() throw();
78};
79
84{
85 public:
86 explicit domain_error( String const& __arg);
87 virtual ~domain_error() throw();
88};
89
93{
94 public:
95 explicit invalid_argument( String const& __arg);
96 virtual ~invalid_argument() throw();
97};
98
103{
104 public:
105 explicit length_error( String const& __arg);
106 virtual ~length_error() throw();
107};
108
113{
114 public:
115 explicit out_of_range( String const& __arg);
116 virtual ~out_of_range() throw();
117};
118
126{
127 public:
129 explicit runtime_error( String const& __arg);
130 virtual ~runtime_error() throw();
131};
132
136{
137 public:
138 explicit range_error( String const& __arg);
139 virtual ~range_error() throw();
140};
141
142// base exception
143inline Exception::Exception() throw() {_M_msg =_T("Exception error."); }
144inline Exception::Exception( String const& __arg) throw() { _M_msg = __arg;}
146inline const String Exception::error() const throw() { return _M_msg;}
147
148// logic_error
151
152// domain_error
155
156// invalid_argument
159
160// length_error
163
164// out_of_range
167
168// runtime error
171
172// range_error
175
176} // namespace STK
177
178#endif /* STK_EXCEPTIONS_H */
#define _T(x)
Let x unmodified.
Sdk class for all library Exceptions.
virtual const String error() const
Returns a C-style character string describing the general cause of the current error.
virtual ~Exception()
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
Thrown by the library, or by you, to report domain errors (domain in the mathematical sense).
domain_error(String const &__arg)
Thrown to report invalid arguments to functions.
invalid_argument(String const &__arg)
Thrown when an object is constructed that would exceed its maximum permitted size (e....
length_error(String const &__arg)
Logic errors represent problems in the internal logic of a program; in theory, these are preventable,...
logic_error(String const &__arg)
Takes a character String describing the error.
This represents an argument whose value is not within the expected range (e.g., boundary checks in ba...
out_of_range(String const &__arg)
Thrown to indicate range errors in internal computations.
range_error(String const &__arg)
Runtime errors represent problems outside the scope of a program; they cannot be easily predicted and...
runtime_error(String const &__arg)
Takes a character String describing the error.
std::basic_string< Char > String
STK fundamental type of a String.
The namespace STK is the main domain space of the Statistical ToolKit project.