FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTDefaultExceptionHandler.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 FMTdefaultexceptionhandler_Hm_included
9#define FMTdefaultexceptionhandler_Hm_included
10
11#include "FMTExceptionHandler.h"
12#include "FMTException.h"
13#include <string>
14
15namespace Exception
16{
17// DocString: FMTDefaultExceptionHandler
22 {
23 public:
24 // DocString: FMTDefaultExceptionHandler()
29 // DocString: FMTDefaultExceptionHandler(const std::unique_ptr<Logging::FMTLogger>&)
34 FMTDefaultExceptionHandler(const std::unique_ptr<Logging::FMTLogger>& logger);
35 // DocString: ~FMTDefaultExceptionHandler()
40 // DocString: FMTDefaultExceptionHandler::raise
52 FMTException raise(FMTexc lexception, std::string text,
53 const std::string& method, const int& line, const std::string& file,
54 Core::FMTsection lsection = Core::FMTsection::Empty, bool throwit = true) override;
55
56 // DocString: FMTDefaultExceptionHandler::getCplData
62 // DocString: FMTDefaultExceptionHandler::handelCplError
63 #if defined FMTWITHGDAL
70 void handelCplError(int eErrClass, int nError, const char * pszErrorMsg) override;
71 #endif
72 // DocString: FMTDefaultExceptionHandler::clone
77 virtual std::unique_ptr <FMTExceptionHandler> clone() const;
78 private:
79 // DocString: FMTDefaultExceptionHandler::serialize
86 friend class boost::serialization::access;
87 template<class Archive>
88 void serialize(Archive& ar, const unsigned int version)
89 {
90 ar& boost::serialization::make_nvp("FMTexceptionhandler", boost::serialization::base_object<FMTExceptionHandler>(*this));
91 }
92 };
93}
94
95BOOST_CLASS_EXPORT_KEY(Exception::FMTDefaultExceptionHandler)
96
97#endif
98
#define FMTEXPORT
Definition: FMTutility.h:125
Default exception handler used in FMT, derived from FMTExceptionHandler.
Definition: FMTDefaultExceptionHandler.h:22
FMTExceptionHandler * getCplData() override
Return an abstract copy of itself, used in handelCplError called back by GDAL. See FMTExceptionHandle...
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
Default implementation overriding the base class raise function. See FMTExceptionHandler::raise.
~FMTDefaultExceptionHandler()=default
Default destructor for FMTDefaultExceptionHandler.
virtual std::unique_ptr< FMTExceptionHandler > clone() const
clone the FMTdefaulexceptionhandler
FMTDefaultExceptionHandler()
Default constructor for FMTDefaultExceptionHandler.
FMTDefaultExceptionHandler(const std::unique_ptr< Logging::FMTLogger > &logger)
Construct a FMTDefaultExceptionHandler with a logger.
void handelCplError(int eErrClass, int nError, const char *pszErrorMsg) override
Callback used in GDAL. See FMTExceptionHandler::handelCplError.
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