FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTFreeExceptionHandler.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 FMTfreeexceptionhandler_Hm_included
9#define FMTfreeexceptionhandler_Hm_included
10
11#include "FMTExceptionHandler.h"
12#include <boost/serialization/serialization.hpp>
13#include <boost/serialization/nvp.hpp>
14#include <string>
15
16namespace Exception
17{
18// DocString: FMTFreeExceptionHandler
23{
24public:
25 // DocString: FMTFreeExceptionHandler()
30 // DocString: ~FMTFreeExceptionHandler()
35 // DocString: FMTFreeExceptionHandler::raise
47 FMTException raise(FMTexc lexception, std::string text,
48 const std::string& method, const int& line, const std::string& file,
49 Core::FMTsection lsection = Core::FMTsection::Empty, bool throwit = true) override;
50#if defined FMTWITHGDAL
51 // DocString: FMTFreeExceptionHandler::getCplData
57 // DocString: FMTFreeExceptionHandler::handelCplError
64 void handelCplError(int eErrClass, int nError, const char * pszErrorMsg) override;
65#endif
66 // DocString: FMTFreeExceptionHandler::clone
71 virtual std::unique_ptr <FMTExceptionHandler> clone() const;
72private:
73 // DocString: FMTFreeExceptionHandler::serialize
80 friend class boost::serialization::access;
81 template<class Archive>
82 void serialize(Archive& ar, const unsigned int version)
83 {
84 ar& boost::serialization::make_nvp("FMTexceptionhandler", boost::serialization::base_object<FMTExceptionHandler>(*this));
85 }
86};
87}
88
89BOOST_CLASS_EXPORT_KEY(Exception::FMTFreeExceptionHandler)
90
91#endif
92
#define FMTEXPORT
Definition: FMTutility.h:125
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
Exception handler derived from FMTExceptionHandler that passes exceptions thrown by FMT directly to t...
Definition: FMTFreeExceptionHandler.h:23
FMTFreeExceptionHandler()
Default constructor for FMTFreeExceptionHandler.
~FMTFreeExceptionHandler()=default
Default destructor for FMTFreeExceptionHandler.
FMTExceptionHandler * getCplData() override
Return an abstract copy of itself, used in handelCplError called back by GDAL. See FMTExceptionHandle...
virtual std::unique_ptr< FMTExceptionHandler > clone() const
clone the FMTFreeExceptionHandler
void handelCplError(int eErrClass, int nError, const char *pszErrorMsg) override
Callback used in GDAL. See FMTExceptionHandler::handelCplError.
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. See FMTExceptionHandler::raise.
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