FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
Exception::FMTdefaultexceptionhandler Class Referencefinal

#include <FMTdefaultexceptionhandler.hpp>

Inheritance diagram for Exception::FMTdefaultexceptionhandler:
[legend]
Collaboration diagram for Exception::FMTdefaultexceptionhandler:
[legend]

Public Member Functions

 FMTdefaultexceptionhandler ()
 
 FMTdefaultexceptionhandler (const std::shared_ptr< Logging::FMTlogger > &logger)
 
 ~FMTdefaultexceptionhandler ()=default
 
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
 
FMTexceptionhandlergetCPLdata () override
 
void handelCPLerror (int eErrClass, int nError, const char *pszErrorMsg) override
 
- Public Member Functions inherited from Exception::FMTexceptionhandler
void checksignals () const
 
 FMTexceptionhandler ()
 
virtual ~FMTexceptionhandler ()=default
 
 FMTexceptionhandler (const FMTexceptionhandler &rhs)
 
 FMTexceptionhandler (const std::shared_ptr< Logging::FMTlogger > &logger)
 
void passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger)
 
virtual FMTexceptionhandlergetCPLdata ()
 
virtual void handelCPLerror (int eErrClass, int nError, const char *pszErrorMsg)
 
FMTexceptionhandleroperator= (const FMTexceptionhandler &rhs)
 
void throw_nested (const std::exception &texception, int &level, bool rethrow=true)
 
virtual void printexceptions (std::string text, const std::string &method, const int &line, const std::string &fil, Core::FMTsection lsection=Core::FMTsection::Empty)
 
virtual 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)
 
virtual FMTexception raisefromcatch (std::string text, const std::string &method, const int &line, const std::string &file, Core::FMTsection lsection=Core::FMTsection::Empty)
 
void raisefromthreadcatch (std::string text, const std::string &method, const int &line, const std::string &file, Core::FMTsection lsection=Core::FMTsection::Empty)
 
void reraiseifthreadcrash ()
 
void enablenestedexceptions ()
 
void disablenestedexceptions ()
 
void seterrorstowarnings (const std::vector< Exception::FMTexc > &errors)
 
void setmaxwarningsbeforesilenced (const size_t &maxwarningcount)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Public Attributes inherited from Exception::FMTexceptionhandler
std::unordered_map< int, size_t > _specificwarningcount
 Keeps count of the number of each type of warning thrown.
 
- Protected Member Functions inherited from Exception::FMTexceptionhandler
std::string updatestatus (const FMTexc lexception, const std::string message)
 
bool needtorethrow () const
 
bool ismainthread () const
 
bool isthrowedonthread () const
 
bool isthisthreadthrowed () const
 
void registerworkerthread ()
 
bool isthreadregistered () const
 
void gutsofprintexceptions (std::string text, const std::string &method, const int &line, const std::string &fil, int &levelreference, Core::FMTsection lsection=Core::FMTsection::Empty, bool logfirstlevel=true)
 
void gutsofexceptionlog (const std::exception &texception, const int &level)
 
- Protected Attributes inherited from Exception::FMTexceptionhandler
FMTlev _level
 This is the level of the last FMTexception thrown by the FMTexceptionhandler.
 
FMTexc _exception
 This is the type of the last FMTexception thrown by the FMTexceptionhandler.
 
int _errorcount
 Keeps count of the number of error thrown.
 
int _warningcount
 Keeps count of the number of warning thrown.
 
size_t maxwarningsbeforesilenced
 Number of time that the handler throw a certain warning before stop throwing it.
 
std::shared_ptr< Logging::FMTlogger_logger
 pointer to the logger used to print the warning / error.
 
bool usenestedexceptions
 If usenested = true then the handler will throw nested exceptions.
 
boost::recursive_mutex mtx
 Mutex for multi-threading.
 
std::vector< Exception::FMTexcerrorstowarnings
 If an error is in this list it's going to processed like a warning.
 
std::set< boost::thread::id > registered_threads
 This is the level of the last FMTexception thrown by the FMTexceptionhandler.
 
std::exception_ptr threadcrashexception
 The exception throwed by the faulty thread...
 
- Static Protected Attributes inherited from Exception::FMTexceptionhandler
static boost::thread::id mainthreadid
 Main thread id.
 
static boost::thread::id crashedthreadid
 The thread id of the crashed thread.
 

Detailed Description

The FMTdefaultexceptionhandler is derived from the FMTexceptionhandler base class and is the default exception handler used in FMT.

Constructor & Destructor Documentation

◆ FMTdefaultexceptionhandler() [1/2]

Exception::FMTdefaultexceptionhandler::FMTdefaultexceptionhandler ( )

Default constructor for FMTdefaultexceptionhandler.

◆ FMTdefaultexceptionhandler() [2/2]

Exception::FMTdefaultexceptionhandler::FMTdefaultexceptionhandler ( const std::shared_ptr< Logging::FMTlogger > &  logger)

Constructor with logger

◆ ~FMTdefaultexceptionhandler()

Exception::FMTdefaultexceptionhandler::~FMTdefaultexceptionhandler ( )
default

Default destructor for FMTdefaultexceptionhandler.

Member Function Documentation

◆ getCPLdata()

FMTexceptionhandler * Exception::FMTdefaultexceptionhandler::getCPLdata ( )
overridevirtual

Used in the handelCPLerror called back by GDAL function reutnr a abstract copy of itselft. See getCPLdata of FMTexceptionhandler class.

Reimplemented from Exception::FMTexceptionhandler.

◆ handelCPLerror()

void Exception::FMTdefaultexceptionhandler::handelCPLerror ( int  eErrClass,
int  nError,
const char *  pszErrorMsg 
)
overridevirtual

Used has call back in gdal. See handelCPLerror of FMTexceptionhandler class.

Reimplemented from Exception::FMTexceptionhandler.

◆ raise()

FMTexception Exception::FMTdefaultexceptionhandler::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 
)
overridevirtual

The function overide the base class raise function for a default implementation. See raise function of FMTexceptionhandler class.

Reimplemented from Exception::FMTexceptionhandler.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)


The documentation for this class was generated from the following file: