FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTexception.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8
9
10#ifndef FMTEXCEPTION_H_INCLUDED
11#define FMTEXCEPTION_H_INCLUDED
12
13#include <exception>
14#include <string>
15#include <iostream>
16#include <memory>
17#include "FMTutility.hpp"
18
19
20
22namespace Exception
23{
24// DocString: FMTlev
29 {
34 FMT_range=4
35 };
36
37// DocString: FMTexc
42 {
43 None = 0,
126 };
127
128// DocString: FMTexception
133class FMTEXPORT FMTexception : public std::exception
134 {
135 // DocString: FMTexception::serialize
139 friend class boost::serialization::access;
140 template<class Archive>
141 void serialize(Archive& ar, const unsigned int version);
142 protected:
143 // DocString: FMTexception::holdup
146 bool holdup;
147 // DocString: FMTexception::_msg
149 std::string _msg;
150 // DocString: FMTexception::exceptiontype
153 // DocString: FMTexception::section
156 // DocString: FMTexception::method
158 std::string method;
159 // DocString: FMTexception::file
161 std::string file;
162 // DocString: FMTexception::line
164 int line;
165 public:
166 // DocString: FMTexception()
171 // DocString: ~FMTexception()
175 virtual ~FMTexception() = default;
176
177 // DocString: FMTexception()
181 FMTexception(const std::exception& baseexception);
182 // DocString: FMTexception(const FMTexc,const std::string)
186 FMTexception(const FMTexc lexception,const std::string message);
187
188 // DocString: FMTexception(const FMTexc,Core::FMTsection,const std::string)
192 FMTexception(const FMTexc lexception,Core::FMTsection lsection,const std::string message);
193 // DocString: FMTexception(const FMTexc,Core::FMTsection,const std::string,const std::string&,const std::string&,const std::string&)
198 FMTexception(const FMTexc lexception,Core::FMTsection lsection,const std::string message,
199 const std::string& lmethod, const std::string& lfile, const int& lline);
200
201 // DocString: FMTexception(const FMTexc,Core::FMTsection,const std::string,const std::string&)
206 FMTexception(const FMTexc lexception, Core::FMTsection lsection, const std::string message,
207 const std::string& lmethod);
208
209 // DocString: FMTexception(const FMTexc, const std::string&,const std::string&,const std::string&,const int&)
213 FMTexception(const FMTexc lexception, const std::string message,
214 const std::string& lmethod, const std::string& lfile, const int& lline);
215
216 // DocString: FMTexception(const FMTexc, const std::string&,const std::string&,)
220 FMTexception(const FMTexc lexception, const std::string message,const std::string& lmethod);
221 // DocString: FMTexception(const FMTexception&)
226 // DocString: FMTexception::operator=
230 FMTexception& operator = (const FMTexception& rhs);
231 // DocString: FMTexception::gettype
236 // DocString: FMTexception::getsection
241 // DocString: FMTexception::what
245 const char* what() const throw() override;
246 // DocString: FMTexception::hold
250 bool hold() const;
251 // DocString: FMTexception::sethold
255 void sethold(bool side);
256 // DocString: FMTexception::getmethod
260 inline std::string getmethod() const
261 {
262 return method;
263 }
264 // DocString: FMTexception::getfile
268 inline std::string getfile() const
269 {
270 return file;
271 }
272 // DocString: FMTexception::getline
276 inline int getline() const
277 {
278 return line;
279 }
280 // DocString: FMTexception::getsrcinfo
284 std::string getsrcinfo() const;
285 };
286
287}
288
289
290#endif // FMTEXCEPTION_H_INCLUDED
#define FMTEXPORT
Definition: FMTutility.hpp:92
Definition: FMTexception.hpp:134
virtual ~FMTexception()=default
bool holdup
Definition: FMTexception.hpp:146
std::string method
Function where the exception just happened.
Definition: FMTexception.hpp:158
FMTexception(const FMTexc lexception, Core::FMTsection lsection, const std::string message)
FMTexc exceptiontype
Type of the exception thrown.
Definition: FMTexception.hpp:152
FMTexception(const FMTexc lexception, const std::string message, const std::string &lmethod)
int line
Source file line where the exception just happened.
Definition: FMTexception.hpp:164
std::string getsrcinfo() const
FMTexception(const FMTexc lexception, const std::string message, const std::string &lmethod, const std::string &lfile, const int &lline)
FMTexception(const FMTexc lexception, const std::string message)
std::string file
Source file where the exception just happened.
Definition: FMTexception.hpp:161
Core::FMTsection section
Section in which the exception just happened.
Definition: FMTexception.hpp:155
FMTexception(const std::exception &baseexception)
int getline() const
Definition: FMTexception.hpp:276
std::string getfile() const
Definition: FMTexception.hpp:268
FMTexception(const FMTexc lexception, Core::FMTsection lsection, const std::string message, const std::string &lmethod, const std::string &lfile, const int &lline)
Core::FMTsection getsection() const
FMTexception(const FMTexc lexception, Core::FMTsection lsection, const std::string message, const std::string &lmethod)
std::string _msg
Keeps the message string of the exception.
Definition: FMTexception.hpp:149
FMTexception(const FMTexception &rhs)
const char * what() const override
FMTexc gettype() const
FMTsection
Definition: FMTutility.hpp:23
Namespace for exceptions and exceptions handling (warnings and errors) thrown by FMT and all exceptio...
Definition: FMTcplhandler.hpp:16
FMTexc
Definition: FMTexception.hpp:42
@ FMTunhandlederror
Definition: FMTexception.hpp:98
@ FMTinvalidlayer
Definition: FMTexception.hpp:69
@ FMTinvalidoverview
Definition: FMTexception.hpp:71
@ FMTcomma_replacement
Definition: FMTexception.hpp:45
@ FMTinvalidband
Definition: FMTexception.hpp:67
@ FMTunsupported_output
Definition: FMTexception.hpp:77
@ FMTundefined_action
Definition: FMTexception.hpp:74
@ FMTempty_schedules
Definition: FMTexception.hpp:111
@ FMTinvalid_constraint
Definition: FMTexception.hpp:90
@ FMTsame_transitiontargets
Definition: FMTexception.hpp:122
@ FMTemptybound
Definition: FMTexception.hpp:91
@ FMTaggregate_redefinition
Definition: FMTexception.hpp:57
@ FMTunboundedperiod
Definition: FMTexception.hpp:92
@ FMTfunctionfailed
Definition: FMTexception.hpp:95
@ FMTnotlinegraph
Definition: FMTexception.hpp:99
@ FMTinvalid_yield
Definition: FMTexception.hpp:50
@ FMTboostgrapherror
Definition: FMTexception.hpp:97
@ FMTyieldmodelprediction
Definition: FMTexception.hpp:120
@ FMTmissinglicense
Definition: FMTexception.hpp:94
@ FMTinvalid_transition
Definition: FMTexception.hpp:52
@ FMTmissingrasterattribute
Definition: FMTexception.hpp:72
@ FMTdeathwithlock
Definition: FMTexception.hpp:118
@ FMTschemefailed
Definition: FMTexception.hpp:113
@ FMTinvalid_action
Definition: FMTexception.hpp:51
@ FMTinvalid_maskrange
Definition: FMTexception.hpp:49
@ FMTgdal_constructor_error
Definition: FMTexception.hpp:108
@ FMTsourcetotarget_transition
Definition: FMTexception.hpp:121
@ FMTunclosedforloop
Definition: FMTexception.hpp:123
@ FMTempty_transition
Definition: FMTexception.hpp:75
@ FMTthreadcrash
Definition: FMTexception.hpp:124
@ FMTmskerror
Definition: FMTexception.hpp:115
@ None
Definition: FMTexception.hpp:43
@ FMTmissing_parameter
Definition: FMTexception.hpp:117
@ FMTnonaddedconstraint
Definition: FMTexception.hpp:93
@ FMToutput_missing_operator
Definition: FMTexception.hpp:105
@ FMTcoinerror
Definition: FMTexception.hpp:96
@ FMTunsupported_yield
Definition: FMTexception.hpp:65
@ FMToutput_too_much_operator
Definition: FMTexception.hpp:106
@ FMTundefined_aggregate_value
Definition: FMTexception.hpp:60
@ FMTundefineddeathtransition
Definition: FMTexception.hpp:82
@ FMTmissingfield
Definition: FMTexception.hpp:70
@ FMTmissingyield
Definition: FMTexception.hpp:84
@ FMTundefined_attribute
Definition: FMTexception.hpp:61
@ FMTinvalid_transition_case
Definition: FMTexception.hpp:53
@ FMTempty_theme
Definition: FMTexception.hpp:58
@ FMTinvaliddataset
Definition: FMTexception.hpp:66
@ FMTinfeasibleconstraint
Definition: FMTexception.hpp:103
@ FMTmissingdevelopement
Definition: FMTexception.hpp:87
@ FMToutofrangeyield
Definition: FMTexception.hpp:125
@ FMTinvalid_path
Definition: FMTexception.hpp:55
@ FMTinvalid_aggregate
Definition: FMTexception.hpp:48
@ FMTfutur_types
Definition: FMTexception.hpp:46
@ FMTpreexisting_yield
Definition: FMTexception.hpp:64
@ FMTGDALerror
Definition: FMTexception.hpp:101
@ FMTignore
Definition: FMTexception.hpp:83
@ FMTthematic_output_diff
Definition: FMTexception.hpp:104
@ FMTconstants_replacement
Definition: FMTexception.hpp:44
@ FMTinvalid_number
Definition: FMTexception.hpp:54
@ FMTwrong_partial
Definition: FMTexception.hpp:63
@ FMTempty_aggregate
Definition: FMTexception.hpp:59
@ FMTmaxnumberofexception
Definition: FMTexception.hpp:114
@ FMTinvaliddriver
Definition: FMTexception.hpp:78
@ FMTtheme_redefinition
Definition: FMTexception.hpp:56
@ FMTreplanningwarning
Definition: FMTexception.hpp:119
@ FMTunsupported_objective
Definition: FMTexception.hpp:89
@ FMTattribute_redefinition
Definition: FMTexception.hpp:85
@ FMTmissingobjective
Definition: FMTexception.hpp:88
@ FMTundefined_output
Definition: FMTexception.hpp:76
@ FMTinvalid_geometry
Definition: FMTexception.hpp:109
@ FMTundefinedoutput_attribute
Definition: FMTexception.hpp:110
@ FMTunsupported_transition
Definition: FMTexception.hpp:73
@ FMTempty_action
Definition: FMTexception.hpp:62
@ FMTmissing_scenarios
Definition: FMTexception.hpp:112
@ FMTinvalid_theme
Definition: FMTexception.hpp:47
@ FMTundefined_constant
Definition: FMTexception.hpp:86
@ FMTinvalidyield_number
Definition: FMTexception.hpp:107
@ FMTGDALwarning
Definition: FMTexception.hpp:102
@ FMTrangeerror
Definition: FMTexception.hpp:100
@ FMTleakingtransition
Definition: FMTexception.hpp:80
@ FMTinvalidAandT
Definition: FMTexception.hpp:79
@ FMTundefineddeathaction
Definition: FMTexception.hpp:81
@ FMTinvalidrasterblock
Definition: FMTexception.hpp:68
@ FMToveridedyield
Definition: FMTexception.hpp:116
FMTlev
Definition: FMTexception.hpp:29
@ FMT_range
Definition: FMTexception.hpp:34
@ FMT_logic
Definition: FMTexception.hpp:33
@ FMT_None
Definition: FMTexception.hpp:30
@ FMT_Debug
Definition: FMTexception.hpp:31
@ FMT_Warning
Definition: FMTexception.hpp:32