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

Base exception class for FMT holding the type, section and message of a given exception. More...

#include <FMTException.h>

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

Public Member Functions

 FMTException ()
 Default constructor for FMTException.
 
virtual ~FMTException ()=default
 Default virtual destructor for FMTException.
 
 FMTException (FMTexc p_exception, FMTlev p_level, 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 FMTException from an exception type, a section, a message and the location where it occurred.
 
 FMTException (const FMTException &rhs)=default
 Default copy constructor for FMTException.
 
FMTExceptionoperator= (const FMTException &rhs)=default
 Default copy assignment operator for FMTException.
 
FMTexc getType () const
 Return the type of exception held by this FMTException.
 
Core::FMTsection getSection () const
 Return the section in which the exception occurred.
 
const char * what () const noexcept override
 Override the what function of the base exception class returning the message string.
 
bool hold () const
 Return the value of the holdup member.
 
void setHold (bool side)
 Set the value of the holdup member.
 
std::string getMethod () const
 Return the method in which the exception occurred.
 
std::string getFile () const
 Return the source file in which the exception occurred.
 
int getLine () const
 Return the source file line in which the exception occurred.
 
const std::string & getDescription (bool p_french=false) const
 Return the description of the exception thrown.
 
std::string getSrcInfo () const
 Return a formatted string for the location of the exception.
 
const std::string & getMessage () const
 Return the message of the exception.
 
FMTlev getLevel () const
 Return the level of the exception.
 
bool isFatal () const
 return true if it is fatal
 
void setIgnore ()
 set a ignore message to the exception and turn the level to warning
 
void setPrintLevel (int p_level)
 set the level of print and change the message
 

Friends

class boost::serialization::access
 Serialize function used for serialization to do multiprocessing across multiple cpus (pickle in Python).
 

Detailed Description

Base exception class for FMT holding the type, section and message of a given exception.

Constructor & Destructor Documentation

◆ FMTException() [1/3]

Exception::FMTException::FMTException ( )

Default constructor for FMTException.

◆ ~FMTException()

virtual Exception::FMTException::~FMTException ( )
virtualdefault

Default virtual destructor for FMTException.

◆ FMTException() [2/3]

Exception::FMTException::FMTException ( FMTexc  p_exception,
FMTlev  p_level,
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 FMTException from an exception type, a section, a message and the location where it occurred.

Parameters
[in]p_exceptionthe exception type.
[in]p_levellevel of the exception type.
[in]p_sectionthe section in which the exception occurred.
[in]p_messagethe message of the exception.
[in]p_methodthe method where the exception occurred.
[in]p_filethe file where the exception occurred.
[in]p_linethe line where the exception occurred.
[in]p_FrenchDescriptionfrench description.
[in]p_EnglishDescriptionenglish description.

◆ FMTException() [3/3]

Exception::FMTException::FMTException ( const FMTException rhs)
default

Default copy constructor for FMTException.

Parameters
[in]rhsthe FMTException to copy.

Member Function Documentation

◆ getDescription()

const std::string & Exception::FMTException::getDescription ( bool  p_french = false) const

Return the description of the exception thrown.

Parameters
[in]p_frenchif true will be in french
Returns
the description

◆ getFile()

std::string Exception::FMTException::getFile ( ) const
inline

Return the source file in which the exception occurred.

Returns
the source file.

◆ getLevel()

FMTlev Exception::FMTException::getLevel ( ) const

Return the level of the exception.

Returns
the level

◆ getLine()

int Exception::FMTException::getLine ( ) const
inline

Return the source file line in which the exception occurred.

Returns
the source file line.

◆ getMessage()

const std::string & Exception::FMTException::getMessage ( ) const

Return the message of the exception.

Returns
the message string

◆ getMethod()

std::string Exception::FMTException::getMethod ( ) const
inline

Return the method in which the exception occurred.

Returns
the method.

◆ getSection()

Core::FMTsection Exception::FMTException::getSection ( ) const

Return the section in which the exception occurred.

Returns
the section.

◆ getSrcInfo()

std::string Exception::FMTException::getSrcInfo ( ) const

Return a formatted string for the location of the exception.

Returns
the formatted source location.

◆ getType()

FMTexc Exception::FMTException::getType ( ) const

Return the type of exception held by this FMTException.

Returns
the exception type.

◆ hold()

bool Exception::FMTException::hold ( ) const

Return the value of the holdup member.

Returns
the holdup value.

◆ isFatal()

bool Exception::FMTException::isFatal ( ) const

return true if it is fatal

Returns
true or false

◆ operator=()

FMTException & Exception::FMTException::operator= ( const FMTException rhs)
default

Default copy assignment operator for FMTException.

Parameters
[in]rhsthe FMTException to copy.
Returns
a reference to this FMTException.

◆ setHold()

void Exception::FMTException::setHold ( bool  side)

Set the value of the holdup member.

Parameters
[in]sidethe value to set.

◆ setIgnore()

void Exception::FMTException::setIgnore ( )

set a ignore message to the exception and turn the level to warning

◆ setPrintLevel()

void Exception::FMTException::setPrintLevel ( int  p_level)

set the level of print and change the message

Parameters
[in]p_levelthe level of print

◆ what()

const char * Exception::FMTException::what ( ) const
overridenoexcept

Override the what function of the base exception class returning the message string.

Returns
the message string.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize function used for serialization to do multiprocessing across multiple cpus (pickle in Python).

Template Parameters
Archivethe archive type.
Parameters
[in,out]arthe archive to serialize to or from.
[in]versionthe serialization version.

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