FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTWarning.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 FMTwarning_Hm_included
9#define FMTwarning_Hm_included
10
11#include <unordered_map>
12#include "FMTException.h"
13#include <string>
14#include <memory>
15#include "FMTutility.h"
16#include <boost/serialization/nvp.hpp>
17
18namespace Logging
19{
20 class FMTLogger;
21}
22
23namespace Exception
24{
25 // DocString: FMTWarning
31 {
32
33 public:
34 // DocString: ~FMTWarning()
38 ~FMTWarning()=default;
39 // DocString: FMTWarning::operator=
44 FMTWarning& operator = (const FMTWarning&) = default;
45 // DocString: FMTWarning()
50 // DocString: FMTWarning(FMTexc,Core::FMTsection,const std::string&,const std::string&,const std::string&,const int&,const std::string&,const std::string&)
62 FMTWarning(FMTexc p_exception, Core::FMTsection p_section, const std::string& p_message,
63 const std::string& p_method, const std::string& p_file, const int& p_line,
64 const std::string& p_FrenchDescription, const std::string& p_EnglishDescription);
65 // DocString: FMTWarning::warn
72 void warn(Logging::FMTLogger& logger,std::unordered_map<int,size_t>& specificwarningcount, const size_t& maxwarning) const;
73 private:
74 // DocString: FMTWarning::serialize
81 friend class boost::serialization::access;
82 template<class Archive>
83 void serialize(Archive& ar, const unsigned int version)
84 {
85 ar& boost::serialization::make_nvp("parent_exception", boost::serialization::base_object<FMTException>(*this));
86 }
87 };
88}
89#endif
#define FMTEXPORT
Definition: FMTutility.h:125
Base exception class for FMT holding the type, section and message of a given exception.
Definition: FMTException.h:140
Exception class derived from FMTException for warnings in FMT.
Definition: FMTWarning.h:31
~FMTWarning()=default
Default destructor for FMTWarning.
void warn(Logging::FMTLogger &logger, std::unordered_map< int, size_t > &specificwarningcount, const size_t &maxwarning) const
Log the warning using the given logger.
FMTWarning()
Default constructor for FMTWarning.
FMTWarning(FMTexc p_exception, Core::FMTsection p_section, const std::string &p_message, const std::string &p_method, const std::string &p_file, const int &p_line, const std::string &p_FrenchDescription, const std::string &p_EnglishDescription)
Construct a FMTWarning from an exception type, a section, a message and the location where it occurre...
Base class handling the level of information printed by FMT.
Definition: FMTLogger.h:37
FMTsection
Enumerator describing the sections of a Woodstock model.
Definition: FMTutility.h:32
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
Namespace for the log management, provides different log handlers.
Definition: FMTDebugLogger.h:14