FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTDebugExceptionHandler.h
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#ifndef FMTdebugexceptionhandler_Hm_included
9#define FMTdebugexceptionhandler_Hm_included
10#include "FMTExceptionHandler.h"
11#include <string>
12
13
14namespace Exception
15{
16 // DocString: FMTDebugExceptionHandler
21 {
22 public:
23 // DocString: FMTDebugExceptionHandler()
28 // DocString: ~FMTDebugExceptionHandler()
33 // DocString: FMTDebugExceptionHandler::raise
45 FMTException raise(FMTexc lexception, std::string text,
46 const std::string& method, const int& line, const std::string& file,
47 Core::FMTsection lsection = Core::FMTsection::Empty, bool throwit = true) override;
48 #if defined FMTWITHGDAL
49 // DocString: FMTDebugExceptionHandler::getCplData
55 // DocString: FMTDebugExceptionHandler::handelCplError
62 void handelCplError(int eErrClass, int nError, const char * pszErrorMsg) override;
63 #endif
64 // DocString: FMTDebugExceptionHandler::clone
69 virtual std::unique_ptr <FMTExceptionHandler> clone() const;
70 private:
71 // DocString: FMTDebugExceptionHandler::serialize
78 friend class boost::serialization::access;
79 template<class Archive>
80 void serialize(Archive& ar, const unsigned int version)
81 {
82 ar& boost::serialization::make_nvp("FMTexceptionhandler", boost::serialization::base_object<FMTExceptionHandler>(*this));
83 }
84 };
85
86}
87
88BOOST_CLASS_EXPORT_KEY(Exception::FMTDebugExceptionHandler)
89
90#endif
91
#define FMTEXPORT
Definition: FMTutility.h:125
Exception handler derived from FMTExceptionHandler that reports the source line and file where the ex...
Definition: FMTDebugExceptionHandler.h:21
virtual std::unique_ptr< FMTExceptionHandler > clone() const
clone the FMTDebugExceptionHandler
FMTDebugExceptionHandler()
Default constructor for FMTDebugExceptionHandler.
~FMTDebugExceptionHandler()=default
Default destructor for FMTDebugExceptionHandler.
FMTException raise(FMTexc lexception, std::string text, const std::string &method, const int &line, const std::string &file, Core::FMTsection lsection=Core::FMTsection::Empty, bool throwit=true) override
Override the base class raise function with a debug style. See FMTExceptionHandler::raise.
void handelCplError(int eErrClass, int nError, const char *pszErrorMsg) override
Callback used in GDAL. See FMTExceptionHandler::handelCplError.
FMTExceptionHandler * getCplData() override
Return an abstract copy of itself, used in handelCplError called back by GDAL. See FMTExceptionHandle...
Base class used to handle errors thrown in FMT.
Definition: FMTExceptionHandler.h:34
Base exception class for FMT holding the type, section and message of a given exception.
Definition: FMTException.h:140
FMTsection
Enumerator describing the sections of a Woodstock model.
Definition: FMTutility.h:32
@ Empty
Definition: FMTutility.h:44
Namespace for exceptions and exceptions handling (warnings and errors) thrown by FMT and all exceptio...
Definition: FMTAggregateRedefinition.h:11
FMTexc
Enumerator describing the exceptions thrown by FMT.
Definition: FMTException.h:45