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

Factory class used to create FMT exception objects. More...

#include <FMTExceptionFactory.h>

Static Public Member Functions

static std::unique_ptr< FMTExceptioncreate (FMTexc p_exception, Core::FMTsection p_section, const std::string &p_message, const std::string &p_method, const std::string &p_file, int p_line)
 Creates a concrete FMTException instance corresponding to the specified FMT exception type.
 
static std::unique_ptr< FMTExceptioncreateCoinException (const CoinError &p_CoinException)
 Creates an FMTCoinError exception from a COIN-OR exception.
 
static std::unique_ptr< FMTExceptioncreateBoostGraphException (const boost::bad_graph &p_exception)
 Creates an FMTBoostGraphError exception from a Boost Graph exception.
 
static std::unique_ptr< FMTExceptioncreateUnhandledException (const std::exception &p_exception)
 Creates an FMTUnhandledError exception from a standard exception.
 

Detailed Description

Factory class used to create FMT exception objects.

This factory centralizes the creation of all FMTException-derived objects. It provides methods for constructing exceptions from FMT exception identifiers as well as wrappers for exceptions thrown by external libraries such as Boost Graph, COIN-OR and platform-specific system exceptions.

Member Function Documentation

◆ create()

static std::unique_ptr< FMTException > Exception::FMTExceptionFactory::create ( FMTexc  p_exception,
Core::FMTsection  p_section,
const std::string &  p_message,
const std::string &  p_method,
const std::string &  p_file,
int  p_line 
)
static

Creates a concrete FMTException instance corresponding to the specified FMT exception type.

The returned object is an instance of the FMTException-derived class associated with the supplied exception identifier.

Parameters
[in]p_exceptionType of exception to create.
[in]p_sectionFMT section in which the exception occurred.
[in]p_messageException message.
[in]p_methodMethod in which the exception occurred.
[in]p_fileSource file in which the exception occurred.
[in]p_lineSource file line at which the exception occurred.
Returns
A unique pointer to the created exception object.

◆ createBoostGraphException()

static std::unique_ptr< FMTException > Exception::FMTExceptionFactory::createBoostGraphException ( const boost::bad_graph &  p_exception)
static

Creates an FMTBoostGraphError exception from a Boost Graph exception.

Parameters
[in]p_exceptionThe Boost Graph exception to wrap.
Returns
A unique pointer to the created FMTBoostGraphError exception.

◆ createCoinException()

static std::unique_ptr< FMTException > Exception::FMTExceptionFactory::createCoinException ( const CoinError &  p_CoinException)
static

Creates an FMTCoinError exception from a COIN-OR exception.

Parameters
[in]p_CoinExceptionThe COIN-OR exception to wrap.
Returns
A unique pointer to the created FMTCoinError exception.

◆ createUnhandledException()

static std::unique_ptr< FMTException > Exception::FMTExceptionFactory::createUnhandledException ( const std::exception &  p_exception)
static

Creates an FMTUnhandledError exception from a standard exception.

This method is typically used to convert exceptions originating outside of the FMT exception hierarchy into a managed FMT exception.

Parameters
[in]p_exceptionThe standard exception to wrap.
Returns
A unique pointer to the created FMTUnhandledError exception.

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